Let's say I have the string
hello how-ar[]e-you doing
where []
is my cursor. How would I efficiently select how-are-you
such that
hello [how-are-you] doing
So far what I could come up with is Bvt<space>
Vim has the notion of "word" and "WORD", where a "word" is a sequence of characters in the 'iskeyword'
option and a "WORD" is a sequence of non-whitespace characters.
Thus…
w
motion ("word") would jump to the -
after are
because -
is not part of 'iskeyword'
,W
motion ("WORD") would jump to doing
,iw
text-object ("inner word") would cover are
,iW
text-object ("inner WORD") would cover how-are-you
,What you are looking for is the iW
text-object:
viW
:help navigation
will blow your mind.