Thursday, June 15, 2006
Tuesday, June 07, 2005
remotesplit for cscope revisited
I've decided to go with a remote tactic that's slightly more reliable than my previous tactic: Name the gvim server by the contents of the $DISPLAY variable. I have side-by-side PCs with their own X-servers, so I want to send the file to the gvim server that is outputting the same place as my cscope session. I now grep the $DISPLAY out of the gvim server list, to determing whether I am going to set up a new server or use an existing one.
My remotesplit:
gvim --serverlist | grep -i "$DISPLAY" 2>/dev/null
if [ $? -ne 0 ]
then
gvim --servername $DISPLAY $*
else
gvim --remote-send "<ESC>:sp $CSCOPE_ROOT/$2<CR>:0<CR>:$1<CR>:-1<CR>" 2>/dev/null
fi
My remotesplit:
gvim --serverlist | grep -i "$DISPLAY" 2>/dev/null
if [ $? -ne 0 ]
then
gvim --servername $DISPLAY $*
else
gvim --remote-send "<ESC>:sp $CSCOPE_ROOT/$2<CR>:0<CR>:$1<CR>:-1<CR>" 2>/dev/null
fi
Labels: vim
Monday, May 16, 2005
remotesplit for cscope
On a multiuser environment, I added the 'ps -fu' bit to detect a gvim session, slightly more fool-resistant than just checking the result code of the --remote-send call.
My remotesplit:
ps -fu $LOGNAME | grep -v grep | grep gvim 2>/dev/null
if [ $? -ne 0 ]
then
gvim $*
else
gvim --remote-send "<ESC>:sp $CSCOPE_ROOT/$2<CR>:0<CR>:$1<CR>:-1<CR>" 2>/dev/null
fi
My remotesplit:
ps -fu $LOGNAME | grep -v grep | grep gvim 2>/dev/null
if [ $? -ne 0 ]
then
gvim $*
else
gvim --remote-send "<ESC>:sp $CSCOPE_ROOT/$2<CR>:0<CR>:$1<CR>:-1<CR>" 2>/dev/null
fi
Labels: vim
Friday, April 29, 2005
gvim-specific
- :menu MENUBARITEM.DROPDOWNITEM [keystrokes go here] - Appends/updates a drop-down menu, MENUBARITEM, with DROPDOWNITEM as the last menu selection. When this menu is selected, the keystrokes specified at the end are entered.
:hi Search guibg=LightGreen - change background for search highlighting.
Labels: vim
Command line options
-o N - open N windows, or as many windows as file arguments passed (open windows as splits within the same session)
Labels: vim
