I made a function in Vim that compiles some stuff for me. It looks like so:
function! MyFunc(mode)
lcd ./build
pwd
let &makeprg='the_command some_script_file'
let &errorformat='some format'.','
let &errorformat.='%-G%.%#'
silent make
lcd ..
cwindow
endfunction
I usually open vim in a project directory, then I can run this function, which cd's into build, builds it, and cd's back so I stay in my project directory.
However, sometimes, when the build fails and brings up the quickfix window, it'll show filenames relative to my project dir (yay), but other times in the same file, it shows the absolute path. The output from the build script always shows relative paths, and vim handles both correctly, i.e. it finds the correct file.
I suspect the path handling is responsible. My question is, what's the problem, and is there a better way to handle switching into the build directory and back? I always want relative paths shown.
Thanks!!