- Hi vim users,
I have this in my .vimrc file:
where mymake is just a shell script which cd to a
metaprog/prog/version/src/packages directory, and run gmake in that
In vim, after :make command, the project will be complied. If
error occurs, vim will bring me to the right
file where the first error occurs only if I start my vim from the same
metaprog/prog/version/src/packages dir. Otherwise, vim just opens an new
How can I fix this problem?
- On Tue, Sep 03, 2002 at 03:02:51PM -0400, Charles Liu wrote:
> How can I fix this problem?Vim's using the output from make and the filenames in that output are
relative to the directory your script changes you into. I.e.
/home/colin/ <--- vim is here
projects/ <--- script cd's here
What vim sees is an error in "project1/prog.c", but it doesn't know about
the chdir, so it opens the file relative to its own directory, I.e.
Set vim's cd to your subdirectory?
Of course that might stick, so you might be able to fix the output from
'make' to have the correct filenames by changing &shellpipe:
:set shellpipe=\|&sed\ 's%^\\(.*\\):\ %projects/\\1:\ %'\ \|&\ tee
oh, or as the help docs say, set this in &mp - see "Filtering Messages"
at the end of section 7 (just above ":help quickfix-directory-stack")
Maybe some help?