Vim Customisation

10 AM April 30, 2004

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:

  • Installed a cvs plugin, which lets us see color-highlighted diffs.
  • Set up tags over our source code and the library header files.
  • Set standard C++ indenting and comment styles in a project-wide .vimrc file.
  • Taught Vim how to interpret the error messages from the compiler, linker, and database preprocessor.

Function keys are all set up too:

  • F2 opens a file explorer
  • F3 swaps between a .cpp file and the related .h file
  • F4 does the same as F3, but opens the related file in another window
  • F5 kicks off a build
  • F6 shows build errors
  • F7 and F8 navigate to the next/previous build error
  • F11 and F12 navigate to the next/previous tag

Some Vim features that have been helpful are:

  • the ‘find’ command, because I am too lazy to remember what directory any given file is in,
  • ‘grep’, which searches all of our project files by default,
  • CTRL-N and CTRL-P, auto-completion, which I use constantly.

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.

By alang | # | Comments (2)
(Posted to Rants, Software Development and javablogs)

Not Refactoring

4 AM April 30, 2004

My friend David has a way with words. Watch him avoid the saying the big “R”, while explaining how he spent the morning:

“I haven’t added any functionality, I’m just fixing it up, making the code a bit easier to work with.”

By alang | # | Comments (0)
(Posted to Software Development and javablogs)
© 2003-2006 Alan Green