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

How do I move backward to a character on the current line?

Answer

F{char}

Explanation

The F command moves the cursor backward to the previous occurrence of a specified character on the current line. It is the reverse counterpart of f.

How it works

  • F followed by any character searches backward on the current line
  • The cursor lands on the target character
  • Only searches within the current line

Example

const result = getValue()

With the cursor on ), pressing Fv moves the cursor to v in getValue.

Tips

  • ; repeats the last character search in the same direction
  • , repeats it in the opposite direction
  • Combine with operators: dF( deletes backward through (
  • T{char} moves backward to just after the character

Next

How do you yank a single word into a named register?