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):
foo = bar('spam')
C
foo = bar('')
C
foo = bar('spam')
C
foo = bar
C
print "hello ", name
C
print "hello ", name
VVVVVV
Depends on kana/vim-textobj-user.
If you have Vundle, you can use
Bundle 'kana/vim-textobj-user'
Bundle 'ashleyh/vim-textobj-nl'
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.
I got the idea from Steve Losh's vimrc,
and adapted his comments into this README
.