sponsor Vim development Vim logo Vim Book Ad

zshr.vim : substitute and execute previous command.

 script karma  Rating 0/0, Downloaded by 427  Comments, bugs, improvements  Vim wiki

created by
omi taku
 
script type
utility
 
description
Substitute previous command string, and execute substituted command.
This plugin add ":R" command to your vim environment.

------------------------------------------------------------------------------
[command syntax]

:R {old}={new}
:R {old1}={new1} [{old2}={new2} {old3}={new3} ...]

------------------------------------------------------------------------------
[command example - 1]
1. Execute a command.

    :%s/aaabbbccc/xxxyyyzzz/g


2. Execute ":R" command with replacement parameters.

    :R a=m

   (find "a" in last command, and replace "a" to "m".)


3. Vim editor execute this command.

    :%s/mmmbbbccc/xxxyyyzzz/g


------------------------------------------------------------------------------
[command example - 2]
4. You want to use multiple replacement parameters,
   you execute command this example.

    :R a=m ccc=xyz bb=123

   (find "a" in last command, and replace "a" to "m".
    find "ccc" in last command, and replace "ccc" to "xyz".
    find "bb" in last command, and replace "bb" to "123".)

 
install details
1. Copy the zshr.vim script to
   $HOME/vimfiles/plugin or $HOME/.vim/plugin directory.
   Refer to ':help add-plugin', ':help add-global-plugin' and
   ':help runtimepath' for more details about Vim plugins.

2. Restart Vim.

3. "zshr.vim" plugin add ":R" command to your vim environment.

 

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
zshr.vim 0.5 2008-07-31 7.0 omi taku Initial upload
ip used for rating: 35.172.195.49

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.
   
OSDN.net Logo