Last Updated: February 25, 2016
·
440
· simaob

Go to char in Vim

In Vim you can go to a character in a line by pressing f and the character that you want.

I find this command very helpful to navigate inside a line, and in various cases I think that it is faster than moving word by word (with the command w).

I also often use f to delete parts of a word or even of a line by using it in combination with d. For instance dfA would delete from the point of this line where you were until this A. Unless you are after it, in that case you should use dFA to search backwards.

If you have the same character being used several times in the same line you can prepend a number before using f, but sometimes you also need a very sharp eye. :)