Ⅰ. 插件描述
Extended Visual Mode Commands, Substitutes, and SearchesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/vis'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/vis'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/vis'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/vis
Ⅳ. 文档说明
I'm hereby making the <vis.vim> script, long available at http://www.drchip.org/astronaut/vim/index.html#VIS, also available here at vim.sf.net. There are two commands made available: B and S.
Visual Commands:
B
Use V, v, or ctrl-v to visually mark some region. Then use
:B cmd (this command will appear as: :'<,'>B cmd)
The command will then be applied to just the visually selected region.
For examples:
Use ctrl-v to select a column and then do a substitute on just that column.
ctrl-v ..move.. :B s/pattern/becomes/
Use ctrl-v to select a column, then apply an external filter to just that column.
ctrl-v ..move.. :B !sort
Visual Searches:
S
Use V, v, or ctrl-v to visually mark some region. Then use
:S pattern (this search will appear as :'<,'>S pattern)
The search will then be applied to just the visually selected region.
It may be repeated with n and N commands, too (without having to
re-mark the region). A plain S will apply the last :S-pattern
to the latest selected region.
Related Subjects:
- For incrementing/decrementing numbers, dates, and letters in a column: see vimscript#670 and vimtip#150
- For sorting based on a column (column-restricted, whole lines but column-keyed), see vimtip#588
- For overwriting visual blocks with other visual blocks: see vimtip#808
- For more on applying substitutes to a visual block: see vimtip#63
- For swapping pairs of visual blocks: see vimtip#329
(alpha/beta version available at http://www.drchip.org/astronaut/vim/index.html#VIS)