vim repeat find next character 'x'

epsilonhalbe picture epsilonhalbe · Apr 26, 2012 · Viewed 23.6k times · Source

I often navigate in vim by f x to find next occurrence of character 'x', but overlook that there is a word (or more words) containing 'x' in between the word I want to edit and the beginning cursor position.

So i have to f x again, which is kind of annoying since there is this nice button ., which does repeat the last command. So is there a way to repeat f x with a single button press.

Answer

Jeremiah Willcock picture Jeremiah Willcock · Apr 26, 2012

The command to repeat an f is ; (semicolon); , (comma) reverses the direction of the search.