Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump to a specific character in vim?

Tags:

vim

macvim

How can I jump to the next character X in vim?

I frequently use, e.g., dt: or ct: to delete/change everything up until a colon (or some other character).

Is there any short key combo to simply move my cursor position to that character?

like image 201
Jeff Avatar asked Feb 22 '12 20:02

Jeff


2 Answers

You can type f<character> to put the cursor on the next character and F<character> for the previous one.

like image 104
Lars Kotthoff Avatar answered Sep 28 '22 16:09

Lars Kotthoff


t and f work without a command as well, so to move to colon use f: and to move to right before colon use t:

like image 20
Brian Rasmussen Avatar answered Sep 28 '22 17:09

Brian Rasmussen