Friday, February 24, 2012

Re: errorformat help need

On Feb 24, 1:30 am, Caesarmv <caesa...@gmail.com> wrote:
> Hi All,
>
> I am trying to jump through C code warnings.
>
> I have file with gcc warnings in /home/user/warn.txt:
>
> *./file1.c:123:15 warning: warning text here*
> *./file2.c:111:11 warning: warning text here*
> *./file3.c:133:10 warning: warning text here*
>
> I've code in /home/user/code_path, where files
> under /home/user/code_path/path_dir1/path_dir2/file1.c
>

If you're saying Vim's working directory is /home/user/code_path, and
you magically expect Vim to understand ./file1.c really means ./
path_dir1/path_dir2/file1.c, then you're out of luck. The file you
parse with quickfix commands needs to give the full absolute path, or
the exact relative path relative to the current working directory of
Vim, for Vim to find the files.

Somebody suggested ":compiler gcc", which doesn't just mean "you
can :make from within Vim" but also means "set up my errorformat to
match gcc output". I'd suggest using that rather than re-implementing
a gcc errorformat, unless your gcc differs from the norm
significantly.

> I tried to use errorformat and caddbuffer command but no result.
>
> I want to achieve the following.
> When I press key on current warning line, vim opens code in new tab and
> jumps to line and column specified in warning.
>

Opening a new tab is completely different from errorformat. Adding the
text "newtab" to the 'switchbuf' option might do this for you.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: