vimtricks.wiki Concise Vim tricks, one at a time.

How do I jump to a specific character on the current line?

Answer

f{char}

Explanation

The f{char} command moves the cursor forward to the next occurrence of {char} on the current line. It is one of Vim's fastest and most precise horizontal motions, letting you jump directly to any character you can see.

How it works

  • f initiates the "find" motion
  • {char} is the character you want to jump to
  • The cursor lands on the matching character
  • The search only covers the current line — it will not wrap to the next line

Example

Given the text with the cursor on the T:

The quick brown fox jumps

Pressing fq moves the cursor directly to the q of quick. Pressing ff from there moves to the f of fox.

Tips

  • Use F{char} (uppercase) to search backward on the current line
  • Use t{char} to jump to the character just before the match ("till")
  • Use T{char} to jump backward to the character just after the match
  • Press ; to repeat the last f/F/t/T motion in the same direction
  • Press , to repeat the last f/F/t/T motion in the opposite direction
  • Combine with operators: df. deletes from the cursor through the next period, ct) changes everything up to (but not including) the closing parenthesis
  • Use f with unique characters for fastest navigation — target punctuation like (, ", or : since they tend to be less ambiguous than letters
  • If the character appears multiple times, use 2f{char} to jump to the second occurrence, or press ; to step through matches one at a time

Next

How do I edit multiple lines at once using multiple cursors in Vim?