Plugin spotlight – ALE

Asynchronous Lint Engine (ALE) is a more recent player on the field, but it's been getting nearly as much traction as Syntastic has. Its primary selling point is that ALE displays lint errors as you type, and it runs the linters asynchronously. ALE is available from GitHub at https://github.com/w0rp/ale.

If you're using vim-plug, you can install ALE by adding Plug 'w0rp/ale' to your .vimrc file and running :w | source $MYVIMRC | PlugInstall. ALE requires Vim 8+ or Neovim for asynchronous calls to work.

It's ready to be used out of the box, and the output looks very similar to Syntastic. Here's a screenshot of a file with ALE enabled (I've opened the location window using :lopen):

You can see the line with an error highlighted with >>, and the status line displays the relevant linmessage at the bottom.

You can toggle ALE on and off by running :ALEToggle if you don't like to be nagged by it.

ALE is a lot more than just a linter though, and is a full-blown language server protocol client: it supports autocompletion, traveling to definitions, and so on. It's not as established and popular as, say, YouCompleteMe (see the Autocomplete section in Chapter 4, Understanding the Text)—but it has a loyal fan base and it's growing quickly.

For reference, you can jump to definitions by running :ALEGoToDefinition and look for references using :ALEFindReferences. In order to enable autocomplete, you'll need the following line in your .vimrc file:

let g:ale_completion_enabled = 1

You can learn more about ALE and decide whether it's a tool worth investing your time in at https://github.com/w0rp/ale.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.154.103