I can use f or F to highlight/change or jump to the next occurrence of say, a comma.

This is way useful, but is there a way to highlight/change to the character just before?

Say I have some code:

this.remove (object, index + 1, name)
                     ^ cursor

and want to replace the index + 1 with location? cf, will require me to retype the comma location, in my replacement text.

Is there a command already to do this, or how would I go about adding this to my Vim?

1 Answer 1


You should have scrolled a bit when you read :help f:


See :help t.

  • 1
    Another great shortcut I've found is ; repeats the last f F t T command used.
    – Robin
    Commented Oct 13, 2015 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.