That’s not writing at all

Cheatsheet of some of the more useful vim commands I have run into lately:

  • ci(, ci{, ci<, ci", ci' – Delete and insert into text between (, {, <, “, etc.. brackets.  Really useful for things like function arguments and quoted text.
  • ca(, ca{, ca<, etc... - Same as above but removed the "bracket" as well.
  • yi(, di{, va<, .. – Yank content between ( and ), delete content betwen { and }, select content between < and > including brackets, etc..
  • ZZ – Quick same/close, works the same as :x.
  • * – Search for word under the cursor.
  • gv – Re-select previous selection block
  • q<letter> @<same letter> – Record a macro with q (named letter) and play it back with @.