Reputation: 343
I'm editing prose in vim, and f is a quick way to move, but it would be quicker still if I could limit f to matching initial characters. I know about w and e, and I use those, too, but they aren't great for long lines.
Upvotes: 0
Views: 68
Reputation: 31419
You could always just use normal searching.
/\<f
Would search from the current to the next word that starts with f. If you wanted to you could make a mapping for it using getchar()
. An example of this would be
:nnoremap <expr> <f2> '/\<' . nr2char(getchar()) . '<CR>'
Which would map <f2><char>
to jump to the next inputed char.
Upvotes: 4