Vim is objectively the best code editor there is. [Editor’s note: Opinions are those of the author. Honeybadger remains neutral in the vim/emacs/sublime holy war]
No matter how much you know about Vim, there’s still more to learn. Here are a few features it took me far too long to discover, that I will now aggresively sell to you.
Vim users! Are you tired of reaching all the way up to the
ESC key to leave insert mode?! THERE’S GOT TO BE A BETTER WAY! Starting now, you can use
Ctrl+C to exit insert mode anytime you want! But wait! There’s more! Using
Ctrl+C requires no extra configuration! It comes out of the box with Vim!
Are you a two-keystroke slave? Kill two birds with one stone and save yourself THOUSANDS of nanoseconds over the course of your life by using
:x instead of
:wq when saving and quitting! That’s right,
:x is the exact equivalent of
:wq. Put that in your pipe and smoke it (not literally).
Are you still installing plugins the old-fashioned way? With Vundle, you can install any Vim plugin in just seconds by adding a simple configuration directive! Want to try vim-rails? No problem. Does FuzzyFinder look interesting to you? Throw it on the pile! With Vundle, the world is your oyster!
Jumping among blank lines
k to move among lines can feel at times like jogging through waist-deep water. Why not take the express lane? Pressing
} will allow you to move upward and downward, respectively, from blank line to blank line.
Cleaning up improperly indented code
Let’s face it, your co-workers are idiots. The success of your employer rests squarely on your shoulders and you don’t have all day to spend fixing the poorly structured code written by the protohumans with whom you’re forced to collaborate. Using the magic wand of
= in Vim, you can select any block of text (
Shift+V then up/down), hit the
= key, and presto! Your code will be beautifully indented before you can say “passive aggression”!
Latest posts by Starr Horne (see all)
- How to clear all Sidekiq queues, using the power of emoji - July 28, 2015
- Use any C library from Ruby via Fiddle – the Ruby standard library’s best kept secret. - July 27, 2015
- How to add context data to exceptions in Ruby - July 23, 2015
- Understanding Ruby’s strange “Errno” exceptions - July 22, 2015
- A theoretical introduction to unix daemons in Ruby - July 21, 2015