vim-select-replace : selectively replace or delete the cur. word or selected text in multiple places
script karma |
Rating 0/0,
Downloaded by 649 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Enno Nagel |
|
script type |
utility |
|
description |
By this Vim plug-in, you can:
1. Hit c or d followed by *, #, g* or g# to replace respectively delete the current word. Now either:
A. Press n/N to skip the next occurrence of this word, or
B. Press . to repeat the previous move and change or deletion.
1. Hit s or x in visual mode to replace respectively delete the selection under the cursor. Now either:
A. Press n/N to skip the next occurrence of this selection, or
B. Press . to repeat the previous move and change or deletion.
# Configuration
To change the default mappings, add your modifications of
omap * <plug>(vim-select-replace-star)
omap g* <plug>(vim-select-replace-g-star)
omap # <plug>(vim-select-replace-hash)
omap g# <plug>(vim-select-replace-g-hash)
xmap s <plug>(vim-select-replace-s)
xmap x <plug>(vim-select-replace-x)
to your vimrc.
# Hints
To selectively replace by a confirmation dialog the current visual selection
by a string to be supplied on the command-line, add
xnoremap S "*y<Esc>:<c-u>%substitute/\V<c-r>=substitute(escape(@*, '\/\|'), "\n", '\\n', 'g')<cr>//cg<Left><Left><Left>
to your vimrc!
# Credits
These ideas to make good use of ":help v_gn" have in essence been divulged by Romain Lafourcade.
# Issues
vim-select-replace is developed at
https://github.com/konfekt/vim-select-replace
where issues can be filed.
|
|
install details |
Unzip vim-select-replace.zip into ~/.vim on Linux or %USERPROFILE%\vimfiles on Windows. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 207.241.235.164
|