[asterisk-dev] asterisk and vim quickfix

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Jan 7 20:10:08 MST 2007


The following may be relevant to those of you who edit the Asterisk
source using vim, and happen to inflict compilation errors upon it in
the process.

As you know, vim has a "quickfix" mode: you run :make , it runs 'make'
in the current working directory, and parses the output for compilation
errors. If there are, it will jump to the file and line in question.

However this does not work as planned with Asterisk: you must run 'make'
from the toplevel directory (no partial make from inside a directory is
possible). But the output you'll get is the compilation errors from
'make' in a subdirectory:

something like:

app_skel.c:82: error: Something is terribly wrong.

At this stage vim complains it can't find app_skel.c . This is because
the file is apps/app_skel.c . 

My current workaround is to work from the subdirectory, set:
:set makeprg=../maker

where 'maker' is a simple wrapper script that changes directory:

#!/bin/sh
cd ..
make "$@"


Not pretty. Any better way?

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-dev mailing list