O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required