Ⅰ. 插件描述
Helpful text object behaviour in VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lumiliet/vim-smart-object-it-has-you'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lumiliet/vim-smart-object-it-has-you'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lumiliet/vim-smart-object-it-has-you'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lumiliet/vim-smart-object
Ⅳ. 文档说明
# vim-smart-object
Usually if you type ci{ while not in a {} block nothing will happen. This plugin makes Vim look for a block on the same line before giving up. This saves you two keystrokes and less than a second. No big deal, but it feels a lot smoother to do some common programming tasks.
Examples
function foo(bar, soo) {
return;
}Take this very useful snippet. With the cursor on the beginning of the first line you can do several neat things. ci( will empty the arguments so you can write others. ci{ deletes the function body and lets you write a new one. da{ deletes the entire function body including {}.
Options
Add the following options to your .vimrc to customize the behaviour.
g:smart_object_commands
Specify the commands to use with this plugin. Default is c,d,y.
let g:smart_object_commands = 'c,d'g:smart_object_blocks
Set the block types to use. Default is {},(),[].
let g:smart_object_blocks = '(),[]'