[Notes] Vim: From Essentials to Mastery by @wnodom

2011-09-19

This morning at Strange Loop 2011, I had the opportunity to attend Bill Odom’s excellent vim talk. Bill co-runs the local vim-geeks group and I have attended his talks on vim in the past and every single time he has impressed me and managed to teach me more and more–he’s a true master at it.

Bill has already managed to put his 300 slides online. I should note that we didn’t go through all 300 slides (I don’t believe that’s even possible in an hour), but instead we jumped around based on the core concepts that Bill wanted us to learn and the things that the audience thought most interesting. So, I’m posting my notes here just to highlight a few things that I saw as notable.

Sorry for any typos, and if you see anything that’s incorrect, please let me know. I had to type quickly to try to keep up, so I can’t guarantee that it’s 100% correct.

Help

  • :help :help
  • :helpgrep (:helpg)
  • :help!
  • :h holy-grail
  • :h 42

vim

  • (insert) (C-O) gets you out to do a single normal mode command
  • Normal mode
    • Moving around
      • H – high
      • M – middle
      • L – low
      • gj – up screen lines
      • gk – down screen lines
    • Traveling without moving
      • zz – shifts line to middle
      • zt – shifts line to top
      • zb – shifts line to bottom
    • * – find the word you’re sitting on (search forward)
    • # – find the word you’re sitting on (search backward)
    • g* – same thing as *, but in a different way
    • g# – same thing as #, but in a different way
    • @: – rerun last command

Command line mode

  • Ex commands
  • Search commands (!)
    • Pump your text to an external program and then push it back into your file
  • Filter commands

Plugins

Registers

  • 26 named register ("a through "z)
    • Uppercase the name to append
  • Numbered registers ("1 through "9)
  • :reg shows registers
    • Can be more specific: :reg adg
  • "% – current filename
  • "# – alternate filename
  • "_ – Last “small” delete
  • "/ – Last search
  • ": – last Ex command
  • "* – system clipboard
  • "+ – system selection (X11)
  • "_ – black hole: delete without storing in a register
  • (C-R)register – accessing registers
  • :let @a = "" – assign register
    • macros and registers say
  • (C-R)= – calculator
  • qaq – Record an empty macro

Resources

← all posts

michael schade

I like learning new things. Previously: Kenchi founder, eng & ops teams at Stripe from 2012-2019. Say hi! 🏳️‍🌈