The story of TextMate, VIM and SublimeText
I always preferred heavyweight IDE to do most of the stuff. I tried many IDEs for Ruby, even purchased two upgrades for RubyMine, but it never felt right. I wanted to do the same things that IntelliJ can do to Java, all those beautiful hardcore refactorings. But those just don’t exist for Ruby.
I used my IDE to do source control and I didn’t really understand the command line tools. I knew how to invoke Rails generators from the IDE, but I wasn’t really confident doing the same from the command line.
When TextMate came, it changed the way I think about programming. Instead of complex GUI, I started using command line much more, I started to prefer lightweight tools that do the job right instead of relying on the IDE. Just being able to
cd into a directory and do
mate . and instantly work gave me a lot of flexibility. No need to create a project in an IDE, set up directory structure, libraries etc.
This lasted me for about a year. I was very happy with TextMate, even made some custom snippets for the code I write the most. Actually I created a lot of snippets for various things, because I’m a really lazy typer.
About a month ago, I saw the Destroy All Software screencasts by Gary Bernhardt. It struck me that my editor skills are nothing compared to what he does in VIM. Being able to see someone skilled at VIM work is kind of a revelation. It makes you see things that seemed impossible before.
So after the first 10 minutes of the screencast, I decided I absolutely have to learn VIM. There’s just no other way.
It’s not like I never used it before, I’ve been doing some system administration for my virtual servers and used Linux on my desktop occasionaly, which forced me to learn some VIM. But I never used it beyond editing simple shell scripts. I always gave up too soon.
But this time it was different. I could see someone actually use it. Up until the moment I saw the screencast, I didn’t really believe it was possible to use VIM instead of a complex IDE and achieve the same productivity, but I couldn’t have been more wrong.
So I gave VIM another chance, but this time for real. I watched all VimCasts, downloaded every single cheatsheet there is, and spent long night hours on vimgolf.com trying to improve my VIM skillz. The only thing that was holding me back was navigation between files, since I was used to the PeepOpen Application.
There is a perfect alternative for VIM, and that is the CommandT plugin. It does exactly the same thing, provides a fast fuzzy search across files in the whole project. For example if I want to open app/models/user.rb, I can just type
But this is not the end of the story. A couple of days ago, I got to try SublimeText 2, since many people recommended it to me. First thing that instantly struck me is that SublimeText is fast, and I don’t mean just fast. People say that VIM is fast, but that’s not true for large files, and definitely not for CommandT with large projects. If you have a file with more than 200 columns and try to do anything, it will lag, at least it did for me.
SublimeText brings speed to a next level, at least for browsing the project. With its fuzzy search, you’re able to do the same exact things as with PeepOpen, and even more. It allows you to jump directly to a method in a file using the # syntax.
For example if I want to go to a
logged_in? method in
app/controllers/application_controller.rb, I can just type
aconappcon#login into the search field.
As a result, I bought the license for SublimeText after a couple of hours of using it because it just feels right.
There are tons of other features in SublimeText that are just amazing, but I’ll cover those in a followup article, and I will do the same for VIM.