Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to close all locations lists and quick fix windows with a single command in vim/gvim?

share|improve this question

2 Answers 2

:windo if &buftype != "quickfix" | lclose | endif

That will execute the :lclose command in all windows not displaying quickfix or location lists. I didn't have a set of location lists to test it with, so I tested with a different buffer type and it worked for that case.

share|improve this answer
    
Reread the question, he's asking to close all of the quick fix windows, not close everything but them. –  deterb Jun 6 at 14:42
:windo if &buftype == "quickfix" || &buftype == "locationlist" | lclose | endif

That will execute the :lclose command in all windows not displaying quickfix or location lists. I didn't have a set of location lists to test it with, so I tested with a different buffer type and it worked for that case.

You will probably want to make it a command or shortcut in your .vimrc as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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