SkillAgentSearch skills...

Ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support

Install / Use

/learn @dense-analysis/Ale

README

Asynchronous Lint Engine

Vim Neovim CI AppVeyor Build Status Join the Dense Analysis Discord server

ALE Logo by Mark Grealish - https://www.bhalash.com/

ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking and semantic errors) in Neovim 0.7.0+ and Vim 8.0+ while you edit your text files, and acts as a Vim Language Server Protocol client.

<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>

ALE makes use of Neovim and Vim 8 job control functions and timers to run linters on the contents of text buffers and return errors as text is changed in Vim. This allows for displaying warnings and errors in files being edited in Vim before files have been saved back to a filesystem.

In other words, this plugin allows you to lint while you type.

ALE offers support for fixing code with command line tools in a non-blocking manner with the :ALEFix feature, supporting tools in many languages, like prettier, eslint, autopep8, and more.

ALE acts as a "language client" to support a variety of Language Server Protocol features, including:

  • Diagnostics (via Language Server Protocol linters)
  • Go To Definition (:ALEGoToDefinition)
  • Completion (Built in completion support, or with Deoplete)
  • Finding references (:ALEFindReferences)
  • Hover information (:ALEHover)
  • Symbol search (:ALESymbolSearch)

If you don't care about Language Server Protocol, ALE won't load any of the code for working with it unless needed. One of ALE's general missions is that you won't pay for the features that you don't use.

Help Wanted: If you would like to help maintain this plugin by managing the many issues and pull requests that are submitted, please send the author an email at dev@w0rp.com.

If you enjoy this plugin, feel free to contribute or check out the author's other content at w0rp.com.

Why ALE?

ALE has been around for many years, and there are many ways to run asynchronous linting and fixing of code in Vim. ALE offers the following.

  • No dependencies for ALE itself
  • Lightweight plugin architecture (No JavaScript or Python required)
  • Low memory footprint
  • Runs virtually everywhere, including remote shells, and in git commit
  • Out of the box support for running particular linters and language servers
  • Near-zero configuration with custom code for better defaults
  • Highly customizable and well-documented (:help ale-options)
  • Breaking changes for the plugin are extremely rare
  • Integrates with Neovim's LSP client (0.8+) and diagnostics (0.7+)
  • Support for older Vim and Neovim versions
  • Windows support
  • Well-integrated with other plugins

Sponsorship

If you would like to donate to Dense Analysis to say thank you for ALE, please consider visiting our Sponsorship page. Funds will be used to pay for our hosting fees and research. Whilst visiting our site, please feel free to make use of our educational resources and other recommended tools.

Supported Languages and Tools

ALE supports a wide variety of languages and tools. See the full list in the Supported Languages and Tools page.

Usage

<a name="usage-linting"></a>

Linting

Once this plugin is installed, while editing your files in supported languages and tools which have been correctly installed, this plugin will send the contents of your text buffers to a variety of programs for checking the syntax and semantics of your programs. By default, linters will be re-run in the background to check your syntax when you open new buffers or as you make edits to your files.

The behavior of linting can be configured with a variety of options, documented in the Vim help file. For more information on the options ALE offers, consult :help ale-options for global options and :help ale-integration-options for options specified to particular linters.

<a name="usage-fixing"></a>

Fixing

ALE can fix files with the ALEFix command. Functions need to be configured either in each buffer with a b:ale_fixers, or globally with g:ale_fixers.

The recommended way to configure fixers is to define a List in an ftplugin file.

" In ~/.vim/ftplugin/javascript.vim, or somewhere similar.

" Fix files with prettier, and then ESLint.
let b:ale_fixers = ['prettier', 'eslint']
" Equivalent to the above.
let b:ale_fixers = {'javascript': ['prettier', 'eslint']}

You can also configure your fixers from vimrc using g:ale_fixers, before or after ALE has been loaded.

A * in place of the filetype will apply a List of fixers to all files which do not match some filetype in the Dictionary.

Note that using a plain List for g:ale_fixers is not supported.

" In ~/.vim/vimrc, or somewhere similar.
let g:ale_fixers = {
\   '*': ['remove_trailing_lines', 'trim_whitespace'],
\   'javascript': ['eslint'],
\}

If you want to automatically fix files when you save them, you need to turn a setting on in vimrc.

" Set this variable to 1 to fix files when you save them.
let g:ale_fix_on_save = 1

The :ALEFixSuggest command will suggest some supported tools for fixing code. Both g:ale_fixers and b:ale_fixers can also accept functions, including lambda functions, as fixers, for fixing files with custom tools.

See :help ale-fix for complete information on how to fix files with ALE.

<a name="usage-completion"></a>

Completion

ALE offers some support for completion via hijacking of omnicompletion while you type. All of ALE's completion information must come from Language Server Protocol linters, or from tsserver for TypeScript.

When running ALE in Neovim 0.8+, ALE will integrate with Neovim's LSP client by default, and any auto-completion plugin that uses the native LSP client will work when ALE runs language servers. nvim-cmp is recommended as a completion plugin worth trying in Neovim.

ALE integrates with Deoplete as a completion source, named 'ale'. You can configure Deoplete to only use ALE as the source of completion information, or mix it with other sources.

" Use ALE and also some plugin 'foobar' as completion sources for all code.
call deoplete#custom#option('sources', {
\ '_': ['ale', 'foobar'],
\})

ALE also offers its own automatic completion support, which does not require any other plugins, and can be enabled by changing a setting before ALE is loaded.

" Enable completion where available.
" This setting must be set before ALE is loaded.
"
" You should not turn this setting on if you wish to use ALE as a completion
" source for other completion plugins, like Deoplete.
let g:ale_completion_enabled = 1

ALE provides an omni-completion function you can use for triggering completion manually with <C-x><C-o>.

set omnifunc=ale#completion#OmniFunc

ALE supports automatic imports from external modules. This behavior is enabled by default and can be disabled by setting:

let g:ale_completion_autoimport = 0

Note that disabling auto import can result in missing completion items from some LSP servers (e.g. eclipselsp). See :help ale-completion for more information.

<a name="usage-go-to-definition"></a>

Go To Definition

ALE supports jumping to the definition of words under your cursor with the :ALEGoToDefinition command using any enabled Language Server Protocol linters and tsserver. In Neovim 0.8+, you can also use Neovim's built in gd keybind and more.

See :help ale-go-to-definition for more information.

<a name="usage-find-references"></a>

Find References

ALE supports finding references for words under your cursor with the :ALEFindReferences command using any enabled Language Server Protocol linters and tsserver.

See :help ale-find-references for more information.

<a name="usage-hover"></a>

Hovering

ALE supports "hover" information for printing brief information about symbols at the cursor taken from Language Server Protocol linters and tsserver with the ALEHover command.

Truncated information will be displayed when the cursor rests on a symbol by default, as long as there are no problems on the same line.

The information can be displayed in a balloon tooltip in Vim or GVim by hovering your mouse over symbols. Mouse hovering is enabled by default in GVim, and needs to be configured for Vim 8.1+ in terminals.

See :help ale-hover for more information.

<a name="usage-symbol-search"></a>

Symbol Search

ALE supports searching for workspace symbols via Language Server Protocol linters with the ALESymbolSearch command.

Search queries can be performed to find functions, types, and more which are similar to a given query string.

See :help ale-symbol-search for more information.

<a name="usage-refactoring"></a

View on GitHub
GitHub Stars14.0k
CategoryDevelopment
Updated22h ago
Forks1.5k

Languages

Vim Script

Security Score

100/100

Audited on Mar 27, 2026

No findings