Using linters with Vim
A lot of common linters have associated plugins, which you can use to avoid dealing with the intricacies of each linter. However, if you have to support a custom linter, Vim lets you populate a quickfix list however you want.
You can leverage Vim's :make command, which populates a quickfix list. By default, it runs the Unix make command (no surprise here), but you can override that by setting the makeprg variable.
Quickfix expects :make output to be in a particular format, and you can try to get a linter to output in a desired format. This is error-prone, and has possible compatibility issues (if the underlying linter changes).
Add the following to your .vimrc file to override the :make behavior only when working on ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access