Ⅰ. 插件描述
Text-object like motion for text surrounded by a symbolⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lzh9102/surround-textobj-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lzh9102/surround-textobj-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lzh9102/surround-textobj-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lzh9102/surround-textobj.vim
Ⅳ. 文档说明
surround-textobj.vim
In vim, one can quickly delete or change the text surrounded by parentheses and
quotes using motion and text-objects. For example, di' will delete the text
between two 's, and da" will delete the string between two "s alongwith
the surrounding quotes. This plugin simulates similar text-object motion for
many other symbols.
After installing this plugin, you can, for instance, delete the text between
two $s by typing di$. However, its counterpart da$ is a little bit
different from that of quotes and parentheses. Command da$ will only delete
one of the two $s instead of both of them. This behavior is intentional. The
reason is that dasymbol can be used to delete _symbol_-delimited fields.
For example, when cursor is placed inside long inunderscore_delimited_long_variable, typing da_ will change the string tounderscore_delimited_variable instead of underscore_delimitedvariable.
The symbols to be included can be changed by settingg:surround_textobj_symbols to a string containing desired symbols in~/.vimrc. The default setting is
let g:surround_textobj_symbols = '~!@#$%^&*_-+=;:/?.,'Copyright
This plugin is distributed under the terms of the Vim license. See:help license for the full text of the license.