Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ashleyh/vim-textobj-nl'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ashleyh/vim-textobj-nl'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ashleyh/vim-textobj-nl'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ashleyh/vim-textobj-nl
Ⅳ. 文档说明
vim-textobj-nl
Please note that this plugin is still in development
Motion for "next/last object". "Last" here means "previous", not "final".
Unfortunately the p motion was already taken for paragraphs.
Next acts on the next object of the given type, last acts on the previous
object of the given type. These don't necessarily have to be in the current
line.
Currently works for (, [, { (and their respective shortcuts b, r, B)
and single- and double-quotes.
Some examples (C marks cursor positions, V means visually selected):
din': delete in next single quotes
foo = bar('spam')
C
foo = bar('')
Ccanb: change around next parens
foo = bar('spam')
C
foo = bar
Cvin": select inside next double quotes
print "hello ", name
C
print "hello ", name
VVVVVVInstallation
Depends on kana/vim-textobj-user.
If you have Vundle, you can use
Bundle 'kana/vim-textobj-user'
Bundle 'ashleyh/vim-textobj-nl'Tests
There are some tests, written using vader.
There is a script to run the tests at ./test/run.sh.
It will try to sort out the test dependencies for you.
If you run it you will (hopefully) find yourself in vim with a screenful of test results.
Credit
I got the idea from Steve Losh's vimrc,
and adapted his comments into this README.
