I wrote this piece in February. I didn’t post at the time because I wanted to link to the online Vim help files at vimdoc.sourceforge.net, but it wasn’t working properly. Two months later, it is still not working properly, so I’m posting anyway.
Everybody’s DNS seems to have switched to point to this new server, so this will be the last of “Unseen Alan”.
Vim is my all-time favourite text editor. Productivity wise, I find it better than every IDE I’ve ever used, excepting Eclipse, which I prefer for Java1.
I’m currently working on a C++ project. When we started here, we spent a few days setting up the development environment, including Vim. This is what we did:
Function keys are all set up too:
Some Vim features that have been helpful are:
Would I recommend Vim to every programmer? No. Its vi-derived, modeful, “Look Ma, No Arrow Keys Runs On A VT100, A Mac And Anything In Between interface is daunting for those who haven’t had to use vi at some stage. But for a significant fraction of the development community, Vim is the ant’s pants.
1 Though I haven’t used IDEA. Or Emacs.
Comments
vim (or rather gvim) rules all! :find and :grep are so useful and so much more powerful than any ide I've ever used. The completion is great, because while it isn't "smart", it can be used for anything, writing comments, etc.
And dont' forget abbreviations. I type "ITER" and I get a nice for loop that iterates over an Iterator with my cursor in the right place to type the name of the list. I type "FOR" and get a nice for-loop for iterating an array.
And macros! I type ^Xj on any private method and getters and setters are added. Very handy and very flexible. No clicking next or having it create get/set for every variable (unless you want).
The best thing is that you can use it for ANY text-based thing, including XML, PERL, LaTeX, and you get the exact same editing experience. No pinin away for feature XXX in your XML editor that you have in your Java IDE. Everything, everywhere.
That said: I think you are crazy to use all those retarded function keys. You will increase efficiency by mapping things to control or alt sequences on your keyboard. Never leave the home keys! For me to make, I do Ctrl-X and then m.
I like to set up ctrl-x-j-v for make, and alt-[-]-s for debug this symbol, and then ctrl-alt-1-f-p to indent a line, you see, it leaves plenty of space for the next key assignment I want. I'm thinking of alt-ctrl-6-h-c for coffee with one sugar, alt-ctrl-9-a-g for a headjob...