What Vim features do you use? [closed]

I spend almost all day programming in Vim and I am sure that a lot of you do too. What features do you use that make your day to day coding that much better? One that I use is gv, which will let you reselect the previously selected text. It is great for reindenting!


:%s/x/y/g

This command replaces all instances of x in the current file with y. This is basically just a find and replace, but I use it so often since I've learned it at work that it has become invaluable.

Also, /search string

then n to navigate through all instances of the search string within the file. Great for doing manual tweaks a lot more easily, especially if you can't apply a rule to the entire file.


== does nice auto-indenting on the current line.

Normally, though, I use = with a motion, like =G to indent to the end of the file, or =i} to indent inside the current set of curly braces.


=% for auto-indenting everything within a block of code.