October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 108 | 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,[26] a command-line interface to JSLint.[27] It depends on Node.js and can be installed using NPM simply by running this:[28]
| => | $ npm install nodelint -g |
As a test case, we’ll use this JavaScript implementation ...