| Tip 107 | Customize the External Compiler |
Vim’s :make command isn’t limited to calling the external make program; it can execute any compilers available on your machine. (Note that Vim’s definition of “compiler” is looser than what you may be used to; see ‘:compiler’ and ‘:make’ Are Not Just for Compiled Languages.) In this tip, we’ll set up the :make command so that it passes a JavaScript file through JSLint and then uses the output to populate the quickfix list.
First, we’ll configure Vim so that running :make calls nodelint,[30] a command-line interface to JSLint.[31] It depends on Node.js and can be installed using NPM simply by running this:[32]
| => | $ npm install nodelint -g |
As a test case, we’ll use this JavaScript implementation ...
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