sponsor Vim development Vim logo go to HTTPS page Vim Book Ad

remcmd.vim : Send commands to remote Vim sessions

 script karma  Rating 20/5, Downloaded by 1859    Comments, bugs, improvements  Vim wiki

created by
Hari Krishna Dara
script type
This script came out of my misc utility functions to send some useful commands to a remote Vim session. It basically adds four commands as follows (assuming that your <Leader> is set to \):

    \ro - Opens the current file in a remote Vim session.
    \re - Executes a command in the remote Vim session.
    \ta - Opens the current tag in the remote Vim session.
    \ts - Selects the current tag in the remote Vim session.

Each one of the above commands prompts the user to select the name of a remote Vim and executes the command. To make your life easier, it even remembers your previous selection, so repeated execution of remote commands in the same remote Vim session is easy.

Though it adds only 4, it is because I don't know what commans other might like to add. But it is easy enough for you to add your favourite commands this way. It exposes the basic functions necessary to do it yourself from your own script or .vimrc:

       RemCmdServerList(), RemCmdSelectServer(), RemCmdSendRemoteCommand()

Take a look at the script on how to use these functions. For convenience, you can add regular and/or popup menu group for this with the name "Remcmd" by setting some global variables in your .vimrc. Take a look at the script header for details.
install details
Just drop it in your plugin directory or source it from your .vimrc.

You need multvals.vim (2.0.4) for this to work, download from:

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
remcmd.vim 1.0.7 2002-02-20 6.0 Hari Krishna Dara Added register sharing capability with some limitations. You can specify a list of comma separated local registers to be synced to remote registers. You can even specify a different remote register than the local one. The following is very useful:

  let g:remcmdRegisters='"'
  let g:remcmdRemoteRegisters='r'

This makes whatever you copy in whichever Vim window always available in the r (for remote) register of other vim windows. However there are some limitations, it doesn't automatically sync when the yank (or delete) command starts with y (or d), such as y'a. Use RCmdSyncRegisters or the SyncRegisters menu (if menu is enabled) to force a sync. You can enable the main menu or popup menu by setting the following variables:

    let g:remcmdAddToMenu=1
    let g:remcmdAddToPopupMenu=1

Please see the script for more features, sorry I don't have time to write a help page. Please send in your feedback.
remcmd.vim 1.0.3 2002-02-04 6.0 Hari Krishna Dara Added RCmdPresetServer command that takes in a server name to be used for all the operations. Until you call the same command passing an empty string "", you will not prompted to select the server, which makes it easy to execute repeated remote commands in the same remote session.

Also added two new commands \sf and \sb to search forward and backward for the current word in the remote session.
remcmd.vim 1.0.1 2002-01-11 6.0 Hari Krishna Dara Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo