You are not logged in.

#1 2009-02-20 15:53:58

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

vim's errorformat `ignore the rest of the line'

I am working with a program which check rules violation in C programs, the output line are like this one:

r219_n1.c:4:1: violated rule r11 (Avoid implicit conversion between int of different sizes); PP #1 (begin)

and I'd like to use the quickfix of Vim.

in my vimrc I put:

map <Leader>e :set makeprg=rchecker\ %<cr>
  \:set errorformat=%f:%l:%c:\ violated\ rule\ r%n\ %m<cr>

so when I am ready to check (after compiling) I just press `,e' and :make again.
It works, but I'd like to keep only the message between () and not the noise after. So I'd need something like:

map <Leader>e :set makeprg=rchecker\ %<cr>
  \:set errorformat=%f:%l:%c:\ violated\ rule\ r%n\ (%m)[[[just ignore the rest of the line!!!]]]<cr>

but I can not find a way to just ignore a piece of output! I can not use %s otherwise vim tries to use the matched string to seek the error...

Do anyone knows how to obtain this?
thanks

Offline

Board footer

Powered by FluxBB