[Hint] quickfix list in vim for follow up errors

97 views
Skip to first unread message

Kunal Chauhan

unread,
Jul 4, 2020, 5:02:49 AM7/4/20
to vim...@googlegroups.com
Hi Team.

I am using the :make all from vim in my source code.
as the code has multiple warning and some error.

 Point is: if i do the clist it shows multiple lines of code with warning , but I want to follow up the error part only , with out scrolling so much in clist .
Is there will some nicer way of finding the error part easily of compilation via quickfixlist in large code base ?



Thanks
kunal

Tony Mechelynck

unread,
Jul 4, 2020, 6:28:31 AM7/4/20
to vim_use
The :cn[ext] (go to next error) and :cN[ext] (go to previous error)
allow you to go to the next point in the source where the compiler
complained, evn if the quickfix list itself isn't displayed. Similarly
:cnf[ile] and :cNf[ile] (next and previous file), and :crew[ind] (go
to first error) and :clast (go to last error). If you don't mind
taking up three keys with and without Shift, you can even assign them
to keys, for example as follows:

:map <F2> :cn<CR>
:map <S-F2> :cN<CR>
:map <F3> :cnf<CR>
:map <S-F3> :cNf<CR>
:map <F4> :crew<CR>
:map <S-F4> :clast<CR>

The same mappings apply of curse in any quickfix list, i.e not only as
generated by :make but also by :helpgrep and :vimgrep

Best regards,
Tony.

Gary Johnson

unread,
Jul 4, 2020, 11:29:27 AM7/4/20
to vim...@googlegroups.com
I usually use the cfilter plugin for this. It comes with Vim, so
you just need to enable it by putting

packadd cfilter

in your vimrc. See

:help cfilter-plugin

Then you can filter your quickfix list to contain only errors with

:Cfilter error

or remove all warnings with

:Cfilter! warning

Those commands create new quickfix lists without affecting the
original list, you can return to the original list with

:colder

HTH,
Gary

Kunal Chauhan

unread,
Jul 5, 2020, 11:15:45 AM7/5/20
to vim...@googlegroups.com
Point is : as compiler is showing warning messages , so if user is only intrested to see the error messages
Then what are the ways?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXu3BXXRPDk0nnncKCo-HaG7CeuhS4mm2ZX%2BZymyTQ-DCQ%40mail.gmail.com.

Romain Lafourcade

unread,
Jul 6, 2020, 2:33:02 AM7/6/20
to vim_use

Point is : as compiler is showing warning messages , so if user is only intrested to see the error messages
Then what are the ways?

Configure your compiler to only output errors. 

Kunal Chauhan

unread,
Jul 12, 2020, 7:00:14 AM7/12/20
to vim...@googlegroups.com
packadd cfilter showing error " it is not an editor command"  , as I should be come with vim , my development system is only vim but internet is not accessible on that due to some restrictions

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200704152814.GA24359%40phoenix.


--
Thanks with Regards!

Kunal Chauhan
Mob:09813614826
Mob:08860397903

Christian Brabandt

unread,
Jul 12, 2020, 12:00:40 PM7/12/20
to vim...@googlegroups.com

On So, 12 Jul 2020, Kunal Chauhan wrote:

> packadd cfilter showing error " it is not an editor command"  , as I should be
> come with vim , my development system is only vim but internet is not
> accessible on that due to some restrictions

What vim version are you using?


Best,
Christian
--
Windows 98 bringt die Leistung von gestern auf die Computer von heute.

Kunal Chauhan

unread,
Jul 12, 2020, 1:01:20 PM7/12/20
to vim...@googlegroups.com
my vim version is 7.4.1099

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

Christian Brabandt

unread,
Jul 12, 2020, 1:45:27 PM7/12/20
to vim...@googlegroups.com

On So, 12 Jul 2020, Kunal Chauhan wrote:

> my vim version is 7.4.1099

For the cfilter plugin, you need at least vim 8.1.0311.

Can you install a newer version?


Best,
Christian
--
Was ist der Akademiker anders, als ein eingelerntes und angeeignetes
Glied einer großen Vereinigung?
-- Johann Wolfgang von Goethe (an Zelter, 1832)

Kunal Chauhan

unread,
Jul 13, 2020, 12:45:13 AM7/13/20
to vim...@googlegroups.com
no due to some restrictions I have no access to my particular development system . any other alternative ? to do the same stuff, 

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

Gary Johnson

unread,
Jul 13, 2020, 2:27:27 AM7/13/20
to vim...@googlegroups.com
On 2020-07-13, Kunal Chauhan wrote:

> On Sun, Jul 12, 2020 at 11:15 PM Christian Brabandt wrote:
>
> On So, 12 Jul 2020, Kunal Chauhan wrote:
>
> > my vim version is 7.4.1099
>
> For the cfilter plugin, you need at least vim 8.1.0311.
>
> Can you install a newer version?

> no due to some restrictions I have no access to my
> particular development system . any other alternative ? to do the same stuff, 

There are three that I can think of.

1. Change the compiler options to ignore or silence warnings.

2. Add a filter to the make pipeline by setting 'makeprg' or
'shellpipe' appropriately, as described in ":help quickfix.txt".
Search for "^Filtering messages". See also ":help 'makeprg'".

For example (untested):

let &makeprg = "make $* \\| grep -vi 'warning'"

3. Change 'errorformat' to exclude warnings.

HTH,
Gary

aro...@vex.net

unread,
Jul 13, 2020, 12:32:01 PM7/13/20
to vim...@googlegroups.com
>
> 1. Change the compiler options to ignore or silence warnings.
>

Isn't that the software equivalent of sticking a nail in the fuse-box?


Gary Johnson

unread,
Jul 13, 2020, 3:30:27 PM7/13/20
to vim...@googlegroups.com
On 2020-07-13, aro...@Vex.Net wrote:
> >
> > 1. Change the compiler options to ignore or silence warnings.
> >
>
> Isn't that the software equivalent of sticking a nail in the fuse-box?

Pretty much. But that's what Kunal said he wanted. It could be
that he is currently overwhelmed with errors and will get to
warnings when the errors have been cleaned up.

Regards,
Gary

Reply all
Reply to author
Forward
0 new messages