How to jump to a specific character in vim?

VimMacvim

Vim Problem Overview


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?

Vim Solutions


Solution 1 - Vim

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

Solution 2 - Vim

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:

Solution 3 - Vim

If you do a search for that character with /, you can then hit n to move to the next occurrence of it.

Solution 4 - Vim

Maybe you are just searching for a pure vim combination but EasyMotion is a plugin that worth trying. HTH. :)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeffView Question on Stackoverflow
Solution 1 - VimLars KotthoffView Answer on Stackoverflow
Solution 2 - VimBrian RasmussenView Answer on Stackoverflow
Solution 3 - VimAlexander CorwinView Answer on Stackoverflow
Solution 4 - VimPhilia FanView Answer on Stackoverflow