Vim Mnemonic Devices

1 minute read


A pneumonic device helps us remember something seemingly abstract by giving it a familiar context. For instance, to remember the planets in order from closest to furthest from the sun you could use the handy “My Very Educated Mother Just Served Us Nectarines”.

When I first learned Vim I just spent a couple of hours to remember them, but that prevented me from utilizing the slightly more abstract and less often used commands. Realizing that ‘i’ means ‘insert mode’ I started to look for other keys based on commands. Then I realized that it doesn’t matter how logical it is, if you remember it then that is good enough. It reminds a little bit of the book, Moonwalking with Einstein

NOTE: This won’t teach you Vim at all, just how to remember some of the keys.

List of Vim Commands

  • i - enter insert mode
  • v - enter visual mode (duh)
  • a - append
  • d - delete a character.
  • D - DELETE whole line!
  • p - paste
  • c - small change
  • C - enter CHANGE mode to
  • u - undo
  • t - to
  • f - forward
  • ; - keep going to the next (yes this is weak but a reference of how a semicolon is like a period but without the hassle of the capitalization of the next complete thought)
  • y - yank from last register
  • dit - delete inner tag block <html>test</html> –> <html></html>
  • dst - delete surrounding tag block <html>test</html>–>test
  • cit - change inner tag block: same as dit but put your cursor in insert mode
  • r - replace a single character
  • R - enter REPLACE mode to overwrite characters continuously
  • z - foldz for dayz (yes, it’s weak)
  • zf - foldz
  • gq - (with jdaddy.vim) gorgeous json quickly on the visual selection without much work (yes, very w
  • 0 - the start of the line you start with nothing and you have to build up to be rich
  • $ - when you are rich, you have money, and you are at the end of the line and of your goal
  • J - join the visually selected lin