Buy @ Amazon

Search This Blog

October 30, 2011

Vim for Rails Developer


Every person gives feedback based on his understanding of things which is dependant on his level of skills at that point in time. For the reader of this post, who is interested in knowing my background to better evaluate my feedback, I have elaborated in brief my history of experience in the RoR world of application development.

After spending about 10 months in my first JRuby on Rails-2,  two-developer all-chaotic first non-pairing project, where I was using RubyMine as IDE for all practical development purposes, I resolved to try out a new IDE in my next Rails gig. Folks at ThoughtWorks are in the habit of experimenting and trying out different IDEs. And hey, I was no exception ;) - prior to RubyMine, I tried Vim and Aptana RadRails, but for whatever reason I loved RubyMine, perhaps because I was too familiar with this one by virtue of my experience of using IntelliJ in Java projects.

As decided I did choose a new IDE when I moved on to my second RoR3 gig and it was Vim. Why Vim? Well, apart from it being extremely lightweight when compared to its counter-parts, I seriously wanted to get a hang of this IDE, as many RoR developers at our office either use TextMate or Vim (by stats more Vim fans). Okay so did I step into this very small and demanding project of just two developers (including me) that were notably enough not pairing (again!). What does that mean? It means I have to constantly explore to figure out the stuff that is required to become more and more conversant and productive with Vim (atleast as much I am with RubyMine). If you have gone through my experience you'll understand how steep a learning curve it is to get an appreciation of Vim for Rails productivity (even while learning Rails 3, argh!).

Now, I have moved on to my third RoR3 gig with 3-4 dev-pairs (ho-ho pairing again, after real long time!), where-in I guess all are Vim-ites. Its been a couple of days, and I see people use many productive plugins for Vim. Delighted!, my learning curve is going to get better.

In the mean time, I had requested Ben Orenstein, for a free copy of screen cast titled, "Vim for Rails Developers" that he authored. In return, I promised to write a candid review of his screen cast on my blog. I fulfill my promise with this blog post wherein I share my thoughts/experience of the said screencast. Now, the way I share my thoughts is by dissecting the portions of screen cast, and tell you what to expect from each of it. [pause] So, in the mentioned screencast, Ben has covered the following sections in bold:

Fast Typing:
  • Do you think, 80 words per minute is okay? Listen to him.
  • play.typeracer.com => How this site helps the enthusiast hit Bens's objective of "Speed with ********"

Vim Cheat sheet:
  • viemu.com => I have many a times visited and downloaded this cheat-sheet from this site, but didn't really care to read it seriously. His talk I guess insisted well on what to look out for in this cheat sheet :)

Dvorak Simplified Keyboard
  • Learn to touch type.
  • I haven't heard this anytime before. I gotta know about this in this screen cast.
  • This is the only section that did not fascinate me, perhaps because I did not see him demonstrate its usefulness.

Rails.vim
  • An intro on how to use it. He gave a real good shot at it, helping me understand that he did his best given the size of this huge plugin. Keep digging and you get more and more wealth of short-cuts! 
  • If you haven't used this plugin, his intro will seed the interest in you to try and have fun with this plugin.
  • Try this in your Vim command-line: :help rails => for rails-vim documentaion          

Snipmate: Mac's Textmate style snippets for Vim
  • It supports Rails
  • Where to look for your favorite language's snippets that snipmate supports [Note: ~/vim/snippets/]                
  • How to add your own snippet

The power of Tags
  • Exuberant CTAGS: CTags creates an index on where the class, methods, instances are defined. This helps the developer big-time in jumping from say, method usage to its definition. Intelli-sense of sorts, eh!
  • How to use CTags?
  • How CTags help?

Ack
  • Get it right. Its Ack, not awk! Its a grep replacement tool, designed for programmers. Can't believe the funda? Well, I too didn't until I watched him play in this screencast.

Quick one-offs    
  • Bunch of other enlightening surprises... :) By the time you reach here, you won't feel like skipping this section, for you'll quickly come to an understanding that this is not some miscellaneous stuff but the quick wins that you get to learn while you are playing with Vim.

For many, "seeing is believing". And I fall very much in that category. Thus, this screencast had a very good impact on me and so shall it on you ;) You can't ask for more in a screencast that is approximately 37 minutes long.

I'll heartily give him a 4.5/5 as rating for this screencast, for the good breadth and fair depth in content that he has both covered and demo-ed, in a manner that inspired me to kick myself harder to learn and get used to the stuffs/tools that he mentioned.

Thanks to Ben, for an awesome introduction through live demo to the various tools that he uses for his every-day rails programming. Personally though, I wish wish wish, he touched upon the other productivity plugins too, if he were to use any. Don't know if I'm being greedy here!

Lastly, if you wish to watch this screen-cast, and that you are put up in Chennai, don't miss the DevCamp,Chennai happening this November 19th at ThoughtWorks Technologies Ltd, Ascendas IT Park, Chennai, Tamil Nadu, India. This screencast is making an entry, and if voted for by many (as like any other in-person session), it will be put up. Come vote, watch and get enlightened!