Learning The Art of Vimmage
January 29th, 2008
Aside from creating horrible nounifications I’m giving Vim a try. Why? I’ve been using Emacs for over 10 years. I still think it’s worth it, for the following reasons:
- Editors are like programming languages. Learning to use something new doesn’t take that much time once you understand the concepts. Even though Vim is quite different from Emacs, there are lots of same concepts like marks, regular expressions, tags and registers. So all I need to relearn is some keyboard shortcuts, right?
- Vim needs far less keystrokes. The idea is to be as much away from insert mode as possible. Then all basic movements commands are just one char away, and even the complex ones are often only two keys. Compare this with M-Shift-7, C-c C-c etc (ok, C-c C-c is actually much faster to type than you’d think, but still).
- Rails.vim + project.vim seem to offer better Rails support than any other editor/IDE I’ve tried, including e-texteditor, RadRails+Eclipse, NetBeans 6.0. By “better” I mean “least amount of keystrokes and mouse twiddling needed combined with subjective feeling of power”.
- Vim seems more actively developed.
- Vim runs/starts faster.
- Vim learning curve is more satisfactory than that of Emacs.
- Vim improves your rank of hackeriness
- Vim is more eccentric than Emacs (over two otherwise equal entities, I favor the more eccentric).
Besides, I’ve actively used Vim only for one day, yet I already feel like being able to do powerful stuff with it; first I did the 30-minute tutorial (it didn’t take that long, maybe 12 minutes or so) and then I started to use vim for my Rails project. Though I have to admit I taught myself the basics of vi a long time ago, to be able to do simple edits (enter and exit insert mode), save file and exit vim (something you just have to know).
So there. After a month or so I’ll decide if I really convert to Viyism.
UPDATE: after using Vim for two weeks, I realized the following things:
- often, navigating around is faster once you get used to it. This is due to separation of modification (insert/replace) and navigation (normal) modes
- rails.vim is quite nice
- buffer navigation is not as nice in Vim as in Emacs
- Vim lacks detached frames (frames that are in separate GUI window)
- Vim is more cumbersome if your idea of what you are going to do next is not too clear (you have to switch a lot between insert/normal modes)
- Vim is built on Unix principle, that is, it doesn’t have many tools but expects OS or other command line app to offer wanted functionality. This is OK on most Unicen, but in Windows.. well, you don’t necessarily have the tools required. Even after installing gnuwin32 I miss Emacs’s dired, which is a very powerful tool for working with collection of directories or files.
UPDATE: after using Vim for roughly a month or so, I feel a bit baffled. On the other hand, learning curve hasn’t been that steep and I really like the consistency and logic with how movement commands work and how they are combined with delete and replace commands. Once you learn powerful navigation commands, you immediately know equally powerful delete and replace commands; you just prepend stuff with ‘d’ or ‘c’. I also like the modern vim plugins – they are packaged in so-called vimballs which contain all the stuff: docs, code etc.
But then I also feel like some things are a bit more awkward in Vim, but maybe this is because I don’t have proper plugins installed yet, and also because my habits are still too Emacsy. I especially got this feeling when working with (X)HTML or pre-2.0 Rails .rhtml files.
However, I’m already so keen on Vim I don’t think I’ll ever go back to just Emacs. Maybe it’ll depend on support offered for particular project (I’m rather familiar with munging LaTeX using auctex + Emacs). Maybe I’ll start to use Emacs with VI key bindings. But Vim has definitely insinuated itself into my daily coding tasks. Just check these vim tips to see how awesome things you can do with so little typing. If commands seem difficult, well, you should learn regular expressions anyways.

Leave a Reply