Is there any way to use a regular expression for moving in Vim?
For example, I want to move my cursor to the first occurrence of the pattern abc
.
Can I do something analogous to fa
but replacing the character a
with a pattern? And can I use regular expressions with the t
and f
commands?
Best Answer
As stated in a comment by Sardathrion, you can search to navigate. This is actually too useful in Vim to ignore. A few tips regarding search to navigate:
incsearch
so that Vim will jump to matches as you type. Hit Enter when you are at the location you want.hlsearch
.nohlsearch
to disable the highlight. It will be enabled again when you do the next search.\v
("very magic").