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
finitiates 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 lastf/F/t/Tmotion in the same direction - Press
,to repeat the lastf/F/t/Tmotion 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
fwith 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