How to move cursor to specific word in current line in Vim

Viewed 8298

Let's say we're currently in this line of code:

readonly L|a|zy<ICountryRepository> countryRepo;

and the cursor is in the position of letter "a", as shown in the code between two "|" symbols.

Now I want to move my cursor to the letter y of the word countryRepo, how can I do that using the minimum key strokes?

(Currently I'm using the key sequence of fyfyfyfy in normal mode ... Kind of stupid)

7 Answers

use / for search, then type your word and press Enter

however, if you want to jump to next word, just press n

Related