image from http://jonathanpberger.wordpress.com/2011/02/06/vi-tutorial-for-dvorak-typists/

Skillz

Consider: if you're a coder you type for a living. Code, email, docs - whatever. One of the biggest efficiency gains you can achieve is to become a faster editor. This is what Vim does best: help you edit Faster, Better, Stronger - and you can carry these skills with you to almost any editor available today.

Notice I didn't say that Vim makes you a "faster typer" - no a faster Editor. Modern IDEs have focused on that of late - and no one is better at it than JetBrains.

For the last 4 months I've been using RubyMine and WebStorm and have fallen in love with them. WebStorm especially - if you're a Javascript person (Node or whatever) - it's a great deal at $49.

WebStorm

I'm not an intellisense person (since moving my focus away from .NET) but I do find it extremely helpful when working with new libraries. For instance: the Angular plugin for WebStorm helped me explore many of the "ng-" tags that I would not have seen otherwise.

Angular Plugin

In the Tekpub Angular Series I've been using WebStorm exlclusively and I've really enjoyed it.

Both RubyMine and WebStorms have interesting navigation schemes (I think this extends to Resharper for VS too):

  • Cmd-O allows you to search by a class name
  • Cmd-Shift-O allows you to search by file name
  • Cmd-Option-O allows you to search by symbol (a method name, for instance)
  • Cmd-B takes you to a class or method declaration directly
  • In the gutter of a Rails project are "go to view" (when you're in a Controller) and "go to Controller" when you're in a view
  • Cmd-E opens a popup of recently edited files

Really helpful stuff. In addition there are some great inspection features that offer "squigglies" (as Hanselman calls them) when methods aren't found, script files don't exist, etc. If you trust it - the editor will also give you refactoring options for your code...

These are helpful features - but are they helping me edit code faster? In some ways yes... in other ways...

Enter Vim

Rob Ashton was out here in Hawaii visiting recently and he is a devoted Vim user. I was showing him WebStorm and all the neat things that go with it - but both of us agreed that we could code faster in Vim.

Note: I know there are Vim plugins for JetBrains bits (and most other IDEs) - I'll get there.

While recording a video for our upcoming "Career Reboot" production at Tekpub, I asked Rob "what tools do you take with you while you hop the globe, journeyman coding"?

Tekpub's Career Reboot

For the last year or so Rob has been travelling the planet, working on various projects for a few weeks at a time. His experiment was a simple one:

Pay for my travel, lodging and food and I'll do the work for free

With him was a single bag for his clothes and a backpack with 2 computers. He gave up his house and all of his furniture and put a few small things in storage and then set out - ending his journey here in Hawaii.

His work was varied and he wasn't sure for than a month at a time where he'd be next. Aside from the practical aspect - how do you prepare your machine for working in projects ranging from .NET to C++, Ruby to JavaScript. Rob hate's VMs as well - preferring to work on the native OS.

He has one Windows Machine and one Mac. He wiped OSX off his Mac, however, and installed Ubuntu...

So what does Rob rely on for writing code?

Vim

For much of the code he writes, Vim will suffice, everytime. He can load up any set of plugins he needs to write effectively in Ruby, Javascript or Python. He knows the commands well and to watch him use the editor is a fascinating treat.

When working in Visual Studio, he uses the VsVim plugin and, according to him:

If I didn't have these Vim plugins for VisualStudio I'd be screwed

Most IDEs have a Vim "overlay". All of the JetBrains IDEs do, and so does SublimeText and ... well just about any editor you can think of.

Vim, Everywhere

In terms of editing code, Vim won. The eternal Vim/Emacs war will rage on forever - but I don't think anyone can argue that, in terms of pure editing power: Vim does what it does, extremely well.

From your new shiny Mac Air to the Linux box in the cloud somewhere: open the terminal and hit "vim" and it's likely there, ready to edit config files or code. Vim is the Alpha and Omega editor - the beginning and the end. Vim is everywhere.

So it's back to Vim for me. I like the JetBrains tools and I enjoy SublimeText 2 a lot... but I can move and edit in Vim at twice the speed.

You might be wondering: "why not just use a Vim plugin dude?"

The inspections, plugins and "helper" functions in the JetBrains tools are interesting and helpful, but they come at a price (to me). It slows down the IDE, slows down typing, and many times it offers things I just don't want (like spelling corrections in my HTML files).

Often-times I feel like I spent an increasing amount of time diddling with the IDE more than the code. Looking up shortcuts, setting up configurations for testing, running and debugging... when I know how to do this already without the slick interface.

I like a pretty coding surface. I appreciate clean font rendering and seeing a project tree with all my code files and a fast, fuzzy file-finding feature. And I can get all of that with Vim.

I proved that to myself yesterday when editing a Rails project. Leader-P brought up PeepOpen, "/mailto" took me to a broken mail link. "c4w mailto:support"and the broken email was fixed. RController pro[tab] and I'm editing the ProductsController...

My Vim-glee was broken, however, when I realized I had forgotten the syntax for ActiveRecords eager-loading feature (include, include?, includes). Uh oh.

Rob put it very well when discussing IDEs:

If a tool starts thinking for me, starts remembering the syntax that I need to write... I'll forget the code and start becoming reliant on that tool to do my work for me.

This has happened to me ... quite often. When I was working in .NET it was nearly impossible for me to free-hand (without intellisense) simple structures like lambdas or a generic class definition using an interface. It's a syntax-heavy language and I can see how intellisense helps you with it.

The thing you lose, however, is thinking in that language. When the syntax is ready in your brain, you can think in code and sidestep the translation through the editor.

This is where Vim shines most and languages like Ruby flex their expressive muscle. You think the code, Vim expresses it directly.

The best part? You don't need to be using Vim to use Vim. Drop a plugin in a JetBrains IDE or Visual Studio and you're off (if you need to use those tools for whatever reason).

You never know, one day you might need to work in Clojure in Vilnius...