Some friends were talking about National Novel Writing Month and since I don’t have an idea for a novel but felt like trying to accomplish something in November, I decided to switch my text editor to vim. Specifically MacVim which I think is an important distinction I’ll explain below.
Now, I learned vi back in college in 199ksjdfl and I use it regularly on servers because pico without an actual GUI to click on locations is cumbersome and most of what I need to do when editing server files is delete whole lines or replace a value or add a new line.
Since I already had a basic grasp of vi and people seemed to think they were more productive with vim, I figured it might be time to see if it would work for me.
Starting out I think I had three concerns:
- I use file tabs and the file browser in my current editor Textmate a lot. So much that I didn’t think switching to vim would be able to address that given what I knew about vim.
- I love my current theme Vibrant Ink, which I wasn’t ready to part with.
- It’s confusing. And not in a way that I thought’t I’d never get it, but more in that I didn’t want to give up a week of learning to become only a bit more productive. I’m in the middle of a big project for a client and I didn’t want to be billing them for my slowness.
So last week I did some poking around and it turns out there’s something called ‘vimtutor’ already installed on OS X. I started it up and discovered I knew a lot more than I realized. If you’re on a Mac and have about a half hour you should try vimtutor right now. If you know a bit about vim already it will be a breeze. When I finished I knew I could keep going with learning vim so I did some more reading.
The next two things to really convince me I could do it was:
- Finding out there was a Macintosh specific version of vim called MacVim that is a self-contained, windowed Cocoa application. This is good because there are some key-bindings in place that you are probably used to that don’t exist in standard vim. Hitting ⌘s in MacVim will actually save your file. You can use your mouse to select text and holding shift + moving your cursor around will select text.
- Installing a vim distribution called Janus that installs a whole mess of plugins and tools that make transitioning to vim much easier. There’s a file browser (like in Textmate) and it even comes standard with the Vibrant Ink theme (type :color vibrantink) or set it up in your new .vimrclocal file by adding “color vibrantink” without the quotes. There are a lot of themes.
After this, I read these blog posts:
- A Starting Guide to VIM from Textmate
- TextMate to Vim with training wheels
- Your problem with Vim is that you don't grok vi
And then I wrote this blog post you’re reading now in my shiny new compiled version of MacVim.