Deciding on a Text Editor
We've all been through it. That uncomfortable zone when we're not sure how to make a difficult decision. Should I choose A or B? Or in this case, Sublime Text 2 or Vim.
As a kid, I remember watching my father work on cars for hours on end. He was a mechanic. The way he handled his tools with such grace and efficiency, it was like magic, and I was impressed. When I see experts use MacVim, or just Vim, I still get that same feeling. I love it.
But to master your tools the way my father or the Vim experts do, you have to know your tools.
Therein Lies the Problem
Vim has always been dubbed as being hard to learn. And that, my friend, is a fact. Anyone who attempts to use Vim without any prior experience or knowledge will need the better part of their weekend to get somewhat acquainted with it. I remember the first time time I downloaded the "antique" software and tried to perform simple tasks. It was frustrating to say the least, but after about 2 days, I was able to execute basic writing tasks. After about a month I felt like I completed my initiation phase and earned rights of passage to use Vim.
I decided to take a break from Vim to broaden my horizons and see if anything else out there was worthwhile. I came across Sublime Text 2, a modern, clean and fairly young text editor. I bought a license for Sublime Text 2 and gave it my own trial period. The software seemed excellent. But as someone who's indecisive at times, I immediately had buyer's remorse (see figures 1.1 and 1.2).
After my brief stint of buyer's remorse dissipated, and I dove deeper into Sublime Text 2, I immediately became fascinated with the software. Sublime Text 2 is beautiful and highly functional. If Sublime Text 2 could be described as a tool it would be a multipurpose one. Vim was more like a set of wrenches. You may have to try out a few before you find the right one, unless you know exactly what you're doing (ex. "The Vim Experts").
So how do I remedy my conflict and choose an editor? Simple, I find out what works for me:
|For Mac OS X||MacVim||Sublime Text 2|
|Fuzzy finder:||⌘T||⌘T or ⌘P|
|Multi-select:||:%s/oldtext/newtext/g||Selected text + ⌘D|
|Find / replace:||:%s/find/replace/g||⌘⌥F|
|Go to file then symbol:||:help tags||⌘T or ⌘P + file.js@func|
|Go to line 80:||:80||^G then 80|
|Code folding (close):||za or zc||⌘⌥[|
|Code folding (open):||za or zo||⌘⌥]|
*MacVim with Janus plugin installed.
As you can see, Sublime Text 2 does just about everything Vim does based on my personal needs. Unfortunately, this comparison comes down to personal preference. Both editors are capable of executing all my coding woes, but Sublime Text 2 makes me the happiest. That is important for my sanity. A little bit of happiness is always welcomed.
I also need to stress the fact that I love Vim, and in Sublime Text 2 I make heavy use of the VintageEx. Although I'm losing a lot of power by not using Vim, I gain a lot of flexibility with Sublime Text 2 while still being able to take advantage of Vim-like behavior.
Sublime Text 2 find and replace the Vim way - Figure 1.3
MacVim and regular Vim are extremely powerful text editors. We all know it. Vim has the potential to be a powerhouse, but sometimes you need a little finesse. And that's what Sublime Text 2 does best.
So, as you can see in this story, tools can be a very important ally in our craft. But at the end of our decision, you have to do what works best for you. Vim has worked for me for a long time, but now Sublime Text 2 makes that work a little more enjoyable.