Friday, February 24, 2012

Re: errorformat help need



2012/2/24 Marcin Szamotulski <mszamot@gmail.com>
On 12:06 Fri 24 Feb     , Caesarmv wrote:
> 2012/2/24 Caesarmv <caesarmv@gmail.com>
>
> >
> >
> > 2012/2/24 Marcin Szamotulski <mszamot@gmail.com>
> >
> >> On 11:53 Fri 24 Feb     , Caesarmv wrote:
> >> > 2012/2/24 Marcin Szamotulski <mszamot@gmail.com>
> >> >
> >> > > On 09:30 Fri 24 Feb     , Caesarmv 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
> >> > > >
> >> > > >
> >> > > > 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.
> >> > > >
> >> > > > Could you please help me to setup vim to jump between warnings?
> >> > > >
> >> > > > Thanks
> >> > > >
> >> > >
> >> > > Can you try something like this:
> >> > > set efm=%f:%l:%c %tarning: %m
> >> > >
> >> > > then use :cget and :cl or :copen to navigate through warnings.
> >> > >
> >> > > Best,
> >> > > Marcin
> >> > >
> >> > > This doesn't work
> >> > set efm=%f:%l:%c %tarning: %m
> >> >
> >> >  E518: Unknown option: %tarning:
> >>
> >> Sorry you have to escape spaces:
> >> set efm=%f:%l:%c\ %tarning:\ %m
> >>
> >>
> > This command wasn't return any error.
> >
> > cget returns
> > E40: Can't open errorfile errors.err
> >
> > cl returns:
> > E42: No Errors
> >
> > copen opens empty quickfix window
> >
> >
> after command :caddbuffer there is correct quickfix list but I can't to
> jump to warning code
>
> enter does nothing in quickfix window

If I write a '/tmp/test' file like this:
test:1:1 warning: warning text here*
test:2:2 warning: warning text here*
test:3:3 warning: warning text here*

and use the efm as I suggested + exe set ef=test
then :cgetfile, :cl works as expected

Best,
Marcin

Sorry, but it doesn't jump. Probably vim cannot find the path.
The code is under /home/user/code_path, where files under /home/user/code_path/path_dir1/path_dir2/file1.c 

I moved through quickfix list, but when I press Enter, there are no any errors/messages and jump doesn't work.

--
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:

Post a Comment