1

Is there a way to 'delete current, and cnext' so that when progressing through the quickfix list progress can more easily be seen, and, when all quick fixes have been made, the window automatically closes?

2
  • Also, qa works
    – D. Ben Knoble
    Jun 19, 2019 at 19:50
  • True, I'll rephrase to remove that void 'use case'.
    – OJFord
    Sep 27, 2019 at 12:51

2 Answers 2

2

I'm afraid the only way to update the quickfix list consists in manually changing its content with setqflist().

With getqflist({'idx': 'whatever'}) you should be able to obtain the index of the current item -- If I'm not mistaken you'll then have to count entries with 'nr' field to use that index.

From here you should by now have an absolute index which you could use to clear the qflist before re-setting it.

0

Just don't open the quickfix list in the first place. Both :cnext & :cprev give you information like (1 of 10). And :cc will give you the current quickfix list information. You can use :clist to print out the list without opening a window.

You may need to look for :cwindow / :copen if the quickfix list is opening automatically or you copied part of your vimrc from someplace else.

For more help see:

:h quickfix
:h :cnext
:h :cc
:h :clist
:h :cwindow
:h :copen
2
  • This may be a good workaround for someone else, but it doesn't actually answer the question. In my main case the window is opened by a third-party plugin - I do the navigating, but not (explicitly) the window opening.
    – OJFord
    Jun 19, 2019 at 21:30
  • Do you want something like this? command Cnext try | cnext | catch /^Vim\%((\a\+)\)\=:E553:/ | cclose | echo "End of quickfix list" | endtry Jun 19, 2019 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.