TextMate was my trusty Mac code editor for many years. It seemed everyone who was anyone was using TextMate, especially if they were living in the Ruby on Rails world. Unfortunately, this great editor did have some shortcomings, and improvements were few and far between, with an uncertain future. As many developers began migrating to other, more powerful editors, I resisted for a while, but ultimately made the decision early this year to leave TextMate behind and move to MacVim. It’s also noteworthy that while I’d been a TextMate fan for five years or so, for the 19 years prior I coded almost exclusively in Emacs.
Moving to MacVim was a major decision for me, as I’d never been a vi user before, and the key thing I’d learned through 24 years of “near misses” with vi was that it was a different breed of editor than anything else out there. I knew that hardcore vi users swore by it, but I also knew that it had a steep learning curve, due the drastically different method of editing it employed. Over the years, I only accumulated enough vi knowledge to make the simplest edits to unix configuration files, and save my work. When I made an error, I’d quit without saving, and try again. But I’d also always had a strong preference for using the keyboard for as much as possible, foregoing the mouse (or more recently, the trackpad) whenever possible, and ultimately this was what drew me to finally tackle vi rather than move to Coda, Sublime Text, or other traditional editors.
Now that I’ve been using MacVim as my editor exclusively for nine months, I’ve been reflecting on the journey. Most importantly, I’m “sold” on the power of vi, and have no regrets about my switch. As expected, the learning curve was substantial, but I found many helpful pointers along the way, and I have a long way yet to go. Some of the critical guides and tools that helped me get started include:
- A Starting Guide to VIM from Textmate
- Textmate to VIM
- Coming Home to Vim
- Use Vim Like A Pro
- Vim Text Objects: The Definitive Guide
- Vim Tutorial Videos
- Janus: Vim Distribution
Vim Text Objects: The Definitive Guide was one of the later guides I followed, but helped the most in providing me with the “a ha!” moment where all the puzzle pieces fell into place and finally stayed stuck in my brain. The Janus distribution of plugins and configurations turned vim into a powerful integrated development environment, and eased my transition from TextMate.
My current development environment is now built as follows:
- brew install macvim
- curl -Lo- http://bit.ly/janus-bootstrap | bash
- Map jj to Escape (because the Escape key is so far away for such a common function)
- Set color scheme to Tomorrow Night
- Set font to Bitstream Vera Sans Mono 12px
It’s truly amazing what can be done with vi and MacVim, and I know I’ve only scratched the surface. Being able to make very precise and complex changes with only a few keystrokes, where previously the task would require various combinations of mouse selection and typing, has been eye-opening and time-saving.
Now, I need to go back through this blog post and delete all the occurrences of "jjjj" where my fingers forgot that I’m in WordPress, and not vi…