vim plugin for quick and easy replacement
- Intuitive replacements.
- Real-time highlighting of replacement targets.
- Easily replace the word under the cursor.
- Leave the replacement history in the command line history.
- The function to replace only the selected area in visual mode.
First, create a directory to put this plugin. (check your packpath
.)
$ mkdir -p ~/.vim/pack/kqito/start/
$ cd ~/.vim/pack/kqito/start/
Next, download this plugin.
$ git clone https://github.com/kqito/vim-easy-replace
Now you can use easy-replace
.
You can install it as follows.
-
Plugin 'kqito/vim-easy-replace'
-
call dein#add('kqito/vim-easy-replace')
-
Plug 'kqito/vim-easy-replace'
By default, you can start using easy-replace with the map <Leader>ra
Also, you can use <Leader>rc
to replace the word under the cursor.
You can start easy-replace with <Leader>ra
(default) while selecting a range from the visual mode, then start using easy-replace for the range.
You can customize some options.
variable name | default value | description |
---|---|---|
g:easy_replace_enable | 1 | Enable easy-replace . (If set 0, easy-replace will not work.) |
g:easy_replace_launch_key | <Leader>ra | Key to launch easy_replace |
g:easy_replace_launch_in_visual_key | <Leader>ra | Key to launch in visual mode easy_replace |
g:easy_replace_launch_cword_key | <Leader>rc | Key to replace the word under the cursor with "easy_replace". |
g:easy_replace_launch_cword_in_visual_key | <Leader>rc | Key to replace the word under the cursor in visual mode with "easy_replace". |
g:easy_replace_highlight_ctermbg | 'green' | Color for highlighting the replacement target. |
g:easy_replace_highlight_guibg | 'green' | Color for highlighting the replacement target. |
g:easy_replace_add_history | 1 | Leave the replace command in the command line history after the replacement. |