Search code examples
vimmacvim

How do I populate the QuickFix list with argdo make?


I'm using a simple compiler for W3C's Nu HTML Checker, so that when I call :make inside Vim, the active document is validated as HTML. This works fine when I'm validating one file—the QuickFix list is populated correctly. However, when I run :argdo make, only the output from make from the last file is present in the current QuickFix list. For example, suppose my argument list consists of File1.html and File2.html. And File1.html contains errors but File2.html is clean. Now when I call :argdo make and File1.html is validated BEFORE File2.html, then there will be no errors in the current QuickFix list. I know that Vim holds onto the last ten QuickFix lists and I can browse them with :colder and :cnewer, but this is not what I want. When I call :argdo make, I want the output from make from all the files in the argument list to be shown in the current QuickFix window. Is there a way to do this?


Solution

  • :argdo make runs :make for each argument so you get one quickfix list per argument.

    If you want to have every error for every argument in a single quickfix list, then you need to run :make only once, but for all the arguments:

    :make ##
    

    See :help :_##.


    Side note: when you are done, consider submitting your compiler for inclusion into the Vim runtime.