Ⅰ. 插件描述
A text-object for quoted textⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/vim-textobj-quoted'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/vim-textobj-quoted'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/vim-textobj-quoted'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/vim-textobj-quoted
Ⅳ. 文档说明
A custom text object for selecting quoted text. It depends on awesome Kana's https://github.com/kana/vim-textobj-user.
vim-textobj-quoted gives you two new text-objects:
- iq
That stands for Inner Quoted - aq
That stands for Around Quoted
So, the two text-objects defined will work with the following quoting chars:
- { }
- " "
- ' '
- ( )
Please note that the defined text-objects are single-line oriented. I find them very useful in situations like the following (* indicated cursor position):
- "some awes*ome text"
- (some awes*ome text)
- {some awes*ome text}
- 'some awes*ome text'
In each case you could use commands like viq or ciq and select/cancel all the quoted text. Obviously, you can achive the same results using commands like vi" or vi{. Indeed, the real benefit you'll get using this plugin is that you will have to remember only the q char.