Loading ...
Sorry, an error occurred while loading the content.

:make problem

Expand Messages
  • Charles Liu
    Hi vim users, I have this in my .vimrc file: set makeprg=~/tnmSrc/packages/mymake where mymake is just a shell script which cd to a
    Message 1 of 2 , Sep 3, 2002
    • 0 Attachment
      Hi vim users,
      I have this in my .vimrc file:
      set makeprg=~/tnmSrc/packages/mymake
      where mymake is just a shell script which cd to a
      metaprog/prog/version/src/packages directory, and run gmake in that
      dir.
      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
      file.
      How can I fix this problem?

      Thanks
      --
      Charles Liu
    • Colin Keith
      ... 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/
      Message 2 of 2 , Sep 3, 2002
      • 0 Attachment
        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
        project1/prog.c

        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.


        /home/colin/project1/prog.c

        Set vim's cd to your subdirectory?


        :cd /home/colin/projects/

        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?

        Colin.
      Your message has been successfully submitted and would be delivered to recipients shortly.