In the previous part of this series I introduced some very basic concepts of Vi, including some very simple navigation commands. These do not even scratch the surface of what Vi can do. There's no doubt that learning Vi is a huge time commitment before you can begin to use Vi effortlessly. There really is so much to learn. The important thing is to take it one step at a time. Learn the basics and drill those, then slowly add more commands to your commandset over time. If you program for a living, then you're writing code all day long anyway, so you have a lot of typing time to enforce Vi commands into your subconcious muscle memory.
In part one I discussed using the HJKL keys instead of the cursor keys and also introduced a very small number of basic navigation commands. In this post I will introduce the Vi registers.
I was first introduced to Vi 10 years ago when I first started working in the games industry for Razorworks (an Empire Interactive studio). A lot of the developers there used the Open Watcom editor, which is a Vi-style editor. It certainly took a long time to get used to, and I don't think I would have even tried if it wasn't such a big thing in that studio at the time. Watching some of the other coders use it made me want to stick at it though. Watching the code evolve and morph almost organically gave me the motivation I needed to stick at it. And I'm so glad I did. I quickly moved from the Watcom editor to Vim, which is much more popular and widely used. Now my IDE of choice is VisualStudio as I found Vim lacked lots of IDE features that I wanted. Luckily there are two great Vi solutions for Visual Studio - ViEmu and VsVim.