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

If you have vim-easymotion, https://github.com/Lokaltog/vim-easymotion

You can do <leader><leader>t and then search for letter y. It's not that fast for the letters on the same line though. The real advantage is when you jump in the entire file.


I can think of:

4fy 

But you should only do this if you are some strange robot.

/co<cr>fy

Which is one character shorter than your solution, but more easy..

Wfy

Go one WORD forward and then find y.

f>fy

Something like this I would do. Depends on what popups in my mind.

You should look into the easymotion plugin, which helps with arbitrary movements.

EDIT:

easymotion is rather worthless here, it is more useful for jumping to targets further away.


If you know that it's the 4th y, you can do

4fy

If you know it's the last y in the line, you can do

$Fy

If you don't know at which position it is, you can still do

fy;;;

In this case, I would use

W

to move to countryRepo, followed by

fy

Tags:

Vim