Ⅰ. 插件描述
Quick search and replace for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'hauleth/sad-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'hauleth/sad-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'hauleth/sad-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/hauleth/sad.vim
Ⅳ. 文档说明
# Seek and Destroy
Simple Vim plugin that allows you to quickly search and replace occurrences of
text.
Visualisation

Description
This plugin provides quick search and replace mapping. Example
ab|ba <- `|` denotes cursor
baba
abbaAfter siwtest<ESC> looks like:
|test
baba
abbaNothing impressive? I agree, the same could be achieved via ciwtest<ESC>, but
everything changes after you press ..
test
baba
|testWooot? What kind of magic is that? Oh, and this also works on visual selections.
Nice.
Also by the chance (and because it is also part needed for this plugin) it
provides visual * and #.
FAQ
But what about default s and S behaviour?
Just use c_ or cc.
But what about interference between this and [vim-sneak][]?
Create your own maps:
" Normal mode
nmap <leader>s <Plug>(sad-change-forward)
nmap <leader>S <Plug>(sad-change-backward)
" Visual mode
xmap <leader>s <Plug>(sad-change-forward)
xmap <leader>S <Plug>(sad-change-backward)Are there any easter eggs about name?
Not yet. And ever if there would be, then what is the point in telling you
anyway?
Why not multiple cursors?
Except obvious corner cases like out of view cursor [multiple cursors doesn't
play well with gap buffers that are used in Vim and Emacs][gaps].
Todo
- [x]
allow setting register which will contain changed text - [x]
do not remapsandSif there already exist any mapping - [x]
turn search highlight right afters{movement}