Getting started with Vim
I’ve started using Vim about a year ago, so I’m definitely not an experienced user. But along the way I’ve learned some neat tricks which I would like to share with you.
First there’s installing Vim itself, sure if you’re a Mac user Vim comes
preinstalled. But if you want it to play nice with some of the available plugins
you’ll need a Vim that’s been compiled with Ruby support. On a Mac there’s a
couple ways to do it:
The awesome way: Google like crazy, find the correct
files, setup the configuration properly and compile it yourself. I’ve tried this
a while ago and got this working in a couple of hours, sadly I broke it several
weeks later and never got it working again.
Luckily there’s another way, The lazy way: brew install macvim
Once you’ve got Vim running it’s time for the hard part, actually using it. When
you’re coming from an editor like Textmate or Sublime or maybe even a complete
IDE Vim will take some getting used to. Luckily Vim has an insanely good
help file. When you start Vim just access it by typing :h
. EVERYTHING is
different in Vim, and made for developer happiness, even something as simply
navigation through a file. Sure you can use the arrow keys to move around, but
there’s ways way more effective than that, and the help file will slowly guide
you through those ways. Just start reading the help file and instead of an
enormous list of options it’ll tell you step by step how to get started. After
you’ve got the basic hang of (very simple) navigation it’ll suggest you to use
vimtutor and I completely agree. Vimtutor is an awesome tool to learn the Vim
basics.
Once you’ve installed Vim and worked your way through Vimtutor it’s time to configure Vim to your own taste, I’ll explain where to get started in a blogpost tomorrow.