Registers open up a world of possibilities in Vim. If you’re not using them, then you’re potentially limiting your Vim productivity.
For example, how many times has the following situation happened to you?
You want to copy a line of text so you:
Yank the line in question
Delete another line along the way
Attempt to put the original line, accidentally putting the deleted line
This was a major hurdle while switching from RubyMine to Vim full time. Luckily I had a much more experienced, handsome coworker (shoutouts to Tony) who revealed to me the awesome that are Vim registers.
To see them in action yourself, open Vim and type
No, seriously, do it. I’ll wait.
Want to put the last line you yanked and NOT the last one you deleted?
Cool right? Now, let’s go over another example.
Another fantastically useful feature of registers are named registers. This gives you the ability to store text under an alias for later use.
In this example I copy the final line to the ‘a’ register with:
and you then you can see it in the ‘a’ register!
This text can later be put with:
We’ve only scratched the surface on what’s possible with Vim registers. Use Vim and Vim Casts both have excellent tutorials for more information.