Practical Vim - A Short Review

3 minute read

What is Vim? Since you’re reading this, I’m pretty sure you have at least a vague idea of what it is. Here’s what it says on the tin of Practical Vim by Drew Neil.

Vim is a fast and efficient text editor that will make you a faster and more efficient developer.

image

I know a couple of developers that use Vim, and none of them strike me as particular fast and efficient in their usage of Vim. That includes myself. When I use Vim I usually spend about 50% of my time googling how to do something. Which is why I resolved to learn to use Vim properly™. New Year’s resolution, you know? In my research of how to actually get any better in Vim I stumbled over Practical Vim.

To make something clear upfront: I love this book. Maybe the title “A Short Review” is misleading, because honestly, I just want to tell you about my favourite bits and pieces. No constructive criticism to find here, just an unabashed hymn of praise.

The Best Parts

Practical Vim is structured in six major parts, but before that comes the introduction which already includes some insanely useful info.

  • The Dot Command. If I knew that I could use . to simply redo ciw{someword}<ESC> earlier I would have saved myself a lot of time.
  • The Ideal Strategy. Drew Neil really drives home the point that most of the time, you won’t need to type a lot to get stuff done with Vim. There are commands to repeat changes you made. There are commands that do the same job than a bunch of other commands combined. Why would you do $a if you can just do A?

My favourite chapters apart from that were probably “Getting Around Faster” and “Registers”.

  • Don’t use the Arrow Keys. Here and there there are configuration options that you can just chuck in your .vimrc. There’s even one to disable arrow keys in Vim. Super useful to get into the habit of using hjkl.
  • Text Objects. I didn’t even know they were a thing. You can apply commands to almost any selection. Use W to select any continuous chain of signs. Use it to select the inside of tags. These are real time savers.
  • Automatic Marks. You can use % to jump to a matching bracket. You can use ` ` to jump back to the location from which you started. Makes navigating so much faster. And more fun!
  • Use Named Registers. It happened way too often that I would yank something, then press x and wonder where my yanked content went. I’m still trying to get into the habit of using "_d to just make things disappear. Access the system register with "*.
  • Fix Typos. This still blows my mind. How do I turn ‘typso’ into ‘typos’? Just do fsxp.

That’s not to say that all the other parts weren’t great. “Files” and “Patterns” blew my mind, but I’m still trying to get a hang of those topics. There’s only so much you can learn at once.

Here’s the things that the book talks about that I haven’t had the opportunity to implement yet.

  • Buffers, Buffers, Buffers. What you see in Vim is only a single buffer. You can have more than one open using tabs. Or split views. Oh, you can also navigate between them. Or run ex-commands on all the buffers in your file list.
  • Patterns. I’m at the point where I can write some substitution commands without searching for tutorials first, but there is so much more you can do with search and replace.
  • Tools & Config. Drew Neil recommends a bunch of plugins that each add their own little commands to make your life easier. There are also dozens of tips on how you can tweak your .vimrc.

Lots of things. Almost overwhelming. Luckily, Drew as a couple of words of advice on how to continue your Vim journey.

Know the saw, then sharpen it.

Make it your goal to learn three new commands a day. Keep practicing.

I’m planning to follow that advice, because so far, it has been incredible fun.

TL,DR

Practical Vim by Drew Neil is an awesome book if you want to learn Vim. If you use Vim every now and then you should probably still read it.

Updated: