Random vim tips
Here are two things I found quite useful recently with vim:
- GOBgen, which I've used intensively while writing the code skeleton of PAF (which is now about complete). It's not perfect, I always find myself tweaking the content it created, but it's still a lot faster than doing everything by hand.
- A small tweak to the quickfix stuff (you know, :make & co). I was annoyed by libtool executions often being interpreted as error output by vim. The problem is that a call to libtool with a -version-info 0:0:0 or something like that is often made by make, when using libtool (at least in the way it is set-up for pigment and PAF). That thing with numbers and columns looks too much like an error or warning from gcc for vim, and each time it is called, it is interpreted as an error that makes vim To tell it to calm down, I've created a gcc.vim file ~/.vim/after/compiler/ that contains the following:
let &errorformat .= ',\%+G-version-info\ %*\\d:'
This tells vim that anything with "-version-info [number]:" is a general message, and not an error or warning. To ensure this is used, I have the following line in my ~/.vimrc:
au FileType c compiler gcc
Note that you could also achieve a similar result by setting the g:compiler_gcc_ignore_unmatched_lines variable, but then you might miss real errors that don't point to a specific file (like some linking errors) as I understand it.
02 May 2008
Post a comment
All comments are held for moderation; basic HTML formatting accepted.