I love the quickfix feature in vim. It also works flawlessly in most cases. But when I work with LaTeX documents, it leads to funny behavior. I don't think it's relevant, but I have the LaTeX suite installed, and makeprg
is set to makeprg=xelatex -interaction=nonstopmode
.
Assume I have a LaTeX document open. When I now run :make
in vim, the document is compiled and a quickfix window is opened. I do not necessarily intend to fix those warnings. Being lazy, I leave the quickfix window open, do some changes, and compile again. What now happens to the quickfix window for a LaTeX document is different from my experience when working with other languages. Instead of updating the quickfix window, it opens another one, taking up more and more pixels from my working area.
A screenshot can be seen here. My actual work area are the five lines at the top.
I can close the first quickfix window with :cclose
, but then I have to move to the other windows and close them one by one. Or I can close vim and open it again. None of these workflows is particularly sensible or efficient.
Can I close all quickfix windows with one command? Can I prevent additional quickfix windows to be opened? Or can I sanitize my settings in such a way, that it won't open more than one quickfix window?
:make
, it should prevent Vim from jumping to the first error, which may be what happens every time a new window is opened after a compilation. I'm not sure it will help, but:make!
could be worth a try. Otherwise, you can close all windows except the focused one with:only
, which can be shortened with:on
(or pressC-w o
in normal mode).:make!
all along, since jumping to the error rarely works for me in involved LaTeX documents.:only
is a good solution, I didn't know about this command before! If there are no explanations why the other windows are opened in the first place, I would consider:only
as a solution (provided you elevate the comment to a reply).