After putting it off for too long, I finally started digging into the vim(1) manuals. Naturally, I’ve already learned a ton. Including a few new tricks that will antiquate old (, bad) habits.

  • :g[lobal]/{pattern}/[cmd]: perform cmd on lines that match pattern. This is handy for sorting #include statements: :g/^#include/sort
  • {visual}J: the vim(1) analogue to python’s join() method. I used to do this by visually selecting some text, then running :'<,'>s/\n//g. Hitting J is much faster.