ale.txt Plugin to lint and fix files asynchronously ale
ALE - Asynchronous Lint Engine
CONTENTS ale-contents
- Introduction…………………….|ale-introduction|
- Supported Languages & Tools……….|ale-support|
- Linting…………………………|ale-lint| 3.1 Linting On Other Machines………|ale-lint-other-machines| 3.2 Adding Language Servers………..|ale-lint-language-servers| 3.3 Other Sources…………………|ale-lint-other-sources|
- Fixing Problems………………….|ale-fix|
- Language Server Protocol Support…..|ale-lsp| 5.1 LSP Neovim Integration…………|ale-lsp-neovim| 5.2 Completion……………………|ale-completion| 5.3 Go To Definition………………|ale-go-to-definition| 5.4 Go To Type Definition………….|ale-go-to-type-definition| 5.5 Go To Implementation…………..|ale-go-to-implementation| 5.6 Find References……………….|ale-find-references| 5.7 Hovering……………………..|ale-hover| 5.8 Symbol Search…………………|ale-symbol-search| 5.9 Refactoring: Rename, Actions……|ale-refactor|
- Global Options…………………..|ale-options| 6.1 Highlights……………………|ale-highlights|
- Linter/Fixer Options……………..|ale-integration-options| 7.1 Options for alex………………|ale-alex-options| 7.2 Options for cspell…………….|ale-cspell-options| 7.3 Options for dprint…………….|ale-dprint-options| 7.4 Options for languagetool……….|ale-languagetool-options| 7.5 Options for write-good…………|ale-write-good-options| 7.6 Options for redpen…………….|ale-redpen-options| 7.7 Options for vale………………|ale-vale-options| 7.8 Other Linter/Fixer Options……..|ale-other-integration-options|
- Commands/Keybinds………………..|ale-commands|
- API…………………………….|ale-api|
- Special Thanks………………….|ale-special-thanks|
- Contact………………………..|ale-contact|
- Introduction ale-introduction
ALE provides the means to run linters asynchronously in Vim in a variety of languages and tools. ALE sends the contents of buffers to linter programs using the |job-control| features available in Vim 8 and NeoVim. For Vim 8, Vim must be compiled with the |+job| and |+channel| and |+timers| features as a minimum.
ALE supports the following key features for linting:
- Running linters when text is changed.
- Running linters when files are opened.
- Running linters when files are saved. (When a global flag is set.)
- Populating the |location-list| with warning and errors.
- Setting |signs| with warnings and errors for error markers.
- Using
:echoto show error messages when the cursor moves. - Setting syntax highlights for errors.
ALE can fix problems with files with the :ALEFix command, using the same job
control functionality used for checking for problems. Try using the
:ALEFixSuggest command for browsing tools that can be used to fix problems
for the current buffer.
If you are interested in contributing to the development of ALE, read the developer documentation. See |ale-development|
For configuring ALE in Neovim, you can use the |ale.setup| function to
configure ALE globally in init.vim. >
require(“ale”).setup({ completionenabled = true, maximumfilesize = 1024 * 1024, warnabouttrailingwhitespace = false, }) < In |ftplugin| files you can customise behavior for different filetypes by using the |ale.setup.buffer| function. >
– In ftplugin/python.lua in &runtimepath require(“ale”).setup.buffer({ linters = {"ruff”, “pyright”}, fixers = {"ruff”} }) < Buffer local settings override global settings for that buffer.
- Supported Languages & Tools ale-support
ALE supports a wide variety of languages and tools. See |ale-supported-list| for the full list.
- Linting ale-lint
ALE’s primary focus is on checking for problems with your code with various
programs via some Vim code for integrating with those programs, referred to
as ‘linters.’ ALE supports a wide array of programs for linting by default,
but additional programs can be added easily by defining files in |runtimepath|
with the filename pattern ale_linters/<filetype>/<filename>.vim. For more
information on defining new linters, see the extensive documentation
for |ale#linter#Define()|.
Without any configuration, ALE will attempt to check all of the code for every
file you open in Vim with all available tools by default. To see what ALE
is doing, and what options have been set, try using the :ALEInfo command.
Most of the linters ALE runs will check the Vim buffer you are editing instead of the file on disk. This allows you to check your code for errors before you have even saved your changes. ALE will check your code in the following circumstances, which can be configured with the associated options.
When you modify a buffer - |g:alelintontextchanged|
On leaving insert mode - |g:alelintoninsertleave|
When you open a new or modified buffer - |g:alelinton_enter|
When you save a buffer - |g:alelinton_save|
When the filetype changes for a buffer - |g:alelintonfiletypechanged|
If ALE is used to check code manually - |:ALELint|
*ale-lint-settings-on-startup*
It is worth reading the documentation for every option. You should configure
which events ALE will use before ALE is loaded, so it can optimize which
autocmd commands to run. You can force autocmd commands to be reloaded with
:ALEDisable | ALEEnable
This also applies to the autocmd commands used for |g:aleechocursor|.
*ale-lint-file-linters*
Some programs must be run against files which have been saved to disk, and simply do not support reading temporary files or stdin, either of which are required for ALE to be able to check for errors as you type. The programs which behave this way are documented in the lists and tables of supported programs. ALE will only lint files with these programs in the following circumstances.
- When you open a new or modified buffer - |g:alelinton_enter|
- When you save a buffer - |g:alelinton_save|
- When the filetype changes for a buffer - |g:alelintonfiletypechanged|
- If ALE is used to check code manually - |:ALELint|
ALE will report problems with your code in the following ways, listed with their relevant options.
- Via Neovim diagnostics (On in Neovim 0.7+) - |g:aleuseneovimdiagnosticsapi|
- By updating loclist (On by default) - |g:alesetloclist|
- By updating quickfix (Off by default) - |g:alesetquickfix|
- By setting error highlights - |g:alesethighlights|
- By creating signs in the sign column - |g:alesetsigns|
- By echoing messages based on your cursor - |g:aleechocursor|
- By showing virtual text at your cursor - |g:alevirtualtextcursor|
- By previewing details at your cursor - |g:alecursordetail|
- By showing balloons for your mouse cursor - |g:alesetballoons|
Please consult the documentation for each option, which can reveal some other ways of tweaking the behavior of each way of displaying problems. You can disable or enable whichever options you prefer.
Most settings can be configured for each buffer. (|b:| instead of |g:|), including disabling ALE for certain buffers with |b:aleenabled|. The |g:alepattern_options| setting can be used to configure files differently based on regular expressions for filenames. For configuring entire projects, the buffer-local options can be used with external plugins for reading Vim project configuration files. Buffer-local settings can also be used in ftplugin files for different filetypes.
ALE offers several options for controlling which linters are run.
- Selecting linters to run. - |g:ale_linters|
- Aliasing filetypes for linters - |g:alelinteraliases|
- Only running linters you asked for. - |g:alelintersexplicit|
- Disabling only a subset of linters. - |g:alelintersignore|
- Disabling LSP linters and
tsserver. - |g:aledisablelsp|
You can stop ALE any currently running linters with the :ALELintStop command.
Any existing problems will be kept.
3.1 Linting On Other Machines ale-lint-other-machines
ALE offers support for running linters or fixers on files you are editing locally on other machines, so long as the other machine has access to the file you are editing. This could be a linter or fixer run inside of a Docker image, running in a virtual machine, running on a remote server, etc.
In order to run tools on other machines, you will need to configure your tools
to run via scripts that execute commands on those machines, such as by setting
the ALE _executable options for those tools to a path for a script to run,
or by using |g:alecommandwrapper| to specify a script to wrap all commands
that are run by ALE, before they are executed. For tools that ALE runs where
ALE looks for locally installed executables first, you may need to set the
_use_global options for those tools to 1, or you can set
|g:aleuseglobal_executables| to 1 before ALE is loaded to only use global
executables for all tools.
In order for ALE to properly lint or fix files which are running on another file system, you must provide ALE with |List|s of strings for mapping paths to and from your local file system and the remote file system, such as the file system of your Docker container. See |g:alefilenamemappings| for all of the different ways these filename mappings can be configured.
For example, you might configure pylint to run via Docker by creating a
script like so. >
#!/usr/bin/env bash
exec docker run -i –rm -v “$(pwd):/data” cytopia/pylint “$@”
<
You will want to run Docker commands with -i in order to read from stdin.
With the above script in mind, you might configure ALE to lint your Python
project with pylint by providing the path to the script to execute, and
mappings which describe how to change between the two file systems in your
python.vim |ftplugin| file, like so: >
if expand(‘%:p’) =~# ‘^/home/w0rp/git/test-pylint/’ let b:alelinters = [‘pylint’] let b:alepythonpylintuseglobal = 1 “ This is the path to the script above. let b:alepythonpylintexecutable = ‘/home/w0rp/git/test-pylint/pylint.sh’ “ /data matches the path in Docker. let b:alefilenamemappings = { \ ‘pylint’: [ \ [‘/home/w0rp/git/test-pylint’, ‘/data’], \ ], } endif < You might consider using a Vim plugin for loading Vim configuration files specific to each project, if you have a lot of projects to manage.
3.2 Adding Language Servers ale-lint-language-servers
ALE comes with many default configurations for language servers, so they can
be detected and run automatically. ALE can connect to other language servers
by defining a new linter for a filetype. New linters can be defined in |vimrc|,
in plugin files, or ale_linters directories in ‘runtimepath’.
See |ale-linter-loading-behavior| for more information on loading linters.
A minimal configuration for a language server linter might look so. >
call ale#linter#Define(‘filetypehere’, { \ ‘name’: ‘anynameyouwant’, \ ‘lsp’: ‘stdio’, \ ‘executable’: ‘/path/to/executable’, \ ‘command’: ‘%e run’, \ ‘projectroot’: ‘/path/to/rootof_project’, }) < For language servers that use a TCP or named pipe socket connection, you should define the address to connect to instead. >
call ale#linter#Define(‘filetypehere’, { \ ‘name’: ‘anynameyouwant’, \ ‘lsp’: ‘socket’, \ ‘address’: ‘servername:1234’, \ ‘projectroot’: ‘/path/to/rootof_project’, }) < Most of the options for a language server can be replaced with a |Funcref| for a function accepting a buffer number for dynamically computing values such as the executable path, the project path, the server address, etc, most of which can also be determined based on executing some other asynchronous task. See |ale#command#Run()| for computing linter options based on asynchronous results.
See |ale#linter#Define()| for a detailed explanation of all of the options for configuring linters.
3.3 Other Sources ale-lint-other-sources
Problems for a buffer can be taken from other sources and rendered by ALE. This allows ALE to be used in combination with other plugins which also want to display any problems they might find with a buffer. ALE’s API includes the following components for making this possible.
- |ale#other_source#StartChecking()| - Tell ALE that a buffer is being checked.
- |ale#other_source#ShowResults()| - Show results from another source.
- |ALEWantResults| - A signal for when ALE wants results.
Other resources can provide results for ALE to display at any time, following ALE’s loclist format. (See |ale-loclist-format|) For example: >
“ Tell ALE to show some results. “ This function can be called at any time. call ale#other_source#ShowResults(bufnr(‘‘), ‘some-linter-name’, [ \ {’text’: ‘Something went wrong’, ‘lnum’: 13}, ]) < Other sources should use a unique name for identifying themselves. A single linter name can be used for all problems from another source, or a series of unique linter names can be used. Results can be cleared for that source by providing an empty List.
|ale#othersource#StartChecking()| should be called whenever another source starts checking a buffer, so other tools can know that a buffer is being checked by some plugin. The |ALEWantResults| autocmd event can be used to start checking a buffer for problems every time that ALE does. When |ALEWantResults| is signaled, |g:alewantresultsbuffer| will be set to the number of the buffer that ALE wants to check. |ale#other_source#StartChecking()| should be called synchronously, and other sources should perform their checks on a buffer in the background asynchronously, so they don’t interrupt editing.
|ale#othersource#ShowResults()| must not be called synchronously before ALE’s engine executes its code after the |ALEWantResults| event runs. If there are immediate results to provide to ALE, a 0 millisecond timer with |timerstart()| can be set instead up to call |ale#other_source#ShowResults()| after ALE has first executed its engine code for its own sources.
A plugin might integrate its own checks with ALE like so: >
augroup SomeGroupName autocmd! autocmd User ALEWantResults call Hook(g:alewantresults_buffer) augroup END
function! DoBackgroundWork(buffer) abort “ Start some work in the background here. “ … “ Then call WorkDone(a:buffer, results) endfunction
function! Hook(buffer) abort “ Tell ALE we’re going to check this buffer. call ale#other_source#StartChecking(a:buffer, ‘some-name’) call DoBackgroundWork(a:buffer) endfunction
function! WorkDone(buffer, results) abort “ Send results to ALE after they have been collected. call ale#other_source#ShowResults(a:buffer, ‘some-name’, a:results) endfunction <
- Fixing Problems ale-fix
ALE can fix problems with files with the :ALEFix command. :ALEFix
accepts names of fixers to be applied as arguments. Alternatively,
when no arguments are provided, the variable |g:alefixers| will be
read for getting a |List| of commands for filetypes, split on ., and
the functions named in |g:alefixers| will be executed for fixing the
errors.
The :ALEFixSuggest command can be used to suggest tools that be used to
fix problems for the current buffer.
The values for g:ale_fixers can be a list of |String|, |Funcref|, or
|lambda| values. String values must either name a function, or a short name
for a function set in the ALE fixer registry.
Each function for fixing errors must accept either one argument (buffer) or
two arguments (buffer, lines), representing the buffer being fixed and the
lines to fix. The functions must return either 0, for changing nothing, a
|List| for new lines to set, a |Dictionary| for describing a command to be
run in the background, or the result of |ale#command#Run()|.
Functions receiving a variable number of arguments will not receive the second
argument lines. Functions should name two arguments if the lines argument
is desired. This is required to avoid unnecessary copying of the lines of
the buffers being checked.
When a |Dictionary| is returned for an :ALEFix callback, the following keys
are supported for running the commands.
cwd An optional |String| for setting the working directory
for the command.
If not set, or `v:null`, the `cwd` of the last command
that spawn this one will be used.
command A |String| for the command to run. This key is required.
When `%t` is included in a command string, a temporary
file will be created, containing the lines from the file
after previous adjustment have been done.
See |ale-command-format-strings| for formatting options.
read_temporary_file When set to 1, ALE will read the contents of the
temporary file created for %t. This option can be used
for commands which need to modify some file on disk in
order to fix files.
process_with An optional callback for post-processing.
The callback must accept arguments `(bufnr, output)`:
the buffer number undergoing fixing and the fixer's
output as a |List| of |String|s. It must return a |List|
of |String|s that will be the new contents of the
buffer.
This callback is useful to remove excess lines from the
command's output or apply additional changes to the
output.
read_buffer An optional key for disabling reading the buffer.
When set to `0`, ALE will not pipe the buffer's data
into the command via stdin. This option is ignored and
the buffer is not read when `read_temporary_file` is
`1`.
This option defaults to `1`.
*ale-fix-configuration*
Synchronous functions and asynchronous jobs will be run in a sequence for fixing files, and can be combined. For example:
let g:ale_fixers = { \ ‘javascript’: [ \ ‘DoSomething’, \ ‘eslint’, \ {buffer, lines -> filter(lines, ‘v:val !=~ ‘‘^\s*//’’’)}, \ ], }
ALEFix
<
The above example will call a function called DoSomething which could act
upon some lines immediately, then run eslint from the ALE registry, and
then call a lambda function which will remove every single line comment
from the file.
For buffer-local settings, such as in |g:alepatternoptions| or in ftplugin files, a |List| may be used for configuring the fixers instead.
“ Same as the above, only a List can be used instead of a Dictionary. let b:ale_fixers = [ \ ‘DoSomething’, \ ‘eslint’, \ {buffer, lines -> filter(lines, ‘v:val !=~ ‘‘^\s*//’’’)}, ]
ALEFix
<
For convenience, a plug mapping is defined for :ALEFix, so you can set up a
keybind easily for fixing files. >
“ Bind F8 to fixing problems with ALE
nmap
|g:alefixon_save| - Fix files when they are saved.
Fixers can be disabled on save with |g:alefixonsaveignore|. They will
still be run when you manually run :ALEFix.
Fixers can be run on another machines, just like linters, such as fixers run from a Docker container, running in a virtual machine, running a remote server, etc. See |ale-lint-other-machines|.
- Language Server Protocol Support ale-lsp
ALE integrates with Language Server Protocol (LSP) servers. LSP linters can be
used in combination with any other linter, and will automatically connect to
LSP servers when needed. ALE also supports tsserver for TypeScript, which
uses a different but very similar protocol.
If you want to use another plugin for LSP features and tsserver, you can use
the |g:aledisablelsp| setting to disable ALE’s own LSP integrations, or
ignore particular linters with |g:alelintersignore|. In ALE’s default
configuration ALE will attempt to avoid conflicting with nvim-lspconfig.
ALE will integrate with Neovim’s LSP client by default in Neovim 0.8+. This functionality can be controlled with the |g:aleuseneovimlspapi| setting. See |ale-lsp-neovim| below for information about ALE’s integration with Neovim’s LSP client.
If for any reason you want to stop a language server ALE starts, such as when
a project configuration has significantly changed, or new files have been
added the language server isn’t aware of, use either :ALEStopLSP or
:ALEStopAllLSPs to stop the server until ALE automatically starts it again.
5.1 LSP Neovim Integration ale-lsp-neovim
In Neovim 0.8+ ALE will integrate with Neovim’s native LSP client by default,
unless disabled by setting |g:aleuseneovimlspapi| to 0. All built in
functionality for Neovim’s LSP client should work as expected, and this
ensures ALE integrates well with other plugins that rely on Neovim’s LSP
client.
NOTE: Neovim versions below 0.11.0 do not support socket connections to
language servers when the address defined in ALE uses a hostname instead of
an IP address. To work around this, configure language clients with an IP
address instead of a hostname, or revert back to ALE’s custom LSP client.
See |lsp| for information on Neovim’s built in LSP client.
For diagnostics, for computing problems to show via ALE, ALE overrides the diagnostics handler for the LSP client launched by ALE, so all of the functionality in ALE will work as expected. By default ALE will send diagnostics back to Neovim’s diagnostics API, which can be configured with the |g:aleuseneovimdiagnosticsapi| setting. This ensures that all of the functionality ALE adds on top for diagnostics will function, and that problems from linters that don’t use LSP can be combined with LSP servers. See the diagram below. >
+——————-+ | Language Server | (Sends diagnostics) +——————-+ | +——————-+ | Neovim LSP Client | (Receives diagnostics) +——————-+ | +——————-+ | ALE Processing | (Intercepts and processes diagnostics) +——————-+ | +——————-+ | Diagnostic engine | (Either Neovim’s diagnostics or ALE’s custom code) +——————-+ | +——————-+ | Neovim | (User sees formatted diagnostics) +——————-+ < For LSP functionality executed via ALE’s own functions, commands, and keybinds, ALE will intercept requests and handle them in an entirely custom way, ensuring ALE functionality should work largely the same between different Vim versions. See the diagram below. >
+——————-+ | Neovim | (User triggers LSP request via ALE) +——————-+ | +——————-+ | ALE | (ALE sends request to Neovim client) +——————-+ | +——————-+ | Neovim LSP Client | (Forwards request to language server) +——————-+ | +——————-+ | Language Server | (Processes request and sends response) +——————-+ | +——————-+ | Neovim LSP Client | (Receives response) +——————-+ | +——————-+ | ALE | (ALE Handles “raw” LSP response) +——————-+ | +——————-+ | Neovim | (User sees result) +——————-+ < For LSP functionality built-in to Neovim, such as the |gd| keybind for jumping to a definition, Neovim will bypass ALE entirely, ensuring that ALE does not interfere with LSP functionality as expected by built-in Neovim tools or other plugins. See the diagram below. >
+——————-+ | Neovim | (User triggers LSP request) +——————-+ | +——————-+ | Neovim LSP Client | (Directly handles the request) +——————-+ | +——————-+ | Language Server | (Processes request and sends response) +——————-+ | +——————-+ | Neovim LSP Client | (Receives response and shows result) +——————-+ | +——————-+ | Neovim | (User sees result) +——————-+ <
5.2 Completion ale-completion
In Neovim 0.8+ ALE’s integration with its native LSP client will make it
possible to use other plugins that rely on Neovim’s LSP client as a basis.
nvim-cmp is recommended as a completion plugin worth trying in Neovim.
See: https://github.com/hrsh7th/nvim-cmp
ALE offers support for automatic completion of code while you type. Completion is only supported while at least one LSP linter is enabled. ALE will only suggest symbols provided by the LSP servers.
*ale-deoplete-integration*
ALE integrates with Deoplete for offering automatic completion data. ALE’s
completion source for Deoplete is named 'ale', and should enabled
automatically if Deoplete is enabled and configured correctly. Deoplete
integration should not be combined with ALE’s own implementation.
*ale-asyncomplete-integration*
ALE additionally integrates with asyncomplete.vim for offering automatic completion data. ALE’s asyncomplete source requires registration with defaults provided by the |asyncomplete#sources#ale#getsourceoptions| function >
“ Use ALE’s function for asyncomplete defaults “ Provide your own overrides here. au User asyncompletesetup call asyncomplete#registersource( \ asyncomplete#sources#ale#getsourceoptions({ \ ‘priority’: 10, \ }) )
ALE also offers its own completion implementation, which does not require any other plugins. Suggestions will be made while you type after completion is enabled. ALE’s own completion implementation can be enabled by setting |g:alecompletionenabled| to
trueor1. This setting must be set totrueor1before ALE is loaded. The delay for completion can be configured with |g:alecompletiondelay|. This setting should not be enabled if you wish to use ALE as a completion source for other plugins.
ALE automatic completion will not work when ‘paste’ is active. Only set ‘paste’ when you are copy and pasting text into your buffers.
ALE automatic completion will interfere with default insert completion with
CTRL-N and so on (|compl-vim|). You can write your own keybinds and a
function in your |vimrc| file to force insert completion instead, like so: >
function! SmartInsertCompletion() abort “ Use the default CTRL-N in completion menus if pumvisible() return “<C-n>” endif
" Exit and re-enter insert mode, and use insert completion
return "\<C-c>a\<C-n>"
endfunction
inoremap
“ Use ALE’s function for omnicompletion. set omnifunc=ale#completion#OmniFunc < ale-completion-fallback
You can write your own completion function and fallback on other methods of
completion by checking if there are no results that ALE can determine. For
example, for Python code, you could fall back on the python3complete
function. >
function! TestCompletionFunc(findstart, base) abort let l:result = ale#completion#OmniFunc(a:findstart, a:base)
" Check if ALE couldn't find anything.
if (a:findstart && l:result is -3)
\|| (!a:findstart && empty(l:result))
" Defer to another omnifunc if ALE couldn't find anything.
return python3complete#Complete(a:findstart, a:base)
endif
return l:result
endfunction
set omnifunc=TestCompletionFunc < See |complete-functions| for documentation on how to write completion functions.
ALE will only suggest so many possible matches for completion. The maximum number of items can be controlled with |g:alecompletionmax_suggestions|.
If you don’t like some of the suggestions you see, you can filter them out with |g:alecompletionexcludedwords| or |b:alecompletionexcludedwords|.
The :ALEComplete command can be used to show completion suggestions manually,
even when |g:alecompletionenabled| is set to 0. For manually requesting
completion information with Deoplete, consult Deoplete’s documentation.
ALE supports automatic imports from external modules. This behavior can be
disabled by setting the |g:alecompletionautoimport| variable to 0.
Disabling automatic imports can drop some or all completion items from
some LSP servers (e.g. eclipselsp).
You can manually request imports for symbols at the cursor with the
:ALEImport command. The word at the cursor must be an exact match for some
potential completion result which includes additional text to insert into the
current buffer, which ALE will assume is code for an import line. This command
can be useful when your code already contains something you need to import.
You can execute other commands whenever ALE inserts some completion text with the |ALECompletePost| event.
When working with TypeScript files, ALE can remove warnings from your completions by setting the |g:alecompletiontsserverremovewarnings| variable to 1.
*ale-completion-completeopt-bug*
ALE Automatic completion implementation replaces |completeopt| before opening
the omnicomplete menu with
set completeopt=menu,menuone,preview,noselect,noinsert < Or alternatively, if you want to show documentation in popups: >
set completeopt=menu,menuone,popup,noselect,noinsert < ale-symbols
ALE provides a set of basic completion symbols. If you want to replace those symbols with others, you can set the variable |g:alecompletionsymbols| with a mapping of the type of completion to the symbol or other string that you would like to use. An example here shows the available options for symbols >
let g:alecompletionsymbols = {
\ ‘text’: ‘’,
\ ‘method’: ‘’,
\ ‘function’: ‘’,
\ ‘constructor’: ‘’,
\ ‘field’: ‘’,
\ ‘variable’: ‘’,
\ ‘class’: ‘’,
\ ‘interface’: ‘’,
\ ‘module’: ‘’,
\ ‘property’: ‘’,
\ ‘unit’: ‘unit’,
\ ‘value’: ‘val’,
\ ‘enum’: ‘’,
\ ‘keyword’: ‘keyword’,
\ ‘snippet’: ‘’,
\ ‘color’: ‘color’,
\ ‘file’: ‘’,
\ ‘reference’: ‘ref’,
\ ‘folder’: ‘’,
\ ‘enum member’: ‘’,
\ ‘constant’: ‘’,
\ ‘struct’: ‘’,
\ ‘event’: ‘event’,
\ ‘operator’: ‘’,
\ ‘type_parameter’: ‘type param’,
\ ‘
5.3 Go To Definition ale-go-to-definition
ALE supports jumping to the files and locations where symbols are defined
through any enabled LSP linters. The locations ALE will jump to depend on the
information returned by LSP servers. The :ALEGoToDefinition command will jump
to the definition of symbols under the cursor. See the documentation for the
command for configuring how the location will be displayed.
ALE will update Vim’s |tagstack| automatically unless |g:aleupdatetagstack| is
set to 0.
5.4 Go To Type Definition ale-go-to-type-definition
ALE supports jumping to the files and locations where symbols’ types are
defined through any enabled LSP linters. The locations ALE will jump to depend
on the information returned by LSP servers. The :ALEGoToTypeDefinition
command will jump to the definition of symbols under the cursor. See the
documentation for the command for configuring how the location will be
displayed.
5.5 Go To Implementation ale-go-to-implementation
ALE supports jumping to the files and locations where symbols are implemented
through any enabled LSP linters. The locations ALE will jump to depend on the
information returned by LSP servers. The :ALEGoToImplementation command will
jump to the implementation of symbols under the cursor. See the documentation
for the command for configuring how the location will be displayed.
5.6 Find References ale-find-references
ALE supports finding references for symbols though any enabled LSP linters
with the :ALEFindReferences command. See the documentation for the command
for a full list of options.
5.7 Hovering ale-hover
ALE supports “hover” information for printing brief information about symbols at the cursor taken from LSP linters. The following commands are supported:
:ALEHover - Print information about the symbol at the cursor.
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. You can disable
this behavior by setting |g:alehovercursor| to 0.
If |g:alesetballoons| is set to true or 1 and your version of Vim
supports the |balloon_show()| function, then “hover” information also show up
when you move the mouse over a symbol in a buffer. Diagnostic information will
take priority over hover information for balloons. If a line contains a
problem, that problem will be displayed in a balloon instead of hover
information.
Hover information can be displayed in the preview window instead by setting
|g:alehoverto_preview| to true or 1.
When using Neovim or Vim with |popupwin|, if |g:alehovertofloatingpreview|
or |g:alefloatingpreview| is set to true or 1, the hover information
will show in a floating window. The borders of the floating preview window can
be customized by setting |g:alefloatingwindow_border|.
For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling
|balloonexpr| commands in terminals can cause scrolling issues in terminals,
so ALE will not attempt to show balloons unless |g:alesetballoons| is set to
true or 1 before ALE is loaded.
For enabling mouse support in terminals, you may have to change your mouse settings. For example: >
“ Example mouse settings. “ You will need to try different settings, depending on your terminal. set mouse=a set ttymouse=xterm <
Documentation for symbols at the cursor can be retrieved using the
:ALEDocumentation command. This command is only available for tsserver.
5.8 Symbol Search ale-symbol-search
ALE supports searching for workspace symbols via LSP linters with the
:ALESymbolSearch command. See the documentation for the command
for a full list of options.
5.9 Refactoring: Rename, Actions ale-refactor
ALE supports renaming symbols in code such as variables or class names with
the :ALERename command.
:ALEFileRename will rename file and fix import paths (tsserver only).
:ALECodeAction will execute actions on the cursor or applied to a visual
range selection, such as automatically fixing errors.
Actions will appear in the right click mouse menu by default for GUI versions
of Vim, unless disabled by setting |g:alepopupmenu_enabled| to 0.
Make sure to set your Vim to move the cursor position whenever you right click, and enable the mouse menu: >
set mouse=a set mousemodel=popup_setpos < You may wish to remove some other menu items you don’t want to see: >
silent! aunmenu PopUp.Select\ Word silent! aunmenu PopUp.Select\ Sentence silent! aunmenu PopUp.Select\ Paragraph silent! aunmenu PopUp.Select\ Line silent! aunmenu PopUp.Select\ Block silent! aunmenu PopUp.Select\ Blockwise silent! aunmenu PopUp.Select\ All <
- Global Options ale-options
Options documented here can be configured either Vim variables, or via the |ale.setup| and |ale.setup.buffer| functions in Lua. When configuring via the Lua functions in Lua scripts, ALE will bridge types to Vim script in the following ways.
Strings, numbers, booleans, and
nilwill be represented exactly.Tables with no or only number keys will become a |List| in Vim.
Keys other than strings and numbers in tables cannot be represented.
Tables with special |metatable| properties cannot be represented.
Options accepting functions as values will automatically have Vim functions created that bridge the function calls to and from Lua code.
*g:airline#extensions#ale#enabled*g:airline#extensions#ale#enabled Type: |Number| Default:
1Enables or disables the |airline|’s native extension for ale, which displays warnings and errors in the status line, prefixed by |airline#extensions#ale#errorsymbol| and |airline#extensions#ale#warningsymbol|.
*ale-options.cache_executable_check_failures* *g:ale_cache_executable_check_failures*cacheexecutablecheckfailures g:alecacheexecutablecheck_failures Type: |Boolean| or |Number| Default:
nilWhen set to
trueor1, ALE will cache failing executable checks for linters. By default, only executable checks which succeed will be cached.When this option is set to
trueor1, Vim will have to be restarted after new executables are installed for ALE to be able to run linters for those executables.*ale-options.change_sign_column_color* *g:ale_change_sign_column_color*changesigncolumncolor g:alechangesigncolumn_color Type: |Boolean| or |Number| Default:
falseWhen set to
trueor1, this option will set different highlights for the sign column itself when ALE reports problems with a file. This option can be combined with |g:alesigncolumn_always|.ALE uses the following highlight groups for highlighting the sign column:
:ALESignColumnWithErrors- Links toErrorby default.:ALESignColumnWithoutErrors- Uses the value forSignColumnby default.The sign column color can only be changed globally in Vim. The sign column might produce unexpected results if editing different files in split windows.
*ale-options.close_preview_on_insert* *g:ale_close_preview_on_insert*closepreviewoninsert g:aleclosepreviewon_insert Type: |Boolean| or |Number| Default:
falseWhen this option is set to
trueor1, ALE’s |preview-window| will be automatically closed upon entering Insert Mode. This option can be used in combination with |g:alecursordetail| for automatically displaying the preview window on problem lines, and automatically closing it again when editing text.This setting must be set to
trueor1before ALE is loaded for this behavior to be enabled. See |ale-lint-settings-on-startup|.*ale-options.command_wrapper* *g:ale_command_wrapper* *b:ale_command_wrapper*commandwrapper g:alecommand_wrapper Type: |String| Default:
''An option for wrapping all commands that ALE runs, for linters, fixers, and LSP commands. This option can be set globally, or for specific buffers.
This option can be used to apply nice to all commands. For example: >
“ Prefix all commands with nice. let g:alecommandwrapper = ‘nice -n5’ < Use the
:ALEInfocommand to view the commands that are run. All of the arguments for commands will be put on the end of the wrapped command by default. A%*marker can be used to spread the arguments in the wrapped command. >“ Has the same effect as the above. let g:alecommandwrapper = ‘nice -n5 %*’ < For passing all of the arguments for a command as one argument to a wrapper,
%@can be used instead. >“ Will result in say: /bin/bash -c ‘other-wrapper -c “some command” -x’ let g:alecommandwrapper = ‘other-wrapper -c %@ -x’ < For commands including
&∨, only the last command in the list will be passed to the wrapper.&&is most commonly used in ALE to change the working directory before running a command.*ale-options.completion_delay* *g:ale_completion_delay*completiondelay g:alecompletion_delay Type: |Number| Default:
100The number of milliseconds before ALE will send a request to a language server for completions after you have finished typing.
See |ale-completion|
*ale-options.completion_enabled* *g:ale_completion_enabled* *b:ale_completion_enabled*completionenabled g:alecompletion_enabled Type: |Boolean| or |Number| Default:
falseWhen this option is set to
trueor1, completion support will be enabled.This setting must be set to
trueor1before ALE is loaded for this behavior to be enabled.This setting should not be enabled if you wish to use ALE as a completion source for other completion plugins.
ALE automatic completion will not work when ‘paste’ is active. Only set ‘paste’ when you are copy and pasting text into your buffers.
A buffer-local version of this setting
b:ale_completion_enabledcan be set to0to disable ALE’s automatic completion support for a single buffer. ALE’s completion support must be enabled globally to be enabled locally.See |ale-completion|
*ale-options.completion_tsserver_remove_warnings* *g:ale_completion_tsserver_remove_warnings*completiontsserverremovewarnings g:alecompletiontsserverremove_warnings Type: |Boolean| or |Number| Default:
falseWhen this option is set to
falseor0, ALE will return all completion items from its built in completion engine, including those that are a warning. Warnings can be excluded from completed items by setting it totrueor1.*ale-options.completion_autoimport* *g:ale_completion_autoimport*completionautoimport g:alecompletion_autoimport Type: |Boolean| or |Number| Default:
trueWhen this option is set to
1, ALE will try to automatically import completion results from external modules. It can be disabled by setting it to0. Some LSP servers include auto imports on every completion item so disabling automatic imports may drop some or all completion items returned by it (e.g. eclipselsp).*ale-options.completion_excluded_words* *g:ale_completion_excluded_words* *b:ale_completion_excluded_words*completionexcludedwords g:alecompletionexcluded_words Type: |List| Default:
[]This option can be set to a list of |String| values for “words” to exclude from completion results, as in the words for |complete-items|. The strings will be matched exactly in a case-sensitive manner. (|==#|)
This setting can be configured in ftplugin files with buffer variables, so that different lists can be used for different filetypes. For example: >
“ In ~/.vim/ftplugin/typescript.vim
“ Don’t suggest
itordescribeso we can use snippets for those words. let b:alecompletionexcludedwords = [‘it’, ‘describe’] < *ale-options.completionsymbols* g:alecompletionsymbols completionsymbols g:alecompletion_symbols Type: |Dictionary| Default: Seeautoload/ale/completion.vimA mapping from completion types to symbols for completions. See |ale-symbols| for more information.
By default, this mapping only uses built in Vim completion kinds, but it can be updated to use any Unicode character for the completion kind. For example: > let g:alecompletionsymbols = { \ ‘text’: ‘’, \ ‘method’: ‘’, \ ‘function’: ‘’, \ ‘constructor’: ‘’, \ ‘field’: ‘’, \ ‘variable’: ‘’, \ ‘class’: ‘’, \ ‘interface’: ‘’, \ ‘module’: ‘’, \ ‘property’: ‘’, \ ‘unit’: ‘v’, \ ‘value’: ‘v’, \ ‘enum’: ‘t’, \ ‘keyword’: ‘v’, \ ‘snippet’: ‘v’, \ ‘color’: ‘v’, \ ‘file’: ‘v’, \ ‘reference’: ‘v’, \ ‘folder’: ‘v’, \ ‘enummember’: ‘m’, \ ‘constant’: ‘m’, \ ‘struct’: ‘t’, \ ‘event’: ‘v’, \ ‘operator’: ‘f’, \ ‘typeparameter’: ‘p’, \ ‘
’: ‘v’ \ }) < ale-options.completionmaxsuggestions g:alecompletionmax_suggestions completionmaxsuggestions g:alecompletionmax_suggestions Type: |Number| Default: 50The maximum number of items ALE will suggest in completion menus for automatic completion.
Setting this number higher will require more processing time, and may suggest too much noise. Setting this number lower will require less processing time, but some suggestions will not be included, so you might not be able to see the suggestions you want.
Adjust this option as needed, depending on the complexity of your codebase and your available processing power.
*ale-options.completion_timeout* *g:ale_completion_timeout*completiontimeout g:alecompletion_timeout Type: |Number| Default:
3The maximum time in seconds ale#completion#OmniFunc() will wait for a completion result from the language server.
When the timeout is exceeded ale#completion#OmniFunc() will print an error message and return an empty result. Setting a higher value allows longer response times, but it may also keep Vim unresponsible for a longer time.
*ale-options.cursor_detail* *g:ale_cursor_detail*cursordetail g:alecursor_detail Type: |Number| Default:
falseWhen this option is set to
trueor1, ALE’s |preview-window| will be automatically opened when the cursor moves onto lines with problems. ALE will search for problems using the same logic that |g:aleechocursor| uses. The preview window will be closed automatically when you move away from the line.Messages are only displayed after a short delay. See |g:aleechodelay|.
The preview window is opened without stealing focus, which means your cursor will stay in the same buffer as it currently is.
The preview window can be closed automatically upon entering Insert mode by setting |g:aleclosepreviewoninsert| to
trueor1.Either this setting or |g:aleechocursor| must be set to
trueor1before ALE is loaded for messages to be displayed. See |ale-lint-settings-on-startup|.*ale-options.default_navigation* *g:ale_default_navigation* *b:ale_default_navigation*defaultnavigation g:aledefault_navigation Type: |String| Default:
'buffer'The default method for navigating away from the current buffer to another buffer, such as for
:ALEFindReferencesor:ALEGoToDefinition.*ale-options.detail_to_floating_preview* *g:ale_detail_to_floating_preview* *b:ale_detail_to_floating_preview*detailtofloatingpreview g:aledetailtofloating_preview Type: |Number| Default:
0When this option is set to
1, Neovim or Vim with |popupwin| will use a floating window for ALEDetail output.*ale-options.disable_lsp* *g:ale_disable_lsp* *b:ale_disable_lsp*disablelsp g:aledisable_lsp Type: |Boolean| OR |Number| OR |String| Default:
'auto'When this option is set to
'auto', ALE will automatically disable linters that it detects as having already been configured with thenvim-lspconfigplugin. When this option is set totrueor1, ALE ignores all linters powered by LSP, and alsotsserver.Any linters that are disabled will also not be usable for LSP functionality other than just linting.
Please see also |ale-lsp|.
*ale-options.echo_cursor* *g:ale_echo_cursor*echocursor g:aleecho_cursor Type: |Number| Default:
1When this option is set to
1, a truncated message will be echoed when a cursor is near a warning or error. ALE will attempt to find the warning or error at a column nearest to the cursor when the cursor is resting on a line which contains a warning or error. This option can be set to0to disable this behavior.Messages are only displayed after a short delay. See |g:aleechodelay|.
The format of the message can be customized with |g:aleechomsg_format|.
Either this setting or |g:alecursordetail| must be set to
trueor1before ALE is loaded for messages to be displayed. See |ale-lint-settings-on-startup|.*ale-options.echo_delay* *g:ale_echo_delay* *b:ale_echo_delay*echodelay g:aleecho_delay Type: |Number| Default:
10Given any integer, this option controls the number of milliseconds before ALE will echo or preview a message for a problem near the cursor.
The value can be increased to decrease the amount of processing ALE will do for files displaying a large number of problems.
*ale-options.echo_msg_error_str* *g:ale_echo_msg_error_str*echomsgerrorstr g:aleechomsgerror_str Type: |String| Default:
'Error'The string used for
%severity%for errors. See |g:aleechomsg_format|*ale-options.echo_msg_format* *g:ale_echo_msg_format* *b:ale_echo_msg_format*echomsgformat g:aleechomsg_format Type: |String| Default:
'%code: %%s'This variable defines a message format for echoed messages. The following sequences of characters will be replaced.
%s- replaced with the text for the problem%...code...%- replaced with the error code%linter%- replaced with the name of the linter%severity%- replaced with the severity of the problem (e.g.Error)%type%- replaced with the type of the problem (e.g.E)The strings for
%severity%can be configured with the following options.|g:aleechomsgerrorstr| - Defaults to
'Error'|g:aleechomsginfostr| - Defaults to'Info'|g:aleechomsgwarningstr| - Defaults to'Warning'%code%is replaced with the error code, and replaced with an empty string when there is no error code. Any extra characters between the percent signs will be printed when an error code is present. For example, a message like(error code): messagewill be printed for'%(code): %%s'and simply the message will be printed when there is no code.|g:aleechocursor| needs to be set to 1 for messages to be displayed.
The echo message format can also be configured separately for each buffer, so different formats can be used for different languages. (Say in ftplugin files.)
*ale-options.echo_msg_info_str* *g:ale_echo_msg_info_str*echomsginfostr g:aleechomsginfo_str Type: |String| Default:
'Info'The string used for
%severity%for info. See |g:aleechomsg_format|*ale-options.echo_msg_log_str* *g:ale_echo_msg_log_str*echomsglogstr g:aleechomsglog_str Type: |String| Default:
'Log'The string used for
%severity%for log, used only for handling LSP show message requests. See |g:alelspshowmessageformat|*ale-options.echo_msg_warning_str* *g:ale_echo_msg_warning_str*echomsgwarningstr g:aleechomsgwarning_str Type: |String| Default:
'Warning'The string used for
%severity%for warnings. See |g:aleechomsg_format|*ale-options.enabled* *g:ale_enabled* *b:ale_enabled*enabled g:ale_enabled Type: |Number| Default:
1When set to
0, this option will completely disable ALE, such that no error checking will be performed, etc. ALE can be toggled on and off with the:ALETogglecommand, which changes this option.ALE can be disabled in each buffer by setting
let b:ale_enabled = 0Disabling ALE based on filename patterns can be accomplished by setting a regular expression for |g:alepatternoptions|. For example: >“ Disable linting for all minified JS files. let g:alepatternoptions = {’.min.js$’: {’aleenabled’: 0}} < See |g:alepattern_options| for more information on that option.
*ale-options.exclude_highlights* *g:ale_exclude_highlights* *b:ale_exclude_highlights*excludehighlights g:aleexclude_highlights Type: |List| Default:
[]This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.A list of regular expressions for matching against highlight messages to remove. For example: >
“ Do not highlight messages matching strings like these. let b:aleexcludehighlights = [‘line too long’, ‘foo.*bar’] < See also: |g:alesethighlights|
*ale-options.fixers* *g:ale_fixers* *b:ale_fixers*fixers g:ale_fixers Type: |Dictionary| Default:
{}A mapping from filetypes to |List| values for functions for fixing errors. See |ale-fix| for more information.
This variable can be overridden with variables in each buffer.
b:ale_fixerscan be set to a |List| of callbacks instead, which can be more convenient.A special
'*'key be used as a wildcard filetype for configuring fixers for every other type of file. For example: >“ Fix Python files with ‘bar’. “ Don’t fix ‘html’ files. “ Fix everything else with ‘foo’. let g:alefixers = {’python’: [‘bar’], ‘html’: [], ‘*’: [‘foo’]} < *ale-options.fixonsave* *g:alefixonsave* b:alefixon_save fixonsave g:alefixon_save Type: |Number| Default:
0When set to 1, ALE will fix files when they are saved.
If |g:alelinton_save| is set to 1, files will be checked with linters after files are fixed, only when the buffer is open, or re-opened. Changes to the file will be saved to the file on disk.
Files will not be fixed on
:wq, so you should check your code before closing a buffer.Fixing files can be disabled or enabled for individual buffers by setting
b:ale_fix_on_saveto0or1.Some fixers can be excluded from being run automatically when you save files with the |g:alefixonsaveignore| setting.
*ale-options.fix_on_save_ignore* *g:ale_fix_on_save_ignore* *b:ale_fix_on_save_ignore*fixonsaveignore g:alefixonsave_ignore Type: |Dictionary| or |List| Default:
{}Given a |Dictionary| mapping filetypes to |Lists| of fixers to ignore, or just a |List| of fixers to ignore, exclude those fixers from being run automatically when files are saved.
You can disable some fixers in your ftplugin file: >
“ Disable fixers ‘b’ and ‘c’ when fixing on safe for this buffer. let b:alefixonsaveignore = [‘b’, ‘c’] “ Alternatively, define ignore lists for different filetypes. let b:alefixonsaveignore = {’foo’: [‘b’], ‘bar’: [‘c’]} < You can disable some fixers globally per filetype like so: >
let g:alefixers = {’foo’: [‘a’, ‘b’], ‘bar’: [‘c’, ‘d’]} let g:alefixonsave = 1 “ For filetype
foo.bar, only fixers ‘b’ and ‘d’ will be run on save. let g:alefixonsaveignore = {’foo’: [‘a’], ‘bar’: [‘c’]} “ Alternatively, disable these fixers on save for all filetypes. let g:alefixonsaveignore = [‘a’, ‘c’] < You can ignore fixers based on matching |Funcref| values too: >let g:AddBar = {buffer, lines -> lines + [‘bar’]} let g:alefixers = {’foo’: g:AddBar} “ The lambda fixer will be ignored, as it will be found in the ignore list. let g:alefixonsaveignore = [g:AddBar] < *ale-options.floatingpreview* g:alefloatingpreview floatingpreview g:alefloating_preview Type: |Number| Default:
0When set to
1, Neovim or Vim with |popupwin| will use a floating window for ale’s preview window. This is equivalent to setting |g:alehovertofloatingpreview| and |g:aledetailtofloatingpreview| to1.*ale-options.floating_preview_popup_opts* *g:ale_floating_preview_popup_opts*floatingpreviewpopupopts g:alefloatingpreviewpopup_opts Type: |String| or |Dictionary| Default:
''Either a dictionary of options or the string name of a function that returns a dictionary of options. This will be used as an argument to |popupcreate| for Vim users or |nvimopenwin| for NeoVim users. In either case, the resulting dictionary is merged with ALE defaults rather than explicitly overriding them. This only takes effect if |g:alefloating_preview| is enabled.
NOTE: for Vim users see |popupcreate-arguments|, for NeoVim users see |nvimopen_win| for argument details
For example, to enhance popups with a title: >
function! CustomOpts() abort let [l:info, l:loc] = ale#util#FindItemAtCursor(bufnr(‘‘)) return {’title’: ‘ ALE: ‘ . (l:loc.linter_name) . ‘ ‘} endfunction
let g:alefloatingpreviewpopupopts = ‘g:CustomOpts’ < ale-options.floatingwindowborder g:alefloatingwindow_border floatingwindowborder g:alefloatingwindow_border Type: |List| Default:
['|', '-', '+', '+', '+', '+', '|', '-']When set to
[], window borders are disabled. The elements in the list set the characters for the left side, top, top-left corner, top-right corner, bottom-right corner, bottom-left corner, right side, and bottom of the floating window, respectively.If the terminal supports Unicode, you might try setting the value to
['│', '─', '╭', '╮', '╯', '╰', '│', '─'], to make it look nicer.NOTE: For compatibility with previous versions, if the list does not have elements for the right side and bottom, the left side and top will be used instead.
*ale-options.history_enabled* *g:ale_history_enabled*historyenabled g:alehistory_enabled Type: |Number| Default:
1When set to
1, ALE will remember the last few commands which were run for every buffer which is open. This information can be viewed with the:ALEInfocommand. The size of the buffer can be controlled with the |g:alemaxbufferhistorysize| option.This option can be disabled if storing a command history is not desired.
*ale-options.history_log_output* *g:ale_history_log_output*historylogoutput g:alehistorylog_output Type: |Number| Default:
1When set to
1, ALE will store the output of commands which have completed successfully in the command history, and the output will be displayed when using:ALEInfo.|g:alehistoryenabled| must be set to
1for this output to be stored or printed.Some memory will be consumed by this option. It is very useful for figuring out what went wrong with linters, and for bug reports. Turn this option off if you want to save on some memory usage.
*ale-options.hover_cursor* *g:ale_hover_cursor*hovercursor g:alehover_cursor Type: |Number| Default:
1If set to
1, ALE will show truncated information in the echo line about the symbol at the cursor automatically when the |CursorHold| event is fired. The delay before requesting hover information is based on ‘updatetime’, as with all |CursorHold| events.If there’s a problem on the line where the cursor is resting, ALE will not show any hover information.
See |ale-hover| for more information on hover information.
This setting must be set to
1before ALE is loaded for this behavior to be enabled. See |ale-lint-settings-on-startup|.*ale-options.hover_to_preview* *g:ale_hover_to_preview* *b:ale_hover_to_preview*hovertopreview g:alehoverto_preview Type: |Number| Default:
0If set to
1, hover messages will be displayed in the preview window, instead of in balloons or the message line.*ale-options.hover_to_floating_preview* *g:ale_hover_to_floating_preview* *b:ale_hover_to_floating_preview*hovertofloatingpreview g:alehovertofloating_preview Type: |Number| Default:
0If set to
1, Neovim or Vim with |popupwin| will use floating windows for hover messages.*ale-options.info_default_mode* *g:ale_info_default_mode* *b:ale_info_default_mode*infodefaultmode g:aleinfodefault_mode Type: |String| Default:
'preview'Changes the default mode used for
:ALEInfo. See documentation for:ALEInfofor more information.*ale-options.keep_list_window_open* *g:ale_keep_list_window_open* *b:ale_keep_list_window_open*keeplistwindowopen g:alekeeplistwindow_open Type: |Number| Default:
0When set to
1, this option will keep the loclist or quickfix windows event after all warnings/errors have been removed for files. By default the loclist or quickfix windows will be closed automatically when there are no warnings or errors.See |g:aleopenlist|
*ale-options.list_window_size* *g:ale_list_window_size* *b:ale_list_window_size*listwindowsize g:alelistwindow_size Type: |Number| Default:
10This number configures the number of lines to set for the height of windows opened automatically for ALE problems. The default of
10matches the Vim default height.See |g:aleopenlist| for information on automatically opening windows for quickfix or the loclist.
*ale-options.lint_delay* *g:ale_lint_delay* *b:ale_lint_delay*lintdelay g:alelint_delay Type: |Number| Default:
200This variable controls the milliseconds delay after which the linters will be run after text is changed. This option is only meaningful with the |g:alelintontextchanged| variable set to
always,insert, ornormal.A buffer-local option,
b:ale_lint_delay, can be set to change the delay for different buffers, such as in |ftplugin| files.*ale-options.ale_lint_diff* *g:ale_lint_diff*g:alelintdiff
Type: |Number| Default:
0When this option is set to
1, ALE will lint buffers where&diffis set.*ale-options.lint_on_enter* *g:ale_lint_on_enter*lintonenter g:alelinton_enter
Type: |Number| Default:
1When this option is set to
1, the |BufWinEnter| event will be used to apply linters when buffers are first opened. If this is not desired, this variable can be set to0in your vimrc file to disable this behavior.The |FileChangedShellPost| and |BufEnter| events will be used to check if files have been changed outside of Vim. If a file is changed outside of Vim, it will be checked when it is next opened.
You should set this setting once before ALE is loaded, and restart Vim if you want to change your preferences. See |ale-lint-settings-on-startup|.
*ale-options.lint_on_filetype_changed* *g:ale_lint_on_filetype_changed*lintonfiletypechanged g:alelintonfiletype_changed Type: |Number| Default:
1This option will cause ALE to run when the filetype for a file is changed after a buffer has first been loaded. A short delay will be used before linting will be done, so the filetype can be changed quickly several times in a row, but resulting in only one lint cycle.
You should set this setting once before ALE is loaded, and restart Vim if you want to change your preferences. See |ale-lint-settings-on-startup|.
*ale-options.lint_on_save* *g:ale_lint_on_save*lintonsave g:alelinton_save Type: |Number| Default:
1This option will make ALE run the linters whenever a file is saved when it it set to
1in your vimrc file. This option can be used in combination with the |g:alelintonenter| and |g:alelintontext_changed| options to make ALE only check files after that have been saved, if that is what is desired.*ale-options.lint_on_text_changed* *g:ale_lint_on_text_changed*lintontextchanged g:alelintontext_changed Type: |Boolean| or |Number| or |String| Default:
'normal'This option controls how ALE will check your files as you make changes. The following values can be used.
'always','1',true, or1- Check buffers on |TextChanged| or |TextChangedI|.'normal'- Check buffers only on |TextChanged|.'insert'- Check buffers only on |TextChangedI|.'never','0',false, or0- Never check buffers on changes.ALE will check buffers after a short delay, with a timer which resets on each change. The delay can be configured by adjusting the |g:alelintdelay| variable. ale-linting-interrupts-mapping
Due to a bug in Vim, ALE can interrupt mappings with pending key presses, per |timeoutlen|. If this happens, follow the advice for enabling |g:alelintoninsertleave| below, and set this option to
'normal', or disable it entirely.You should set this setting once before ALE is loaded, and restart Vim if you want to change your preferences. See |ale-lint-settings-on-startup|.
*ale-options.lint_on_insert_leave* *g:ale_lint_on_insert_leave* *b:ale_lint_on_insert_leave*lintoninsertleave g:alelintoninsert_leave Type: |Boolean| or |Number| Default:
trueWhen set to
1in your vimrc file, this option will cause ALE to run linters when you leave insert mode.ALE will not lint files when you escape insert mode with |CTRL-C| by default. You can make ALE lint files with this option when you use |CTRL-C| with the following mapping. >
“ Make using Ctrl+C do the same as Escape, to trigger autocmd commands inoremap
< A buffer-local version of this setting b:ale_lint_on_insert_leavecan be set to0to disable linting when leaving insert mode. The setting must be enabled globally to be enabled locally.You should set this setting once before ALE is loaded, and restart Vim if you want to change your preferences. See |ale-lint-settings-on-startup|.
*ale-options.linter_aliases* *g:ale_linter_aliases* *b:ale_linter_aliases*linteraliases g:alelinter_aliases Type: |Dictionary| or |List| or |String| Default:
{}The |g:alelinteraliases| option can be used to set aliases from one filetype to another. A given filetype can be mapped to use the linters run for another given filetype.
This |Dictionary| will be merged with a default dictionary containing the following values: >
{ \ ‘Dockerfile’: ‘dockerfile’, \ ‘bash’: ‘sh’, \ ‘csh’: ‘sh’, \ ‘javascriptreact’: [‘javascript’, ‘jsx’], \ ‘plaintex’: ‘tex’, \ ‘ps1’: ‘powershell’, \ ‘rmarkdown’: ‘r’, \ ‘rmd’: ‘r’, \ ‘systemverilog’: ‘verilog’, \ ‘typescriptreact’: [‘typescript’, ‘tsx’], \ ‘vader’: [‘vim’, ‘vader’], \ ‘verilogsystemverilog’: [‘verilogsystemverilog’, ‘verilog’], \ ‘vimwiki’: ‘markdown’, \ ‘vue’: [‘vue’, ‘javascript’], \ ‘xsd’: [‘xsd’, ‘xml’], \ ‘xslt’: [‘xslt’, ‘xml’], \ ‘zsh’: ‘sh’, } < For example, if you wish to map a new filetype
'foobar'to run the'php'linters, you could set the following: >let g:alelinteraliases = {’foobar’: ‘php’} < Or in Lua: >
require(“ale”).setup({linteraliases = {foobar = “php”}}) < When combined with the |g:alelinters| option, the original filetype (
'foobar') will be used for determining which linters to run, not the aliased type ('php'). This allows an aliased type to run a different set of linters from the type it is being mapped to.Passing a list of filetypes is also supported. Say you want to lint javascript and css embedded in HTML (using linters that support that). You could alias
htmllike so: >let g:ale_linter_aliases = {'html': ['html', 'javascript', 'css']}< Or in Lua: >require(“ale”).setup({linter_aliases = {html = {"html”, “javascript”, “css”}}) < Note that
htmlitself was included as an alias. That is because aliases will override the original linters for the aliased filetype.Linter aliases can be configured in each buffer with buffer-local variables. ALE will first look for aliases for filetypes in the
b:ale_linter_aliasesvariable, theng:ale_linter_aliases, and then a default Dictionary.b:ale_linter_aliasescan be set to a |List| or a |String|, to tell ALE to load the linters for specific filetypes for a given buffer. >let b:alelinteraliases = [‘html’, ‘javascript’, ‘css’] “ OR, Alias a filetype to only a single filetype with a String. let b:alelinteraliases = ‘javascript’ < Or in Lua: >
require(“ale”).setup.buffer({linteraliases = {"html”, “javascript”, “css”}}) – OR, Alias a filetype to only a single filetype with a String. require(“ale”).setup.buffer({linteraliases = “javascript”}) < No linters will be loaded when the buffer’s filetype is empty.
*ale-options.filename_mappings* *g:ale_filename_mappings* *b:ale_filename_mappings*filenamemappings g:alefilename_mappings Type: |Dictionary| or |List| Default:
{}Either a |Dictionary| mapping a linter or fixer name, as displayed in
:ALEInfo, to a |List| of two-item |List|s for filename mappings, or just a |List| of two-item |List|s. When given some paths to files, the value of this setting will be used to convert filenames on a local file system to filenames on some remote file system, such as paths in a Docker image, virtual machine, or network drive.For example: >
let g:alefilenamemappings = { \ ‘pylint’: [ \ [‘/home/john/proj’, ‘/data’], \ ], } < Or in Lua: >
require(“ale”).setup({ filename_mappings = { pylint = { {”/home/john/proj”, “/data”}, }, }, }) < With the above configuration, a filename such as
/home/john/proj/foo.pywill be provided to the linter/fixer as/data/foo.py, and paths parsed from linter results such as/data/foo.pywill be converted back to/home/john/proj/foo.py.You can use
*as to apply a |List| of filename mappings to all other linters or fixers not otherwise matched. >“ Use one List of paths for pylint. “ Use another List of paths for everything else. let g:alefilenamemappings = { \ ‘pylint’: [ \ [‘/home/john/proj’, ‘/data’], \ ], \ ‘*’: [ \ [‘/home/john/proj’, ‘/other-data’], \ ], } < If you just want every single linter or fixer to use the same filename mapping, you can just use a |List|. >
“ Same as above, but for ALL linters and fixers. let g:alefilenamemappings = [ \ [‘/home/john/proj’, ‘/data’], ] < Or in Lua: >
require(“ale”).setup({ filename_mappings = { {”/home/john/proj”, “/data”}, }, }) < You can provide many such filename paths for multiple projects. Paths are matched by checking if the start of a file path matches the given strings, in a case-sensitive manner. Earlier entries in the |List| will be tried before later entries when mapping to a given file system.
Buffer-local options can be set to the same values to override the global options, such as in |ftplugin| files.
NOTE: Only fixers registered with a short name can support filename mapping by their fixer names. See |ale-fix|. Filename mappings set for all tools by using only a |List| for the setting will also be applied to fixers not in the registry.
NOTE: In order for this filename mapping to work correctly, linters and fixers must exclusively determine paths to files to lint or fix via ALE command formatting as per |ale-command-format-strings|, and paths parsed from linter files must be provided in
filenamekeys if a linter returns results for more than one file at a time, as per |ale-loclist-format|. If you discover a linter or fixer which does not behave properly, please report it as an issue.If you are running a linter or fixer through Docker or another remote file system, you may have to mount your temporary directory, which you can discover with the following command: >
:echo fnamemodify(tempname(), ‘:h:h’) < You should provide a mapping from this temporary directory to whatever you mount this directory to in Docker, or whatever remote file system you are working with.
You can inspect the filename mappings ALE will use with the |ale#GetFilenameMappings()| function.
*ale-options.linters* *g:ale_linters* *b:ale_linters*linters g:ale_linters Type: |Dictionary| or |List| Default:
{}The |g:ale_linters| option sets a |Dictionary| mapping a filetype to a |List| of linter programs to be run when checking particular filetypes.
This |Dictionary| will be merged with a default dictionary containing the following values: >
{ \ ‘apkbuild’: [‘apkbuildlint’, ‘secfixescheck’], \ ‘csh’: [‘shell’], \ ‘elixir’: [‘credo’, ‘dialyxir’, ‘dogma’], \ ‘go’: [‘gofmt’, ‘golangci-lint’, ‘gopls’, ‘govet’], \ ‘groovy’: [‘npm-groovy-lint’], \ ‘hack’: [‘hack’], \ ‘help’: [], \ ‘inko’: [‘inko’], \ ‘json’: [‘jsonlint’, ‘spectral’], \ ‘json’: [‘jsonlint’, ‘spectral’, ‘vscodejson’], \ ‘json5’: [], \ ‘jsonc’: [], \ ‘perl’: [‘perlcritic’], \ ‘perl6’: [], \ ‘python’: [‘flake8’, ‘mypy’, ‘pylint’, ‘pyright’, ‘ruff’, ‘ty’], \ ‘rust’: [‘analyzer’, ‘cargo’], \ ‘spec’: [], \ ‘text’: [], \ ‘vader’: [‘vimls’], \ ‘vue’: [‘eslint’, ‘vls’], \ ‘zsh’: [‘shell’], \ ‘v’: [‘v’], \ ‘yaml’: [‘actionlint’, ‘spectral’, ‘yaml-language-server’, ‘yamllint’], } < This option can be used to enable only a particular set of linters for a file. For example, you can enable only
eslintfor JavaScript files: >let g:ale_linters = {’javascript’: [‘eslint’]} < Or in Lua: >
require(“ale”).setup({linters = {javascript = {"eslint”}}}) < If you want to disable all linters for a particular filetype, you can pass an empty list of linters as the value: >
let g:ale_linters = {’javascript’: []} < Or in Lua: >
require(“ale”).setup({linters = {javascript = {}}}) < All linters will be run for unspecified filetypes. All available linters can be enabled explicitly for a given filetype by passing the string
'all', instead of a List. >let g:ale_linters = {’c’: ‘all’} < Or in Lua: >
require(“ale”).setup({linters = {c = “all”}}) < Linters can be configured in each buffer with buffer-local variables. ALE will first look for linters for filetypes in the
b:ale_lintersvariable, theng:ale_linters, and then the default Dictionary mentioned above.b:ale_linterscan be set to a List, or the string'all'. When linters for two different filetypes share the same name, the first linter loaded will be used. Any ambiguity can be resolved by using a Dictionary specifying which linter to run for which filetype instead. >“ Use ESLint for the buffer if the filetype includes ‘javascript’. let b:alelinters = {’javascript’: [‘eslint’], ‘html’: [‘tidy’]} “ Use a List for the same setting. This will work in most cases. let b:alelinters = [‘eslint’, ‘tidy’] “ Disable all linters for the buffer. let b:alelinters = [] “ Explicitly enable all available linters for the filetype. let b:alelinters = ‘all’ < In Lua: >
require(“ale”).setup.buffer({ linters = {javascript = {"eslint”}, html = {"tidy”}}, }) require(“ale”).setup.buffer({linters = {"eslint”, “tidy”}}) require(“ale”).setup.buffer({linters = {}}) require(“ale”).setup.buffer({linters = “all”}) < ALE can be configured to disable all linters unless otherwise specified with
g:ale_enabledorb:ale_enabledwith the option |g:alelintersexplicit|.*ale-options.linters_explicit* *g:ale_linters_explicit*lintersexplicit g:alelinters_explicit Type: |Boolean| or |Number| Default:
falseWhen set to
trueor1, only the linters from |g:alelinters| and |b:alelinters| will be enabled. The default behavior for ALE is to enable as many linters as possible, unless otherwise specified.*ale-options.linters_ignore* *g:ale_linters_ignore* *b:ale_linters_ignore*lintersignore g:alelinters_ignore Type: |Dictionary| or |List| Default:
{}Linters to ignore. Commands for ignored linters will not be run, and diagnostics for LSP linters will be ignored. (See |ale-lsp|)
This setting can be set to a |Dictionary| mapping filetypes to linter names, just like |g:ale_linters|, to list linters to ignore. Ignore lists will be applied after everything else. >
“ Select flake8 and pylint, and ignore pylint, so only flake8 is run. let g:alelinters = {’python’: [‘flake8’, ‘pylint’]} let g:alelinters_ignore = {’python’: [‘pylint’]} < Or in Lua: >
require(“ale”).setup({ linters = {"python”: {"flake8”, “pylint”}}, linters_ignore = {"python”: {"pylint”}}, }) < This setting can be set to simply a |List| of linter names, which is especially more convenient when using the setting in ftplugin files for particular buffers. >
“ The same as above, in a ftplugin/python.vim. let b:alelinters = [‘flake8’, ‘pylint’] let b:alelinters_ignore = [‘pylint’] < Or in Lua: >
require(“ale”).setup.buffer({ linters = {"flake8”, “pylint”}, lintersignore = {"pylint”}, }) < *ale-options.listvertical* g:alelistvertical b:alelistvertical listvertical g:alelist_vertical Type: |Boolean| or |Number| Default:
falseWhen set to
trueor1, this will cause ALE to open any windows (loclist or quickfix) vertically instead of horizontally (|vert| |lopen|) or (|vert| |copen|)*ale-options.loclist_msg_format* *g:ale_loclist_msg_format* *b:ale_loclist_msg_format*loclistmsgformat g:aleloclistmsg_format Type: |String| Default:
g:ale_echo_msg_format(echo_msg_format)This option is the same as |g:aleechomsg_format|, but for formatting the message used for the loclist and the quickfix list.
The strings for configuring
%severity%are also used for this option.*ale-options.lsp_show_message_format* *g:ale_lsp_show_message_format*lspshowmessageformat g:alelspshowmessage_format Type: |String| Default:
'%severity%:%linter%: %s'This variable defines the format that messages received from an LSP will have when echoed. The following sequences of characters will be replaced.
%s- replaced with the message text%linter%- replaced with the name of the linter%severity%- replaced with the severity of the messageThe strings for
%severity%levels “error”, “info” and “warning” are shared with |g:aleechomsgformat|. Severity “log” is unique to |g:alelspshowmessage_format| and it can be configured via|g:aleechomsglogstr| - Defaults to
'Log'Please note that |g:alelspshowmessageformat| can not be configured separately for each buffer like |g:aleechomsg_format| can.
*ale-options.lsp_show_message_severity* *g:ale_lsp_show_message_severity*lspshowmessageseverity g:alelspshowmessage_severity Type: |String| Default:
'error'This variable defines the minimum severity level an LSP message needs to be displayed. Messages below this level are discarded; please note that messages with
Logseverity level are always discarded.Possible values follow the LSP spec
MessageTypedefinition:'error'- Displays only errors.'warning'- Displays errors and warnings.'information'- Displays errors, warnings and infos'log'- Same as'information''disabled'- Doesn’t display any information at all.*ale-options.lsp_suggestions* *g:ale_lsp_suggestions*lspsuggestions g:alelsp_suggestions Type: |Boolean| or |Number| Default:
falseIf set to
trueor `1, show suggestions from LSP servers or tsserver, in addition to warnings and errors.*ale-options.max_buffer_history_size* *g:ale_max_buffer_history_size*maxbufferhistorysize g:alemaxbufferhistory_size Type: |Number| Default:
20This setting controls the maximum number of commands which will be stored in the command history used for
:ALEInfo. Command history will be rotated in a FIFO manner. If set to a number <= 0, then the history will be continuously set to an empty |List|.History can be disabled completely with |g:alehistoryenabled|.
*ale-options.max_signs* *g:ale_max_signs* *b:ale_max_signs*maxsigns g:alemax_signs Type: |Number| Default:
-1This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.When set to any positive integer, ALE will not render any more than the given number of signs for any one buffer.
When set to
0, no signs will be set, but sign processing will still be done, so existing signs can be removed.When set to any other value, no limit will be imposed on the number of signs set.
For disabling sign processing, see |g:alesetsigns|.
*ale-options.maximum_file_size* *g:ale_maximum_file_size* *b:ale_maximum_file_size*maximumfilesize g:alemaximumfile_size Type: |Number| Default:
nilA maximum file size in bytes for ALE to check. If set to any positive number, ALE will skip checking files larger than the given size.
*ale-options.open_list* *g:ale_open_list* *b:ale_open_list*openlist g:aleopen_list Type: |Boolean| |Number| or |String| Default:
falseWhen set to
trueor1, this will cause ALE to automatically open a window for the loclist (|lopen|) or for the quickfix list instead if |g:alesetquickfix| istrueor1. (|copen|)When set to any higher numerical value, ALE will only open the window when the number of warnings or errors are at least that many.
When set to
'on_save', ALE will only open the loclist after buffers have been saved. The list will be opened some time after buffers are saved and any linter for a buffer returns results.The window will be kept open until all warnings or errors are cleared, including those not set by ALE, unless |g:alekeeplistwindowopen| is set to
trueor1, in which case the window will be kept open when no problems are found.The window size can be configured with |g:alelistwindow_size|.
Windows can be opened vertically with |g:alelistvertical|.
If you want to close the loclist window automatically when the buffer is closed, you can set up the following |autocmd| command: >
augroup CloseLoclistWindowGroup autocmd! autocmd QuitPre * if empty(&buftype) | lclose | endif augroup END < g:alepatternoptions g:alepatternoptions Type: |Dictionary| Default:
nilNOTE: This option is not available through |ale.setup| in Lua as the options named here would require separate translation to the equivalent Vim options. You should instead use conditions in ftplugin files to configure options based on filename patterns.
This option maps regular expression patterns to |Dictionary| values for buffer variables. This option can be set to automatically configure different settings for different files. For example: >
“ Use just ESLint for linting and fixing files which end in ‘.foo.js’ let g:alepatternoptions = { \ ‘.foo.js$’: { \ ‘alelinters’: [‘eslint’], \ ‘alefixers’: [‘eslint’], \ }, } < See |b:alelinters| and |b:alefixers| for information for those options.
Filenames are matched with |match()|, and patterns depend on the |magic| setting, unless prefixed with the special escape sequences like
'\v', etc. The patterns can match any part of a filename. The absolute path of the filename will be used for matching, taken fromexpand('%:p').The options for every match for the filename will be applied, with the pattern keys sorted in alphabetical order. Options for
'zebra'will override the options for'alpha'for a filenamealpha-zebra.*ale-options.pattern_options_enabled* *g:ale_pattern_options_enabled*patternoptionsenabled g:alepatternoptions_enabled Type: |Boolean| or |Number| Default:
nilThis option can be used for disabling pattern options. If set to
0, ALE will not set buffer variables per |g:alepatternoptions|.*ale-options.popup_menu_enabled* *g:ale_popup_menu_enabled*popupmenuenabled g:alepopupmenu_enabled Type: |Boolean| or |Number| Default:
has('gui_running')When this option is set to
trueor1, ALE will show code actions and rename capabilities in the right click mouse menu when there’s a LSP server or tsserver available. See |ale-refactor|.This feature is only supported in GUI versions of Vim.
This setting must be set to
trueor1before ALE is loaded for this behavior to be enabled. See |ale-lint-settings-on-startup|.*ale-options.references_show_contents* *g:ale_references_show_contents*referencesshowcontents g:alereferencesshow_contents Type: |Boolean| or |Number| Default: true
If set to
trueor1, matches found by:ALEFindReferenceswill be shown with a preview of the matching line.*ale-options.references_use_fzf* *g:ale_references_use_fzf*referencesusefzf g:alereferencesuse_fzf Type: |Boolean| or |Number| Default:
falseIf set to
trueor1, matches found by:ALEFindReferenceswill be always shown using |fzf-vim| (https://github.com/junegunn/fzf.vim).*ale-options.rename_tsserver_find_in_comments* *g:ale_rename_tsserver_find_in_comments*renametsserverfindincomments g:alerenametsserverfindin_comments Type: |Boolean| or |Number| Default:
falseIf set to
trueor1, this option will tell tsserver to find and replace text in comments when calling:ALERename.*ale-options.rename_tsserver_find_in_strings* *g:ale_rename_tsserver_find_in_strings*renametsserverfindinstrings g:alerenametsserverfindin_strings Type: |Boolean| or |Number| Default:
falseIf set to
trueor1, this option will tell tsserver to find and replace text in strings when calling:ALERename.*ale-options.root* *g:ale_root* *b:ale_root*root g:ale_root Type: |Dictionary| or |String| Default:
{}This option is used to determine the project root for a linter. If the value is a |Dictionary|, it maps a linter to either a |String| containing the project root or a |Funcref| to call to look up the root. The |Funcref| is provided the buffer number as its argument. If the the value is a string, it will be interpreted as the project root itself.
If neither variable yields a result, a linter-specific function is invoked to detect a project root. If this, too, yields no result, and the linter is an LSP linter, it will not run.
*ale-options.save_hidden* *g:ale_save_hidden*savehidden g:alesave_hidden Type: |Boolean| or |Number| Default:
falseWhen set to
trueor1, save buffers when ‘hidden’ is set when applying code actions or rename operations, such as through:ALERenameor:ALEOrganizeImports.*ale-options.set_balloons* *g:ale_set_balloons* *b:ale_set_balloons*setballoons g:aleset_balloons Type: |Boolean| or |Number| or |String| Default:
has('balloon_eval') && has('gui_running')When this option is set to
trueor1, balloon messages will be displayed for problems or hover information if available.Problems nearest to the line the mouse cursor is over will be displayed. If there are no problems to show, and one of the linters is an LSP linter supporting “Hover” information, per |ale-hover|, then brief information about the symbol under the cursor will be displayed in a balloon.
This option can be set to
'hover'to only enable balloons for hover message, so diagnostics are never shown in balloons. You may wish to configure use this setting only in GUI Vim like so: >let g:alesetballoons = has(‘gui_running’) ? ‘hover’ : 0 < Balloons can be enabled for terminal versions of Vim that support balloons, but some versions of Vim will produce strange mouse behavior when balloons are enabled. To configure balloons for your terminal, you should first configure your |ttymouse| setting, and then consider setting
g:ale_set_balloonsto1before ALE is loaded.b:ale_set_balloonscan be set to0to disable balloons for a buffer. Balloons cannot be enabled for a specific buffer when not initially enabled globally.Balloons will not be shown when |g:aleenabled| or |b:aleenabled| is not
trueor1.*ale-options.set_balloons_legacy_echo* *g:ale_set_balloons_legacy_echo* *b:ale_set_balloons_legacy_echo*setballoonslegacyecho g:alesetballoonslegacy_echo Type: |Boolean| or |Number| Default:
nilIf set to
trueor1, moving your mouse over documents in Vim will make ALE asktsserverorLSPservers for information about the symbol where the mouse cursor is, and print that information into Vim’s echo line. This is an option for supporting older versions of Vim which do not properly support balloons in an asynchronous manner.If your version of Vim supports the |balloon_show| function, then this option does nothing meaningful.
*ale-options.set_highlights* *g:ale_set_highlights*sethighlights g:aleset_highlights Type: |Boolean| or |Number| Default:
has('syntax')This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.ALE’s highlight groups will not be used when setting highlights through Neovim’s diagnostics API. See |diagnostic-highlights| for how to configure Neovim diagnostic highlighting.
When this option is set to
trueor1, highlights will be presented.ALE will use the following highlight groups for problems:
ALEError items with
'type': 'E'|hl-ALEError| ALEWarning items with'type': 'W'|hl-ALEWarning| ALEInfo items with'type': 'I'|hl-ALEInfo| ALEStyleError items with'type': 'E'and'sub_type': 'style'|hl-ALEStyleError| ALEStyleWarning items with'type': 'W'and'sub_type': 'style'|hl-ALEStyleWarning|When |g:alesetsigns| is not set to
trueor1, the following highlights for entire lines will be set.ALEErrorLine all items with
'type': 'E'|hl-ALEErrorLine| ALEWarningLine all items with'type': 'W'|hl-ALEWarningLine| ALEInfoLine all items with'type': 'I'|hl-ALEInfoLine|Vim can only highlight the characters up to the last column in a buffer for match highlights, whereas the line highlights when signs are enabled will run to the edge of the screen.
Highlights can be excluded with the |g:aleexcludehighlights| option.
*ale-options.set_loclist* *g:ale_set_loclist*setloclist g:aleset_loclist Type: |Boolean| or |Number| Default:
trueWhen this option is set to
trueor1, the |location-list| will be populated with any warnings and errors which are found by ALE. This feature can be used to implement jumping between errors through typical use of:lnextand:lprev.*ale-options.set_quickfix* *g:ale_set_quickfix*setquickfix g:aleset_quickfix Type: |Boolean| or |Number| Default:
falseWhen this option is set to
trueor1, the |quickfix| list will be populated with any problems which are found by ALE, instead of the |location-list|. The loclist will never be populated when this option is enabled.Problems from every buffer ALE has checked will be included in the quickfix list, which can be checked with
:copen. Problems will be de-duplicated.This feature should not be used in combination with tools for searching for matches and commands like
:cfdo, as ALE will replace the quickfix list pretty frequently. If you wish to use such tools, you should populate the loclist or use:ALEPopulateQuickfixinstead.*ale-options.set_signs* *g:ale_set_signs*setsigns g:aleset_signs Type: |Boolean| or |Number| Default:
has('signs')When this option is set to
trueor1, the |sign| column will be populated with signs marking where problems appear in the file.When |g:aleuseneovimdiagnosticsapi| is
1, the only other setting that will be respected for signs is |g:alesignpriority|. ALE’s highlight groups will and other sign settings will not apply when setting signs through Neovim’s diagnostics API. See |diagnostic-signs| for how to configure signs in Neovim.ALE will use the following highlight groups for problems:
ALEErrorSign items with
'type': 'E'|hl-ALEErrorSign| ALEWarningSign items with'type': 'W'|hl-ALEWarningSign| ALEInfoSign items with'type': 'I'|hl-ALEInfoSign| ALEStyleErrorSign items with'type': 'E'and'sub_type': 'style'|hl-ALEStyleErrorSign| ALEStyleWarningSign items with'type': 'W'and'sub_type': 'style'|hl-ALEStyleWarningSign|In addition to the style of the signs, the style of lines where signs appear can be configured with the following highlights:
ALEErrorLine all items with
'type': 'E'|hl-ALEErrorLine| ALEWarningLine all items with'type': 'W'|hl-ALEWarningLine| ALEInfoLine all items with'type': 'I'|hl-ALEInfoLine|With Neovim 0.3.2 or higher, ALE can use the
numhloption to highlight the ‘number’ column. It uses the following highlight groups.ALEErrorSignLineNr items with
'type': 'E'|hl-ALEErrorSignLineNr| ALEWarningSignLineNr items with'type': 'W'|hl-ALEWarningSignLineNr| ALEInfoSignLineNr items with'type': 'I'|hl-ALEInfoSignLineNr| ALEStyleErrorSignLineNr items with'type': 'E'and'sub_type': 'style'|hl-ALEStyleErrorSignLineNr| ALEStyleWarningSignLineNr items with'type': 'W'and'sub_type': 'style'|hl-ALEStyleWarningSignLineNr|To enable line number highlighting |g:alesignhighlight_linenrs| must be set to
trueor1before ALE is loaded.The markers for the highlights can be customized with the following options:
|g:alesignerror| |g:alesignwarning| |g:alesigninfo| |g:alesignstyleerror| |g:alesignstylewarning|
When multiple problems exist on the same line, the signs will take precedence in the order above, from highest to lowest.
To limit the number of signs ALE will set, see |g:alemaxsigns|.
*ale-options.sign_priority* *g:ale_sign_priority*signpriority g:alesign_priority Type: |Number| Default:
30From Neovim 0.4.0 and Vim 8.1, ALE can set sign priority to all signs. The larger this value is, the higher priority ALE signs have over other plugin signs. See |sign-priority| for further details on how priority works.
*ale-options.shell* *g:ale_shell* *b:ale_shell*shell g:ale_shell Type: |String| Default:
nilOverride the shell used by ALE for executing commands. ALE uses ‘shell’ by default, but falls back in
/bin/shif the default shell looks likefishorpwsh, which are not compatible with all of the commands run by ALE. The shell specified with this option will be used even if it might not work in all cases.For Windows, ALE uses
cmdwhen this option isn’t set. Setting this option will apply shell escaping to the command string, even on Windows.NOTE: Consider setting |g:aleshellarguments| if this option is defined.
*ale-options.shell_arguments* *g:ale_shell_arguments* *b:ale_shell_arguments*shellarguments g:aleshell_arguments Type: |String| Default:
nilThis option specifies the arguments to use for executing a command with a custom shell, per |g:ale_shell|. If this option is not set, ‘shellcmdflag’ will be used instead.
*ale-options.sign_column_always* *g:ale_sign_column_always*signcolumnalways g:alesigncolumn_always Type: |Boolean| or |Number| Default:
v:falseThis has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.By default, the sign gutter will disappear when all warnings and errors have been fixed for a file. When this option is set to
1, the sign column will remain open. This can be preferable if you don’t want the text in your file to move around as you edit a file.*ale-options.sign_error* *g:ale_sign_error*signerror g:alesign_error Type: |String| Default:
'E'This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.The sign for errors in the sign gutter.
*ale-options.sign_info* *g:ale_sign_info*signinfo g:alesign_info Type: |String| Default:
'I'This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.The sign for “info” markers in the sign gutter.
*ale-options.sign_style_error* *g:ale_sign_style_error*signstyleerror g:alesignstyle_error Type: |String| Default:
g:ale_sign_errorThis has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.The sign for style errors in the sign gutter.
*ale-options.sign_style_warning* *g:ale_sign_style_warning*signstylewarning g:alesignstyle_warning Type: |String| Default:
g:ale_sign_warningThis has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.The sign for style warnings in the sign gutter.
*ale-options.sign_offset* *g:ale_sign_offset*signoffset g:alesign_offset Type: |Number| Default:
1000000This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.This variable controls offset from which numeric IDs will be generated for new signs. Signs cannot share the same ID values, so when two Vim plugins set signs at the same time, the IDs have to be configured such that they do not conflict with one another. If the IDs used by ALE are found to conflict with some other plugin, this offset value can be changed, and hopefully both plugins will work together. See |sign-place| for more information on how signs are set.
*ale-options.sign_warning* *g:ale_sign_warning*signwarning g:alesign_warning Type: |String| Default:
'W'This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.The sign for warnings in the sign gutter.
*ale-options.sign_highlight_linenrs* *g:ale_sign_highlight_linenrs*signhighlightlinenrs g:alesignhighlight_linenrs Type: |Boolean| or |Number| Default:
falseThis has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.When set to
trueor1, this option enables highlighting problems on the ‘number’ column in Vim versions that supportnumhlhighlights. This option must be configured before ALE is loaded.*ale-options.update_tagstack* *g:ale_update_tagstack* *b:ale_update_tagstack*updatetagstack g:aleupdate_tagstack Type: |Boolean| or |Number| Default:
v:trueWhen set to
trueor1, ALE will update Vims |tagstack| automatically when jumping to a location through ALE’s commands, so users can jump back to where they came from. ale-options.type_map g:aletypemap b:aletypemap typemap g:aletype_map Type: |Dictionary| Default:{}This option can be set re-map problem types for linters. Each key in the |Dictionary| should be the name of a linter, and each value must be a |Dictionary| mapping problem types from one type to another. The following types are supported:
'E'-{'type': 'E'}'ES'-{'type': 'E', 'sub_type': 'style'}'W'-{'type': 'W'}'WS'-{'type': 'W', 'sub_type': 'style'}'I'-{'type': 'I'}For example, if you want to turn flake8 errors into warnings, you can write the following: >
let g:aletypemap = {’flake8’: {’ES’: ‘WS’, ‘E’: ‘W’}} < Or in Lua: >
require(“ale”).setup(type_map = {flake8 = {ES = “WS”, E = “W”}}) < If you wanted to turn style errors and warnings into regular errors and warnings, you can write the following: >
let g:aletypemap = {’flake8’: {’ES’: ‘E’, ‘WS’: ‘W’}} < Or in Lua: >
require(“ale”).setup(type_map = {flake8 = {ES = “E”, WS = “W”}}) < Type maps can be set per-buffer with
b:ale_type_map, or in Lua with |ale.setup.buffer|.*ale-options.use_global_executables* *g:ale_use_global_executables*useglobalexecutables g:aleuseglobal_executables Type: |Number| Default:
nilThis option can be set to change the default for all
_use_globaloptions. This option must be set before ALE is loaded, preferably in a vimrc file.See |ale-integrations-local-executables| for more information on those options.
*ale-options.use_neovim_diagnostics_api* *g:ale_use_neovim_diagnostics_api*useneovimdiagnosticsapi g:aleuseneovimdiagnostics_api Type: |Boolean| or |Number| Default:
has('nvim-0.7')If set to
trueor1, disable ALE’s standard UI, and instead send all linter output to Neovim’s diagnostics API. This allows you to collect problems using ALE and other plugins together all in one place. Many options for configuring how problems appear on the screen will not apply when the API is enabled.This option requires Neovim 0.7+, as that version introduces the diagnostics API.
*ale-options.use_neovim_lsp_api* *g:ale_use_neovim_lsp_api*useneovimlspapi g:aleuseneovimlsp_api Type: |Boolean| or |Number| Default:
has('nvim-0.8')If set to
trueor1, ALE will use Neovim’s native LSP client API for LSP functionality. This makes it possible to use Neovim’s built in LSP commands and keybinds, and improves integration with other Neovim plugins that integrate with Neovim’s LSP client.See |ale-lsp-neovim| for more information about ALE’s integration with Neovim’s LSP client.
This option requires Neovim 0.8+.
*ale-options.virtualtext_cursor* *g:ale_virtualtext_cursor*virtualtextcursor g:alevirtualtext_cursor Type: |Number| or |String| Default:
'all'(if supported, otherwise'disabled')This option controls how ALE will display problems using |virtual-text|. The following values can be used.
'all','2', or2- Show problems for all lines.'current','1', or1- Show problems for the current line.'disabled','0', or0- Do not show problems with virtual-text.When |g:aleuseneovimdiagnosticsapi| is
1,'current'will behave the same as'all'.Messages are only displayed after a short delay. See |g:alevirtualtextdelay|.
Messages can be prefixed with a string if not using Neovim’s diagnostics API. See |g:alevirtualtextprefix|.
If and only if not displaying problems via Neovim’s diagnostics API, highlights for configuring ALE’s virtualtext messages can be configured with custom highlight groups:
ALEVirtualTextError items with
'type': 'E'|hl-ALEVirtualTextError| ALEVirtualTextWarning items with'type': 'W'|hl-ALEVirtualTextWarning| ALEVirtualTextInfo items with'type': 'I'|hl-ALEVirtualTextInfo| ALEVirtualTextStyleError items with'type': 'E'and'sub_type': 'style'|hl-ALEVirtualTextStyleError| ALEVirtualTextStyleWarning items with'type': 'W'and'sub_type': 'style'|hl-ALEVirtualTextStyleWarning|*ale-options.virtualtext_delay* *g:ale_virtualtext_delay* *b:ale_virtualtext_delay*virtualtextdelay g:alevirtualtext_delay Type: |Number| Default:
10This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.Given any integer, this option controls the number of milliseconds before ALE will show a message for a problem near the cursor.
The value can be increased to decrease the amount of processing ALE will do for files displaying a large number of problems.
*ale-options.virtualtext_prefix* *g:ale_virtualtext_prefix* *b:ale_virtualtext_prefix*virtualtextprefix g:alevirtualtext_prefix Type: |String| Default:
'%comment% %type%: 'This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.Prefix to be used with |g:alevirtualtextcursor|.
This setting can be changed in each buffer with |b:alevirtualtextprefix||.
All of the same format markers used for |g:aleechomsg_format| can be used for defining the prefix, including some additional sequences of characters.
%comment%- replaced with comment characters in the current languageALE will read the comment characters from ‘commentstring’, reading only the part before
%s, with whitespace trimmed. If comment syntax cannot be pulled from ‘commentstring’, ALE will default to'#'.*ale-options.virtualtext_column* *g:ale_virtualtext_column* *b:ale_virtualtext_column* *ale-options.virtualtext_maxcolumn* *g:ale_virtualtext_maxcolumn* *b:ale_virtualtext_maxcolumn*virtualtextcolumn virtualtextmaxcolumn g:alevirtualtextcolumn g:alevirtualtextmaxcolumn Type: |String| or |Number| Default:
0This has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.Virtualtext column range, from
columntomaxcolumn. If a line iscolumnor less characters long, the virtualtext message is shifted right tocolumn.Where the line is greater than
columncharacters long, but less thanmaxcolumn, the virtualtext message is placed at the end of the line.Where the line is greater than
maxcolumnthe virtualtext message is omitted.A |Number| greater than
0is used as the fixed column position, however a |String| ending in%represents a percentage of the window width. Whencolumnis set to zero, column positioning is disabled, whenmaxcolumnis set to zero, no maximum line length is enforced.*ale-options.virtualtext_single* *g:ale_virtualtext_single* *b:ale_virtualtext_single*virtualtextsingle g:alevirtualtext_single Type: |Boolean| or |Number| Default:
trueThis has no effect when |g:aleuseneovimdiagnosticsapi| is
trueor1.Enable or disable concatenation of multiple virtual text messages on a single line. By default, if a line has multiple errors or warnings, each will be appended in turn.
With
singleset to a non-zero value, only the first problem on a line will be printed with virtual text. The most severe problem on a line will be printed. If two problems exist on a line of equal severity, the problem at the left-most position will be printed.*ale-options.virtualenv_dir_names* *g:ale_virtualenv_dir_names* *b:ale_virtualenv_dir_names*virtualenvdirnames g:alevirtualenvdir_names Type: |List| Default:
['.venv', 'env', 've', 'venv', 'virtualenv', '.env']A list of directory names to be used when searching upwards from Python files to discover virtualenv directories with.
For directory named
'foo', ALE will search for'foo/bin/activate'(foo\Scripts\activate\on Windows) in all directories on and above the directory containing the Python file to find virtualenv paths.*ale-options.warn_about_trailing_blank_lines* *g:ale_warn_about_trailing_blank_lines* *b:ale_warn_about_trailing_blank_lines*warnabouttrailingblanklines g:alewarnabouttrailingblank_lines Type: |Number| Default:
1When this option is set to
1, warnings about trailing blank lines will be shown.This option behaves similarly to |g:alewarnabouttrailingwhitespace|.
*ale-options.warn_about_trailing_whitespace* *g:ale_warn_about_trailing_whitespace* *b:ale_warn_about_trailing_whitespace*warnabouttrailingwhitespace g:alewarnabouttrailing_whitespace Type: |Number| Default:
1When this option is set to
1, warnings relating to trailing whitespace on lines will be shown. If warnings are too irritating while editing buffers, and you have configured Vim to automatically remove trailing whitespace, you can disable these warnings by setting this option to0.Not all linters may respect this option. If a linter does not, please file a bug report, and it may be possible to add such support.
This option may be configured on a per buffer basis.
*ale-options.windows_node_executable_path* *g:ale_windows_node_executable_path* *b:ale_windows_node_executable_path*windowsnodeexecutablepath g:alewindowsnodeexecutable_path Type: |String| Default:
'node.exe'This variable is used as the path to the executable to use for executing scripts with Node.js on Windows.
For Windows, any file with a
.jsfile extension needs to be executed with the node executable explicitly. Otherwise, Windows could try and open the scripts with other applications, like a text editor. Therefore, these scripts are executed with whatever executable is configured with this setting.
6.1. Highlights ale-highlights
ALEError hl-ALEError
Default: highlight link ALEError SpellBad
The highlight for highlighted errors. See |g:alesethighlights|.
ALEErrorLine hl-ALEErrorLine
Default: Undefined
The highlight for an entire line where errors appear. Only the first line for a problem will be highlighted.
See |g:alesetsigns| and |g:alesethighlights|.
ALEErrorSign hl-ALEErrorSign
Default: highlight link ALEErrorSign error
The highlight for error signs. See |g:alesetsigns|.
ALEErrorSignLineNr hl-ALEErrorSignLineNr
Default: highlight link ALEErrorSignLineNr CursorLineNr
The highlight for error signs. See |g:alesetsigns|.
NOTE: This highlight is only available on Neovim 0.3.2 or higher.
ALEInfo hl-ALEInfo
ALEInfo-highlight
Default: highlight link ALEInfo ALEWarning
The highlight for highlighted info messages. See |g:alesethighlights|.
ALEInfoSign hl-ALEInfoSign
Default: highlight link ALEInfoSign ALEWarningSign
The highlight for info message signs. See |g:alesetsigns|.
ALEInfoLine hl-ALEInfoLine
Default: Undefined
The highlight for entire lines where info messages appear. Only the first line for a problem will be highlighted.
See |g:alesetsigns| and |g:alesethighlights|.
ALEInfoSignLineNr hl-ALEInfoSignLineNr
Default: highlight link ALEInfoSignLineNr CursorLineNr
The highlight for error signs. See |g:alesetsigns|.
NOTE: This highlight is only available on Neovim 0.3.2 or higher.
ALEStyleError hl-ALEStyleError
Default: highlight link ALEStyleError ALEError
The highlight for highlighted style errors. See |g:alesethighlights|.
ALEStyleErrorSign hl-ALEStyleErrorSign
Default: highlight link ALEStyleErrorSign ALEErrorSign
The highlight for style error signs. See |g:alesetsigns|.
ALEStyleErrorSignLineNr hl-ALEStyleErrorSignLineNr
Default: highlight link ALEStyleErrorSignLineNr CursorLineNr
The highlight for error signs. See |g:alesetsigns|.
NOTE: This highlight is only available on Neovim 0.3.2 or higher.
ALEStyleWarning hl-ALEStyleWarning
Default: highlight link ALEStyleWarning ALEError
The highlight for highlighted style warnings. See |g:alesethighlights|.
ALEStyleWarningSign hl-ALEStyleWarningSign
Default: highlight link ALEStyleWarningSign ALEWarningSign
The highlight for style warning signs. See |g:alesetsigns|.
ALEStyleWarningSignLineNr hl-ALEStyleWarningSignLineNr
Default: highlight link ALEStyleWarningSignLineNr CursorLineNr
The highlight for error signs. See |g:alesetsigns|.
NOTE: This highlight is only available on Neovim 0.3.2 or higher.
ALEVirtualTextError hl-ALEVirtualTextError
Default: highlight link ALEVirtualTextError Comment
The highlight for virtualtext errors. See |g:alevirtualtextcursor|.
ALEVirtualTextInfo hl-ALEVirtualTextInfo
Default: highlight link ALEVirtualTextInfo ALEVirtualTextWarning
The highlight for virtualtext info. See |g:alevirtualtextcursor|.
ALEVirtualTextStyleError hl-ALEVirtualTextStyleError
Default: highlight link ALEVirtualTextStyleError ALEVirtualTextError
The highlight for virtualtext style errors. See |g:alevirtualtextcursor|.
ALEVirtualTextStyleWarning hl-ALEVirtualTextStyleWarning
Default: highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
The highlight for virtualtext style warnings. See |g:alevirtualtextcursor|.
ALEVirtualTextWarning hl-ALEVirtualTextWarning
Default: highlight link ALEVirtualTextWarning Comment
The highlight for virtualtext errors. See |g:alevirtualtextcursor|.
ALEWarning hl-ALEWarning
Default: highlight link ALEWarning SpellCap
The highlight for highlighted warnings. See |g:alesethighlights|.
ALEWarningLine hl-ALEWarningLine
Default: Undefined
The highlight for entire lines where warnings appear. Only the first line for a problem will be highlighted.
See |g:alesetsigns| and |g:alesethighlights|.
ALEWarningSign hl-ALEWarningSign
Default: highlight link ALEWarningSign todo
The highlight for warning signs. See |g:alesetsigns|.
ALEWarningSignLineNr hl-ALEWarningSignLineNr
Default: highlight link ALEWarningSignLineNr CursorLineNr
The highlight for error signs. See |g:alesetsigns|.
NOTE: This highlight is only available on Neovim 0.3.2 or higher.
- Linter/Fixer Options ale-integration-options
Linter and fixer options are documented below and in individual help files.
Every option for programs can be set globally, or individually for each buffer. For example, |b:alepythonflake8executable| will override any values set for |g:alepythonflake8executable|.
*ale-integrations-local-executables*
Some tools will prefer to search for locally-installed executables, unless
configured otherwise. For example, the eslint linter will search for
various executable paths in node_modules. The flake8 linter will search
for virtualenv directories.
If you prefer to use global executables for those tools, set the relevant
_use_global and _executable options for those linters. >
“ Use the global executable with a special name for eslint. let g:alejavascripteslintexecutable = ‘special-eslint’ let g:alejavascripteslintuse_global = 1
“ Use the global executable with a special name for flake8.
let g:alepythonflake8executable = ‘/foo/bar/flake8’
let g:alepythonflake8useglobal = 1
<
|g:aleuseglobalexecutables| can be set to true or 1 in your init or
vimrc file to make ALE use global executables for all linters by default.
The option |g:alevirtualenvdir_names| controls the local virtualenv paths ALE will use to search for Python executables.
7.1. Options for alex ale-alex-options
The options for alex are shared between all filetypes, so options can be
configured once.
*ale-options.alex_executable*
*g:ale_alex_executable*
*b:ale_alex_executable*
alexexecutable
g:alealex_executable
Type: |String|
Default: 'alex'
See |ale-integrations-local-executables|
*ale-options.alex_use_global*
*g:ale_alex_use_global*
*b:ale_alex_use_global*
alexuseglobal
g:alealexuse_global
Type: |Number|
Default: get(g:, 'ale_use_global_executables', 0)
See |ale-integrations-local-executables|
7.2. Options for cspell ale-cspell-options
The options for cspell are shared between all filetypes, so options can be
configured only once.
*ale-options.cspell_executable*
*g:ale_cspell_executable*
*b:ale_cspell_executable*
cspellexecutable
g:alecspell_executable
Type: |String|
Default: 'cspell'
See |ale-integrations-local-executables|
*ale-options.cspell_options*
*g:ale_cspell_options*
*b:ale_cspell_options*
cspelloptions
g:alecspell_options
Type: |String|
Default: ''
This variable can be set to pass additional options to cspell.
*ale-options.cspell_use_global*
*g:ale_cspell_use_global*
*b:ale_cspell_use_global*
cspelluseglobal
g:alecspelluse_global
Type: |Number|
Default: get(g: 'ale_use_global_executables', 0)
See |ale-integrations-local-executables|
7.3. Options for dprint ale-dprint-options
dprint is a fixer for many file types, including: (java|type)script,
json(c?), markdown, and more. See https://dprint.dev/plugins for an up-to-date
list of supported plugins and their configuration options.
*ale-options.dprint_executable*
*g:ale_dprint_executable*
*b:ale_dprint_executable*
dprintexecutable
g:aledprint_executable
Type: |String|
Default: 'dprint'
See |ale-integrations-local-executables|
*ale-options.dprint_config*
*g:ale_dprint_config*
*b:ale_dprint_config*
dprintconfig
g:aledprint_config
Type: |String|
Default: 'dprint.json'
This variable can be changed to provide a config file to dprint. The
default is the nearest dprint.json searching upward from the current
buffer.
See https://dprint.dev/config and https://plugins.dprint.dev
*ale-options.dprint_options*
*g:ale_dprint_options*
*b:ale_dprint_options*
dprintoptions
g:aledprint_options
Type: |String|
Default: ''
This variable can be set to pass additional options to dprint.
*ale-options.dprint_use_global*
*g:ale_dprint_use_global*
*b:ale_dprint_use_global*
dprintuseglobal
g:aledprintuse_global
Type: |Number|
Default: get(g: 'ale_use_global_executables', 0)
See |ale-integrations-local-executables|
7.4. Options for languagetool ale-languagetool-options
*ale-options.languagetool_executable*
*g:ale_languagetool_executable*
*b:ale_languagetool_executable*
languagetoolexecutable
g:alelanguagetool_executable
Type: |String|
Default: 'languagetool'
The executable to run for languagetool.
*ale-options.languagetool_options*
*g:ale_languagetool_options*
*b:ale_languagetool_options*
languagetooloptions
g:alelanguagetool_options
Type: |String|
Default: '--autoDetect'
This variable can be set to pass additional options to languagetool.
7.5. Options for write-good ale-write-good-options
The options for write-good are shared between all filetypes, so options can
be configured once.
*ale-options.writegood_executable*
*g:ale_writegood_executable*
*b:ale_writegood_executable*
writegoodexecutable
g:alewritegood_executable
Type: |String|
Default: 'writegood'
See |ale-integrations-local-executables|
*ale-options.writegood_options*
*g:ale_writegood_options*
*b:ale_writegood_options*
writegoodoptions
g:alewritegood_options
Type: |String|
Default: ''
This variable can be set to pass additional options to writegood.
*ale-options.writegood_use_global*
*g:ale_writegood_use_global*
*b:ale_writegood_use_global*
writegooduseglobal
g:alewritegooduse_global
Type: |Number|
Default: get(g:, 'ale_use_global_executables', 0)
See |ale-integrations-local-executables|
7.6. Options for redpen ale-redpen-options
The options for redpen are shared between all filetypes, so options can
be configured once.
*ale-options.redpen_options*
*g:ale_redpen_options*
*b:ale_redpen_options*
redpenoptions
g:aleredpen_options
Type: |String|
Default: ''
This variable can be set to pass additional options to redpen.
7.7. Options for vale ale-vale-options
The following options can be used to configure the vale linter for text
files.
g:aletextvaleexecutable *g:aletextvaleexecutable* Type: String Default: ‘vale’
This option controls which executable is used for running Vale. Set it to an absolute path or a different command name if needed.
g:aletextvaleoptions *g:aletextvaleoptions* Type: String Default: ‘‘
Extra command-line options to pass to the Vale executable.
Example:
let g:ale_text_vale_options = '--minAlertLevel=warning'
7.8. Other Linter/Fixer Options ale-other-integration-options
ALE supports a very wide variety of tools. Other linter or fixer options are documented in additional help files.
ada……………………………….|ale-ada-options| cspell…………………………..|ale-ada-cspell| gcc……………………………..|ale-ada-gcc| gnatpp…………………………..|ale-ada-gnatpp| ada-language-server……………….|ale-ada-language-server| ansible……………………………|ale-ansible-options| ansible-language-server……………|ale-ansible-language-server| ansible-lint……………………..|ale-ansible-ansible-lint| apkbuild…………………………..|ale-apkbuild-options| apkbuild-fixer……………………|ale-apkbuild-apkbuild-fixer| apkbuild-lint…………………….|ale-apkbuild-apkbuild-lint| secfixes-check……………………|ale-apkbuild-secfixes-check| asciidoc…………………………..|ale-asciidoc-options| cspell…………………………..|ale-asciidoc-cspell| write-good……………………….|ale-asciidoc-write-good| textlint…………………………|ale-asciidoc-textlint| redpen…………………………..|ale-asciidoc-redpen| asm……………………………….|ale-asm-options| gcc……………………………..|ale-asm-gcc| llvmmc………………………….|ale-asm-llvmmc| astro……………………………..|ale-astro-options| eslint…………………………..|ale-astro-eslint| prettier…………………………|ale-astro-prettier| avra………………………………|ale-avra-options| avra…………………………….|ale-avra-avra| awk……………………………….|ale-awk-options| gawk…………………………….|ale-awk-gawk| bats………………………………|ale-bats-options| shellcheck……………………….|ale-bats-shellcheck| bazel……………………………..|ale-bazel-options| buildifier……………………….|ale-bazel-buildifier| bib……………………………….|ale-bib-options| bibclean…………………………|ale-bib-bibclean| bicep……………………………..|ale-bicep-options| bicep……………………………|ale-bicep-bicep| azbicep…………………………|ale-bicep-azbicep| bindzone…………………………..|ale-bindzone-options| checkzone………………………..|ale-bindzone-checkzone| bitbake……………………………|ale-bitbake-options| oelint-adv……………………….|ale-bitbake-oelintadv| c…………………………………|ale-c-options| astyle…………………………..|ale-c-astyle| cc………………………………|ale-c-cc| ccls…………………………….|ale-c-ccls| clangcheck……………………….|ale-c-clangcheck| clangd…………………………..|ale-c-clangd| clang-format……………………..|ale-c-clangformat| clangtidy………………………..|ale-c-clangtidy| cppcheck…………………………|ale-c-cppcheck| cquery…………………………..|ale-c-cquery| cspell…………………………..|ale-c-cspell| flawfinder……………………….|ale-c-flawfinder| uncrustify……………………….|ale-c-uncrustify| c3………………………………..|ale-c3-options| c3lsp……………………………|ale-c3-c3lsp| cairo……………………………..|ale-cairo-options| scarb……………………………|ale-cairo-scarb| starknet…………………………|ale-cairo-starknet| chef………………………………|ale-chef-options| cookstyle………………………..|ale-chef-cookstyle| foodcritic……………………….|ale-chef-foodcritic| clojure……………………………|ale-clojure-options| clj-kondo………………………..|ale-clojure-clj-kondo| cljfmt…………………………..|ale-clojure-cljfmt| joker……………………………|ale-clojure-joker| cloudformation……………………..|ale-cloudformation-options| cfn-python-lint…………………..|ale-cloudformation-cfn-python-lint| checkov………………………….|ale-cloudformation-checkov| cmake……………………………..|ale-cmake-options| cmakelint………………………..|ale-cmake-cmakelint| cmake-lint……………………….|ale-cmake-cmake-lint| cmake-format……………………..|ale-cmake-cmakeformat| cpp……………………………….|ale-cpp-options| astyle…………………………..|ale-cpp-astyle| cc………………………………|ale-cpp-cc| ccls…………………………….|ale-cpp-ccls| clangcheck……………………….|ale-cpp-clangcheck| clangd…………………………..|ale-cpp-clangd| clang-format……………………..|ale-cpp-clangformat| clangtidy………………………..|ale-cpp-clangtidy| clazy……………………………|ale-cpp-clazy| cppcheck…………………………|ale-cpp-cppcheck| cpplint………………………….|ale-cpp-cpplint| cquery…………………………..|ale-cpp-cquery| cspell…………………………..|ale-cpp-cspell| flawfinder……………………….|ale-cpp-flawfinder| uncrustify……………………….|ale-cpp-uncrustify| c#………………………………..|ale-cs-options| clang-format……………………..|ale-cs-clangformat| csc……………………………..|ale-cs-csc| cspell…………………………..|ale-cs-cspell| dotnet-format…………………….|ale-cs-dotnet-format| mcs……………………………..|ale-cs-mcs| mcsc…………………………….|ale-cs-mcsc| uncrustify……………………….|ale-cs-uncrustify| css……………………………….|ale-css-options| cspell…………………………..|ale-css-cspell| css-beautify……………………..|ale-css-css-beautify| fecs…………………………….|ale-css-fecs| prettier…………………………|ale-css-prettier| stylelint………………………..|ale-css-stylelint| vscodecss………………………..|ale-css-vscode| cuda………………………………|ale-cuda-options| clang-format……………………..|ale-cuda-clangformat| clangd…………………………..|ale-cuda-clangd| nvcc…………………………….|ale-cuda-nvcc| d…………………………………|ale-d-options| dfmt…………………………….|ale-d-dfmt| dls……………………………..|ale-d-dls| uncrustify……………………….|ale-d-uncrustify| dafny……………………………..|ale-dafny-options| dafny……………………………|ale-dafny-dafny| dart………………………………|ale-dart-options| analysisserver…………………..|ale-dart-analysisserver| dart-analyze……………………..|ale-dart-analyze| dart-format………………………|ale-dart-format| dartfmt………………………….|ale-dart-dartfmt| desktop……………………………|ale-desktop-options| desktop-file-validate……………..|ale-desktop-desktop-file-validate| dhall……………………………..|ale-dhall-options| dhall-format……………………..|ale-dhall-format| dhall-freeze……………………..|ale-dhall-freeze| dhall-lint……………………….|ale-dhall-lint| dockerfile…………………………|ale-dockerfile-options| dockerfilelint…………………..|ale-dockerfile-dockerfilelint| dockerlinter……………………..|ale-dockerfile-dockerlinter| dprint…………………………..|ale-dockerfile-dprint| hadolint…………………………|ale-dockerfile-hadolint| elixir…………………………….|ale-elixir-options| mix……………………………..|ale-elixir-mix| mixformat……………………….|ale-elixir-mix-format| dialyxir…………………………|ale-elixir-dialyxir| elixir-ls………………………..|ale-elixir-elixir-ls| credo……………………………|ale-elixir-credo| cspell…………………………..|ale-elixir-cspell| lexical………………………….|ale-elixir-lexical| expert…………………………..|ale-elixir-expert| elm……………………………….|ale-elm-options| elm-format……………………….|ale-elm-elm-format| elm-ls…………………………..|ale-elm-elm-ls| elm-make…………………………|ale-elm-elm-make| erlang…………………………….|ale-erlang-options| dialyzer…………………………|ale-erlang-dialyzer| elvis……………………………|ale-erlang-elvis| erlang-mode………………………|ale-erlang-erlang-mode| erlangls………………………..|ale-erlang-erlangls| erlc…………………………….|ale-erlang-erlc| erlfmt…………………………..|ale-erlang-erlfmt| syntaxerl………………………..|ale-erlang-syntaxerl| eruby……………………………..|ale-eruby-options| erb-formatter…………………….|ale-eruby-erbformatter| erblint………………………….|ale-eruby-erblint| htmlbeautifier……………………|ale-eruby-htmlbeautifier| ruumba…………………………..|ale-eruby-ruumba| fish………………………………|ale-fish-options| fishindent………………………|ale-fish-fishindent| fortran……………………………|ale-fortran-options| fortitude………………………..|ale-fortran-fortitude| gcc……………………………..|ale-fortran-gcc| languageserver…………………..|ale-fortran-language-server| fountain…………………………..|ale-fountain-options| fusionscript……………………….|ale-fuse-options| fusion-lint………………………|ale-fuse-fusionlint| git commit…………………………|ale-gitcommit-options| gitlint………………………….|ale-gitcommit-gitlint| gleam……………………………..|ale-gleam-options| gleamformat……………………..|ale-gleam-gleamformat| gleamlsp…………………………|ale-gleam-gleamlsp| glsl………………………………|ale-glsl-options| glslang………………………….|ale-glsl-glslang| glslls…………………………..|ale-glsl-glslls| go………………………………..|ale-go-options| bingo……………………………|ale-go-bingo| cspell…………………………..|ale-go-cspell| gobuild………………………….|ale-go-gobuild| gofmt……………………………|ale-go-gofmt| gofumpt………………………….|ale-go-gofumpt| goimports………………………..|ale-go-goimports| golangci-lint…………………….|ale-go-golangci-lint| golangserver……………………..|ale-go-golangserver| golines………………………….|ale-go-golines| gopls……………………………|ale-go-gopls| govet……………………………|ale-go-govet| revive…………………………..|ale-go-revive| staticcheck………………………|ale-go-staticcheck| go html template……………………|ale-gohtmltmpl-options| djlint…………………………..|ale-gohtmltmpl-djlint| graphql……………………………|ale-graphql-options| eslint…………………………..|ale-graphql-eslint| gqlint…………………………..|ale-graphql-gqlint| prettier…………………………|ale-graphql-prettier| groovy…………………………….|ale-groovy-options| npm-groovy-lint…………………..|ale-groovy-npm-groovy-lint| hack………………………………|ale-hack-options| hack…………………………….|ale-hack-hack| hackfmt………………………….|ale-hack-hackfmt| hhast……………………………|ale-hack-hhast| handlebars…………………………|ale-handlebars-options| djlint…………………………..|ale-handlebars-djlint| prettier…………………………|ale-handlebars-prettier| ember-template-lint……………….|ale-handlebars-embertemplatelint| haskell……………………………|ale-haskell-options| brittany…………………………|ale-haskell-brittany| cspell…………………………..|ale-haskell-cspell| floskell…………………………|ale-haskell-floskell| ghc……………………………..|ale-haskell-ghc| ghc-mod………………………….|ale-haskell-ghc-mod| cabal-ghc………………………..|ale-haskell-cabal-ghc| hdevtools………………………..|ale-haskell-hdevtools| hfmt…………………………….|ale-haskell-hfmt| hindent………………………….|ale-haskell-hindent| hlint……………………………|ale-haskell-hlint| hls……………………………..|ale-haskell-hls| stack-build………………………|ale-haskell-stack-build| stack-ghc………………………..|ale-haskell-stack-ghc| stylish-haskell…………………..|ale-haskell-stylish-haskell| hie……………………………..|ale-haskell-hie| ormolu…………………………..|ale-haskell-ormolu| fourmolu…………………………|ale-haskell-fourmolu| hcl……………………………….|ale-hcl-options| packer-fmt……………………….|ale-hcl-packer-fmt| terraform-fmt…………………….|ale-hcl-terraform-fmt| help………………………………|ale-help-options| cspell…………………………..|ale-help-cspell| html………………………………|ale-html-options| angular………………………….|ale-html-angular| cspell…………………………..|ale-html-cspell| djlint…………………………..|ale-html-djlint| fecs…………………………….|ale-html-fecs| html-beautify…………………….|ale-html-beautify| htmlhint…………………………|ale-html-htmlhint| prettier…………………………|ale-html-prettier| rustywind………………………..|ale-html-rustywind| stylelint………………………..|ale-html-stylelint| superhtml………………………..|ale-html-superhtml| tidy…………………………….|ale-html-tidy| vscodehtml……………………….|ale-html-vscode| write-good……………………….|ale-html-write-good| html angular template……………….|ale-htmlangular-options| djlint…………………………..|ale-htmlangular-djlint| html django template………………..|ale-htmldjango-options| djlint…………………………..|ale-htmldjango-djlint| http………………………………|ale-http-options| kulalafmt……………………….|ale-http-kulalafmt| hurl………………………………|ale-hurl-options| hurlfmt………………………….|ale-hurl-hurlfmt| idris……………………………..|ale-idris-options| idris……………………………|ale-idris-idris| ink……………………………….|ale-ink-options| ink-language-server……………….|ale-ink-language-server| inko………………………………|ale-inko-options| inko…………………………….|ale-inko-inko| ispc………………………………|ale-ispc-options| ispc…………………………….|ale-ispc-ispc| java………………………………|ale-java-options| checkstyle……………………….|ale-java-checkstyle| clang-format……………………..|ale-java-clangformat| cspell…………………………..|ale-java-cspell| javac……………………………|ale-java-javac| google-java-format………………..|ale-java-google-java-format| pmd……………………………..|ale-java-pmd| javalsp………………………….|ale-java-javalsp| eclipselsp……………………….|ale-java-eclipselsp| uncrustify……………………….|ale-java-uncrustify| javascript…………………………|ale-javascript-options| biome……………………………|ale-javascript-biome| clang-format……………………..|ale-javascript-clangformat| cspell…………………………..|ale-javascript-cspell| deno…………………………….|ale-javascript-deno| dprint…………………………..|ale-javascript-dprint| eslint…………………………..|ale-javascript-eslint| fecs…………………………….|ale-javascript-fecs| flow…………………………….|ale-javascript-flow| importjs…………………………|ale-javascript-importjs| jscs…………………………….|ale-javascript-jscs| jshint…………………………..|ale-javascript-jshint| prettier…………………………|ale-javascript-prettier| prettier-eslint…………………..|ale-javascript-prettier-eslint| prettier-standard…………………|ale-javascript-prettier-standard| standard…………………………|ale-javascript-standard| xo………………………………|ale-javascript-xo| jinja……………………………..|ale-jinja-options| djlint…………………………..|ale-jinja-djlint| j2lint…………………………..|ale-jinja-j2lint| json………………………………|ale-json-options| biome……………………………|ale-json-biome| clang-format……………………..|ale-json-clangformat| cspell…………………………..|ale-json-cspell| dprint…………………………..|ale-json-dprint| eslint…………………………..|ale-json-eslint| fixjson………………………….|ale-json-fixjson| pytool…………………………..|ale-json-pytool| jsonlint…………………………|ale-json-jsonlint| jq………………………………|ale-json-jq| prettier…………………………|ale-json-prettier| spectral…………………………|ale-json-spectral| vscodejson……………………….|ale-json-vscode| json5……………………………..|ale-json5-options| eslint…………………………..|ale-json5-eslint| jsonc……………………………..|ale-jsonc-options| biome……………………………|ale-jsonc-biome| eslint…………………………..|ale-jsonc-eslint| jsonnet……………………………|ale-jsonnet-options| jsonnetfmt……………………….|ale-jsonnet-jsonnetfmt| jsonnet-lint……………………..|ale-jsonnet-jsonnet-lint| julia……………………………..|ale-julia-options| languageserver……………………|ale-julia-languageserver| kotlin…………………………….|ale-kotlin-options| kotlinc………………………….|ale-kotlin-kotlinc| ktlint…………………………..|ale-kotlin-ktlint| languageserver……………………|ale-kotlin-languageserver| latex……………………………..|ale-latex-options| cspell…………………………..|ale-latex-cspell| write-good……………………….|ale-latex-write-good| textlint…………………………|ale-latex-textlint| lean………………………………|ale-lean-options| lake…………………………….|ale-lean-lake| less………………………………|ale-less-options| lessc……………………………|ale-less-lessc| prettier…………………………|ale-less-prettier| stylelint………………………..|ale-less-stylelint| lilypond…………………………..|ale-lilypond-options| lilypond…………………………|ale-lilypond| llvm………………………………|ale-llvm-options| llc……………………………..|ale-llvm-llc| lua……………………………….|ale-lua-options| cspell…………………………..|ale-lua-cspell| lua-format……………………….|ale-lua-lua-format| lua-language-server……………….|ale-lua-lua-language-server| luac…………………………….|ale-lua-luac| luacheck…………………………|ale-lua-luacheck| luafmt…………………………..|ale-lua-luafmt| selene…………………………..|ale-lua-selene| stylua…………………………..|ale-lua-stylua| make………………………………|ale-make-options| checkmake………………………..|ale-make-checkmake| markdown…………………………..|ale-markdown-options| cspell…………………………..|ale-markdown-cspell| dprint…………………………..|ale-markdown-dprint| harper…………………………..|ale-markdown-harper| markdownlint……………………..|ale-markdown-markdownlint| marksman…………………………|ale-markdown-marksman| mdl……………………………..|ale-markdown-mdl| pandoc…………………………..|ale-markdown-pandoc| prettier…………………………|ale-markdown-prettier| pymarkdown……………………….|ale-markdown-pymarkdown| remark-lint………………………|ale-markdown-remark-lint| rumdl……………………………|ale-markdown-rumdl| textlint…………………………|ale-markdown-textlint| write-good……………………….|ale-markdown-write-good| redpen…………………………..|ale-markdown-redpen| mercury……………………………|ale-mercury-options| mmc……………………………..|ale-mercury-mmc| nasm………………………………|ale-nasm-options| nasm…………………………….|ale-nasm-nasm| nickel…………………………….|ale-nickel-options| nickelformat…………………….|ale-nickel-nickel-format| nim……………………………….|ale-nim-options| nimcheck…………………………|ale-nim-nimcheck| nimlsp…………………………..|ale-nim-nimlsp| nimpretty………………………..|ale-nim-nimpretty| nix……………………………….|ale-nix-options| alejandra………………………..|ale-nix-alejandra| nixfmt…………………………..|ale-nix-nixfmt| nixpkgs-fmt………………………|ale-nix-nixpkgs-fmt| statix…………………………..|ale-nix-statix| deadnix………………………….|ale-nix-deadnix| nroff……………………………..|ale-nroff-options| write-good……………………….|ale-nroff-write-good| nunjucks…………………………..|ale-nunjucks-options| djlint…………………………..|ale-nunjucks-djlint| objc………………………………|ale-objc-options| ccls…………………………….|ale-objc-ccls| clang……………………………|ale-objc-clang| clang-format……………………..|ale-objc-clangformat| clangd…………………………..|ale-objc-clangd| uncrustify……………………….|ale-objc-uncrustify| objcpp…………………………….|ale-objcpp-options| clang……………………………|ale-objcpp-clang| clangd…………………………..|ale-objcpp-clangd| uncrustify……………………….|ale-objcpp-uncrustify| ocaml……………………………..|ale-ocaml-options| dune…………………………….|ale-ocaml-dune| merlin…………………………..|ale-ocaml-merlin| ocamllsp…………………………|ale-ocaml-ocamllsp| ols……………………………..|ale-ocaml-ols| ocamlformat………………………|ale-ocaml-ocamlformat| ocp-indent……………………….|ale-ocaml-ocp-indent| odin………………………………|ale-odin-options| ols……………………………..|ale-odin-ols| openapi……………………………|ale-openapi-options| ibmvalidator…………………….|ale-openapi-ibm-validator| prettier…………………………|ale-openapi-prettier| yamllint…………………………|ale-openapi-yamllint| openscad…………………………..|ale-openscad-options| sca2d……………………………|ale-openscad-sca2d| scadformat……………………….|ale-openscad-scadformat| packer…………………………….|ale-packer-options| packer-fmt-fixer………………….|ale-packer-fmt-fixer| pascal…………………………….|ale-pascal-options| ptop…………………………….|ale-pascal-ptop| pawn………………………………|ale-pawn-options| uncrustify……………………….|ale-pawn-uncrustify| perl………………………………|ale-perl-options| perl…………………………….|ale-perl-perl| perl language server………………|ale-perl-languageserver| perlcritic……………………….|ale-perl-perlcritic| perlnavigator…………………….|ale-perl-perlnavigator| perltidy…………………………|ale-perl-perltidy| perl6……………………………..|ale-perl6-options| perl6……………………………|ale-perl6-perl6| php……………………………….|ale-php-options| cspell…………………………..|ale-php-cspell| langserver……………………….|ale-php-langserver| phan…………………………….|ale-php-phan| phpactor…………………………|ale-php-phpactor| phpcbf…………………………..|ale-php-phpcbf| phpcs……………………………|ale-php-phpcs| phpmd……………………………|ale-php-phpmd| phpstan………………………….|ale-php-phpstan| psalm……………………………|ale-php-psalm| php-cs-fixer……………………..|ale-php-php-cs-fixer| php……………………………..|ale-php-php| pint…………………………….|ale-php-pint| tlint……………………………|ale-php-tlint| intelephense……………………..|ale-php-intelephense| po………………………………..|ale-po-options| write-good……………………….|ale-po-write-good| pod……………………………….|ale-pod-options| write-good……………………….|ale-pod-write-good| pony………………………………|ale-pony-options| ponyc……………………………|ale-pony-ponyc| powershell…………………………|ale-powershell-options| cspell…………………………..|ale-powershell-cspell| powershell……………………….|ale-powershell-powershell| psscriptanalyzer………………….|ale-powershell-psscriptanalyzer| prolog…………………………….|ale-prolog-options| swipl……………………………|ale-prolog-swipl| proto……………………………..|ale-proto-options| buf-format……………………….|ale-proto-buf-format| buf-lint…………………………|ale-proto-buf-lint| clang-format……………………..|ale-proto-clangformat| protoc-gen-lint…………………..|ale-proto-protoc-gen-lint| protolint………………………..|ale-proto-protolint| pug……………………………….|ale-pug-options| puglint………………………….|ale-pug-puglint| puppet…………………………….|ale-puppet-options| puppet…………………………..|ale-puppet-puppet| puppetlint……………………….|ale-puppet-puppetlint| puppet-languageserver……………..|ale-puppet-languageserver| purescript…………………………|ale-purescript-options| purescript-language-server…………|ale-purescript-language-server| purs-tidy………………………..|ale-purescript-tidy| purty……………………………|ale-purescript-purty| pyrex (cython)……………………..|ale-pyrex-options| cython…………………………..|ale-pyrex-cython| python…………………………….|ale-python-options| autoflake………………………..|ale-python-autoflake| autoimport……………………….|ale-python-autoimport| autopep8…………………………|ale-python-autopep8| bandit…………………………..|ale-python-bandit| black……………………………|ale-python-black| cspell…………………………..|ale-python-cspell| flake8…………………………..|ale-python-flake8| flakehell………………………..|ale-python-flakehell| isort……………………………|ale-python-isort| mypy…………………………….|ale-python-mypy| prospector……………………….|ale-python-prospector| pycln……………………………|ale-python-pycln| pycodestyle………………………|ale-python-pycodestyle| pydocstyle……………………….|ale-python-pydocstyle| pyflakes…………………………|ale-python-pyflakes| pyflyby………………………….|ale-python-pyflyby| pylama…………………………..|ale-python-pylama| pylint…………………………..|ale-python-pylint| pylsp……………………………|ale-python-pylsp| pyre…………………………….|ale-python-pyre| pyrefly………………………….|ale-python-pyrefly| pyright………………………….|ale-python-pyright| refurb…………………………..|ale-python-refurb| reorder-python-imports…………….|ale-python-reorderpythonimports| ruff…………………………….|ale-python-ruff| ruff-format………………………|ale-python-ruff-format| ty………………………………|ale-python-ty| unimport…………………………|ale-python-unimport| vulture………………………….|ale-python-vulture| yapf…………………………….|ale-python-yapf| qml……………………………….|ale-qml-options| qmlfmt…………………………..|ale-qml-qmlfmt| r…………………………………|ale-r-options| languageserver……………………|ale-r-languageserver| lintr……………………………|ale-r-lintr| styler…………………………..|ale-r-styler| racket…………………………….|ale-racket-options| racketlangserver…………………|ale-racket-langserver| racofmt…………………………|ale-racket-raco-fmt| reasonml…………………………..|ale-reasonml-options| merlin…………………………..|ale-reasonml-merlin| ols……………………………..|ale-reasonml-ols| reason-language-server…………….|ale-reasonml-language-server| refmt……………………………|ale-reasonml-refmt| rego………………………………|ale-rego-options| cspell…………………………..|ale-rego-cspell| opacheck…………………………|ale-rego-opa-check| opafmt…………………………..|ale-rego-opa-fmt-fixer| rescript…………………………..|ale-rescript-options| rescript-language-server…………..|ale-rescript-language-server| rescriptformat…………………..|ale-rescript-format| rest………………………………|ale-rest-options| kulalafmt……………………….|ale-rest-kulalafmt| restructuredtext……………………|ale-restructuredtext-options| cspell…………………………..|ale-restructuredtext-cspell| textlint…………………………|ale-restructuredtext-textlint| write-good……………………….|ale-restructuredtext-write-good| robot……………………………..|ale-robot-options| rflint…………………………..|ale-robot-rflint| roc……………………………….|ale-roc-options| roclanguageserver……………….|ale-roc-roc-language-server| rocformat……………………….|ale-roc-roc-format| rocannotate……………………..|ale-roc-roc-annotate| ruby………………………………|ale-ruby-options| brakeman…………………………|ale-ruby-brakeman| cspell…………………………..|ale-ruby-cspell| debride………………………….|ale-ruby-debride| packwerk…………………………|ale-ruby-packwerk| prettier…………………………|ale-ruby-prettier| railsbestpractices………………|ale-ruby-railsbestpractices| reek…………………………….|ale-ruby-reek| rubocop………………………….|ale-ruby-rubocop| ruby…………………………….|ale-ruby-ruby| rufo…………………………….|ale-ruby-rufo| solargraph……………………….|ale-ruby-solargraph| sorbet…………………………..|ale-ruby-sorbet| standardrb……………………….|ale-ruby-standardrb| syntaxtree………………………|ale-ruby-syntaxtree| rubyfmt………………………….|ale-ruby-rubyfmt| rust………………………………|ale-rust-options| analyzer…………………………|ale-rust-analyzer| cargo……………………………|ale-rust-cargo| cspell…………………………..|ale-rust-cspell| rls……………………………..|ale-rust-rls| rustc……………………………|ale-rust-rustc| rustfmt………………………….|ale-rust-rustfmt| salt………………………………|ale-salt-options| salt-lint………………………..|ale-salt-salt-lint| sass………………………………|ale-sass-options| sasslint…………………………|ale-sass-sasslint| stylelint………………………..|ale-sass-stylelint| scala……………………………..|ale-scala-options| cspell…………………………..|ale-scala-cspell| metals…………………………..|ale-scala-metals| sbtserver………………………..|ale-scala-sbtserver| scalafmt…………………………|ale-scala-scalafmt| scalastyle……………………….|ale-scala-scalastyle| scss………………………………|ale-scss-options| prettier…………………………|ale-scss-prettier| sasslint…………………………|ale-scss-sasslint| stylelint………………………..|ale-scss-stylelint| sh………………………………..|ale-sh-options| bashate………………………….|ale-sh-bashate| cspell…………………………..|ale-sh-cspell| sh-language-server………………..|ale-sh-language-server| shell……………………………|ale-sh-shell| shellcheck……………………….|ale-sh-shellcheck| shfmt……………………………|ale-sh-shfmt| sml……………………………….|ale-sml-options| smlnj……………………………|ale-sml-smlnj| solidity…………………………..|ale-solidity-options| solc…………………………….|ale-solidity-solc| solhint………………………….|ale-solidity-solhint| solium…………………………..|ale-solidity-solium| forge……………………………|ale-solidity-forge| spec………………………………|ale-spec-options| rpmlint………………………….|ale-spec-rpmlint| sql……………………………….|ale-sql-options| dprint…………………………..|ale-sql-dprint| pgformatter………………………|ale-sql-pgformatter| sqlfluff…………………………|ale-sql-sqlfluff| sqlfmt…………………………..|ale-sql-sqlfmt| sqlformat………………………..|ale-sql-sqlformat| stylus…………………………….|ale-stylus-options| stylelint………………………..|ale-stylus-stylelint| sugarss……………………………|ale-sugarss-options| stylelint………………………..|ale-sugarss-stylelint| svelte…………………………….|ale-svelte-options| prettier…………………………|ale-svelte-prettier| svelteserver……………………..|ale-svelte-svelteserver| swift……………………………..|ale-swift-options| apple-swift-format………………..|ale-swift-apple-swift-format| cspell…………………………..|ale-swift-cspell| sourcekitlsp……………………..|ale-swift-sourcekitlsp| systemd……………………………|ale-systemd-options| systemd-analyze…………………..|ale-systemd-analyze| tcl……………………………….|ale-tcl-options| nagelfar…………………………|ale-tcl-nagelfar| terraform………………………….|ale-terraform-options| checkov………………………….|ale-terraform-checkov| terraform-fmt-fixer……………….|ale-terraform-fmt-fixer| terraform………………………..|ale-terraform-terraform| terraform-ls……………………..|ale-terraform-terraform-ls| terraform-lsp…………………….|ale-terraform-terraform-lsp| tflint…………………………..|ale-terraform-tflint| tfsec……………………………|ale-terraform-tfsec| tex……………………………….|ale-tex-options| chktex…………………………..|ale-tex-chktex| cspell…………………………..|ale-tex-cspell| lacheck………………………….|ale-tex-lacheck| latexindent………………………|ale-tex-latexindent| tex-fmt………………………….|ale-tex-tex-fmt| texlab…………………………..|ale-tex-texlab| redpen…………………………..|ale-tex-redpen| texinfo……………………………|ale-texinfo-options| cspell…………………………..|ale-texinfo-cspell| write-good……………………….|ale-texinfo-write-good| text………………………………|ale-text-options| cspell…………………………..|ale-text-cspell| textlint…………………………|ale-text-textlint| write-good……………………….|ale-text-write-good| redpen…………………………..|ale-text-redpen| thrift…………………………….|ale-thrift-options| thrift…………………………..|ale-thrift-thrift| thriftcheck………………………|ale-thrift-thriftcheck| toml………………………………|ale-toml-options| dprint…………………………..|ale-toml-dprint| tombi……………………………|ale-toml-tombi| typescript…………………………|ale-typescript-options| biome……………………………|ale-typescript-biome| cspell…………………………..|ale-typescript-cspell| deno…………………………….|ale-typescript-deno| dprint…………………………..|ale-typescript-dprint| eslint…………………………..|ale-typescript-eslint| prettier…………………………|ale-typescript-prettier| standard…………………………|ale-typescript-standard| tslint…………………………..|ale-typescript-tslint| tsserver…………………………|ale-typescript-tsserver| xo………………………………|ale-typescript-xo| typst……………………………..|ale-typst-options| typstyle…………………………|ale-typst-typstyle| v…………………………………|ale-v-options| v……………………………….|ale-v-v| vfmt…………………………….|ale-v-vfmt| vala………………………………|ale-vala-options| uncrustify……………………….|ale-vala-uncrustify| verilog/systemverilog……………….|ale-verilog-options| hdl-checker………………………|ale-verilog-hdl-checker| iverilog…………………………|ale-verilog-iverilog| slang……………………………|ale-verilog-slang| veriblels……………………….|ale-verilog-verible-ls| veribleformat……………………|ale-verilog-verible-format| verilator………………………..|ale-verilog-verilator| vlog…………………………….|ale-verilog-vlog| xvlog……………………………|ale-verilog-xvlog| yosys……………………………|ale-verilog-yosys| vhdl………………………………|ale-vhdl-options| ghdl…………………………….|ale-vhdl-ghdl| hdl-checker………………………|ale-vhdl-hdl-checker| vcom…………………………….|ale-vhdl-vcom| xvhdl……………………………|ale-vhdl-xvhdl| vim……………………………….|ale-vim-options| vimls……………………………|ale-vim-vimls| vint…………………………….|ale-vim-vint| vim help…………………………..|ale-vim-help-options| write-good……………………….|ale-vim-help-write-good| vue……………………………….|ale-vue-options| cspell…………………………..|ale-vue-cspell| prettier…………………………|ale-vue-prettier| vls……………………………..|ale-vue-vls| volar……………………………|ale-vue-volar| wgsl………………………………|ale-wgsl-options| naga…………………………….|ale-wgsl-naga| xhtml……………………………..|ale-xhtml-options| cspell…………………………..|ale-xhtml-cspell| write-good……………………….|ale-xhtml-write-good| xml……………………………….|ale-xml-options| xmllint………………………….|ale-xml-xmllint| yaml………………………………|ale-yaml-options| actionlint……………………….|ale-yaml-actionlint| circleci…………………………|ale-yaml-circleci| prettier…………………………|ale-yaml-prettier| spectral…………………………|ale-yaml-spectral| swaglint…………………………|ale-yaml-swaglint| yaml-language-server………………|ale-yaml-language-server| yamlfix………………………….|ale-yaml-yamlfix| yamlfmt………………………….|ale-yaml-yamlfmt| yamllint…………………………|ale-yaml-yamllint| gitlablint……………………….|ale-yaml-gitlablint| yq………………………………|ale-yaml-yq| yang………………………………|ale-yang-options| yang-lsp…………………………|ale-yang-lsp| yara………………………………|ale-yara-options| yls……………………………..|ale-yara-yls| zeek………………………………|ale-zeek-options| zeek…………………………….|ale-zeek-zeek| zig……………………………….|ale-zig-options| zigfmt…………………………..|ale-zig-zigfmt| zlint……………………………|ale-zig-zlint| zls……………………………..|ale-zig-zls|
- Commands/Keybinds ale-commands
:ALEComplete :ALEComplete
Manually trigger LSP autocomplete and show the menu. Works only when called from insert mode. >
inoremap <silent> <C-Space> <C-\><C-O>:ALEComplete<CR>
<
A plug mapping <Plug>(ale_complete) is defined for this command. >
imap <C-Space> <Plug>(ale_complete)
<
:ALEDocumentation :ALEDocumentation
Similar to the :ALEHover command, retrieve documentation information for
the symbol at the cursor. Documentation data will always be shown in a
preview window, no matter how small the documentation content is.
NOTE: This command is only available for tsserver.
A plug mapping <Plug>(ale_documentation) is defined for this command.
:ALEFindReferences :ALEFindReferences
Find references in the codebase for the symbol under the cursor using the enabled LSP linters for the buffer. ALE will display a preview window containing the results if some references are found.
The window can be navigated using the usual Vim navigation commands. The
Enter key (t
key can be used to jump to the location in a new tab.
The locations opened in different ways using the following variations.
:ALEFindReferences -tab - Open the location in a new tab.
:ALEFindReferences -split - Open the location in a horizontal split.
:ALEFindReferences -vsplit - Open the location in a vertical split.
:ALEFindReferences -quickfix - Put the locations into quickfix list.
:ALEFindReferences -contents - Show line contents for matches.
:ALEFindReferences -fzf - Show matches/previews using |fzf-vim|.
The default method used for navigating to a new location can be changed by modifying |g:aledefaultnavigation|.
The default behaviour on whether to show line content for matches can be changed by modifying |g:alereferencesshow_contents|.
The default behaviour on whether to use fzf to show matches/file previews
can be changed by modifying |g:alereferencesuse_fzf|. -fzf can be combined
with -tab, -split, -vsplit, -quickfix and -relative, while line
contents/file previews are always shown.
You can add -relative to the command to view results with relatives paths,
instead of absolute paths. This option has no effect if -quickfix is used.
The selection can be opened again with the :ALERepeatSelection command.
You can jump back to the position you were at before going to a reference of something with jump motions like CTRL-O. See |jump-motions|.
A plug mapping <Plug>(ale_find_references) is defined for this command.
You can define additional plug mapping with any additional options you want
like so: >
nnoremap
:ALEFix [linter] :ALEFix
Fix problems with the current buffer. See |ale-fix| for more information.
If the command is run with a bang (:ALEFix!), all warnings will be
suppressed, including warnings about no fixers being defined, and warnings
about not being able to apply fixes to a file because it has been changed.
A plug mapping <Plug>(ale_fix) is defined for this command.
:ALEFixSuggest :ALEFixSuggest
Suggest tools that can be used to fix problems in the current buffer.
See |ale-fix| for more information.
:ALEGoToDefinition [options] :ALEGoToDefinition
Jump to the definition of a symbol under the cursor using the enabled LSP linters for the buffer. ALE will jump to a definition if an LSP server provides a location to jump to. Otherwise, ALE will do nothing.
The locations opened in different ways using the following variations.
:ALEGoToDefinition -tab - Open the location in a new tab.
:ALEGoToDefinition -split - Open the location in a horizontal split.
:ALEGoToDefinition -vsplit - Open the location in a vertical split.
The default method used for navigating to a new location can be changed by modifying |g:aledefaultnavigation|.
You can jump back to the position you were at before going to the definition of something with jump motions like CTRL-O. See |jump-motions|.
You should consider using the ‘hidden’ option in combination with this command. Otherwise, Vim will refuse to leave the buffer you’re jumping from unless you have saved your edits.
The following Plug mappings are defined for this command, which correspond to the following commands.
<Plug>(ale_go_to_definition) - :ALEGoToDefinition
<Plug>(ale_go_to_definition_in_tab) - :ALEGoToDefinition -tab
<Plug>(ale_go_to_definition_in_split) - :ALEGoToDefinition -split
<Plug>(ale_go_to_definition_in_vsplit) - :ALEGoToDefinition -vsplit
:ALEGoToTypeDefinition [options] :ALEGoToTypeDefinition
This works similar to :ALEGoToDefinition but instead jumps to the
definition of a type of a symbol under the cursor. ALE will jump to a
definition if an LSP server provides a location to jump to. Otherwise, ALE
will do nothing.
The locations opened in different ways using the following variations.
:ALEGoToTypeDefinition -tab - Open the location in a new tab.
:ALEGoToTypeDefinition -split - Open the location in a horizontal split.
:ALEGoToTypeDefinition -vsplit - Open the location in a vertical split.
The default method used for navigating to a new location can be changed by modifying |g:aledefaultnavigation|.
You can jump back to the position you were at before going to the definition of something with jump motions like CTRL-O. See |jump-motions|.
The following Plug mappings are defined for this command, which correspond to the following commands.
<Plug>(ale_go_to_type_definition) - :ALEGoToTypeDefinition
<Plug>(ale_go_to_type_definition_in_tab) - :ALEGoToTypeDefinition -tab
<Plug>(ale_go_to_type_definition_in_split) - :ALEGoToTypeDefinition -split
<Plug>(ale_go_to_type_definition_in_vsplit) - :ALEGoToTypeDefinition -vsplit
:ALEGoToImplementation [options] :ALEGoToImplementation
This works similar to :ALEGoToDefinition but instead jumps to the
implementation of symbol under the cursor. ALE will jump to a definition if
an LSP server provides a location to jump to. Otherwise, ALE will do nothing.
The locations opened in different ways using the following variations.
:ALEGoToImplementation -tab - Open the location in a new tab.
:ALEGoToImplementation -split - Open the location in a horizontal split.
:ALEGoToImplementation -vsplit - Open the location in a vertical split.
The default method used for navigating to a new location can be changed by modifying |g:aledefaultnavigation|.
You can jump back to the position you were at before going to the definition of something with jump motions like CTRL-O. See |jump-motions|.
The following Plug mappings are defined for this command, which correspond to the following commands.
<Plug>(ale_go_to_implementation) - :ALEGoToImplementation
<Plug>(ale_go_to_implementation_in_tab) - :ALEGoToImplementation -tab
<Plug>(ale_go_to_implementation_in_split) - :ALEGoToImplementation -split
<Plug>(ale_go_to_implementation_in_vsplit) - :ALEGoToImplementation -vsplit
:ALEHover :ALEHover
Print brief information about the symbol under the cursor, taken from any available LSP linters. There may be a small non-blocking delay before information is printed.
NOTE: In Vim 8, long messages will be shown in a preview window, as Vim 8 does not support showing a prompt to press enter to continue for long messages from asynchronous callbacks.
A plug mapping <Plug>(ale_hover) is defined for this command.
:ALEImport :ALEImport
Try to import a symbol using tsserver or a Language Server.
ALE will look for completions for the word at the cursor which contain additional text edits that possible insert lines to import the symbol. The first match with additional text edits will be used, and may add other code to the current buffer other than import lines.
If linting is enabled, and |g:alelintontextchanged| is set to ever check buffers when text is changed, the buffer will be checked again after changes are made.
A Plug mapping <Plug>(ale_import) is defined for this command. This
mapping should only be bound for normal mode.
:ALEOrganizeImports :ALEOrganizeImports
Organize imports using tsserver. Currently not implemented for LSPs.
:ALERename :ALERename
Rename a symbol using tsserver or a Language Server.
The symbol where the cursor is resting will be the symbol renamed, and a prompt will open to request a new name.
The rename operation will not save modified buffers when ‘hidden’ is on
unless |g:alesavehidden| is true or 1.
:ALEFileRename :ALEFileRename
Rename a file and fix imports using tsserver.
:ALECodeAction :ALECodeAction
Apply a code action via LSP servers or tsserver.
If there is an error present on a line that can be fixed, ALE will automatically fix a line, unless there are multiple possible code fixes to apply.
This command can be run in visual mode apply actions, such as applicable refactors. A menu will be shown to select code action to apply.
:ALERepeatSelection :ALERepeatSelection
Repeat the last selection displayed in the preview window.
:ALESymbolSearch [query] :ALESymbolSearch
Search for symbols in the workspace, taken from any available LSP linters.
The arguments provided to this command will be used as a search query for finding symbols in the workspace, such as functions, types, etc.
You can add -relative to the command to view results with relatives paths,
instead of absolute paths.
:ALELint :ALELint
Run ALE once for the current buffer. This command can be used to run ALE manually, instead of automatically, if desired.
This command will also run linters where lint_file is evaluates to 1,
meaning linters which check the file instead of the Vim buffer.
A plug mapping <Plug>(ale_lint) is defined for this command.
:ALELintStop :ALELintStop
Stop any currently running jobs for checking the current buffer.
Any problems from previous linter results will continue to be shown.
:ALEPopulateQuickfix :ALEPopulateQuickfix :ALEPopulateLocList :ALEPopulateLocList
Manually populate the |quickfix| or |location-list| and show the corresponding list. Useful when you have other uses for both the |quickfix| and |location-list| and don’t want them automatically populated. Be sure to disable auto populating: >
let g:ale_set_quickfix = 0
let g:ale_set_loclist = 0
< With these settings, ALE will still run checking and display it with signs, highlighting, and other output described in |ale-lint-file-linters|.
:ALEPrevious :ALEPrevious :ALEPreviousWrap :ALEPreviousWrap :ALENext :ALENext :ALENextWrap :ALENextWrap :ALEFirst :ALEFirst :ALELast :ALELast ale-navigation-commands
Move between warnings or errors in a buffer. ALE will only navigate between
the errors or warnings it generated, even if both |g:alesetquickfix|
and |g:alesetloclist| are set to 0.
:ALEPrevious and :ALENext will stop at the top and bottom of a file, while
:ALEPreviousWrap and :ALENextWrap will wrap around the file to find
the last or first warning or error in the file, respectively.
:ALEPrevious and :ALENext take optional flags arguments to custom their
behavior :
-wrap enable wrapping around the file
-error, -warning and -info enable jumping to errors, warnings or infos
respectively, ignoring anything else. They are mutually exclusive and if
several are provided the priority is the following: error > warning > info.
-style and -nostyle allow you to jump respectively to style error or
warning and to not style error or warning. They also are mutually
exclusive and nostyle has priority over style.
Flags can be combined to create create custom jumping. Thus you can use “:ALENext -wrap -error -nosyle” to jump to the next error which is not a style error while going back to the beginning of the file if needed.
:ALEFirst goes to the first error or warning in the buffer, while :ALELast
goes to the last one.
The following |
“ Map movement through errors without wrapping.
nmap
:ALEToggle :ALEToggle :ALEEnable :ALEEnable :ALEDisable :ALEDisable :ALEToggleBuffer :ALEToggleBuffer :ALEEnableBuffer :ALEEnableBuffer :ALEDisableBuffer :ALEDisableBuffer
:ALEToggle, :ALEEnable, and :ALEDisable enable or disable ALE linting,
including all of its autocmd events, loclist items, quickfix items, signs,
current jobs, etc., globally. Executing any of these commands will change
the |g:ale_enabled| variable.
ALE can be disabled or enabled for only a single buffer with
:ALEToggleBuffer, :ALEEnableBuffer, and :ALEDisableBuffer. Disabling ALE
for a buffer will not remove autocmd events, but will prevent ALE from
checking for problems and reporting problems for whatever buffer the
:ALEDisableBuffer or :ALEToggleBuffer command is executed from. These
commands can be used for temporarily disabling ALE for a buffer. These
commands will modify the |b:ale_enabled| variable.
ALE linting cannot be enabled for a single buffer when it is disabled globally, as disabling ALE globally removes the autocmd events needed to perform linting with.
The following plug mappings are defined, for conveniently defining keybinds:
:ALEToggle - <Plug>(ale_toggle)
:ALEEnable - <Plug>(ale_enable)
:ALEDisable - <Plug>(ale_disable)
:ALEToggleBuffer - <Plug>(ale_toggle_buffer)
:ALEEnableBuffer - <Plug>(ale_enable_buffer)
:ALEDisableBuffer - <Plug>(ale_disable_buffer)
For removing problems reported by ALE, but leaving ALE enabled, see
:ALEReset and :ALEResetBuffer.
:ALEDetail :ALEDetail
Show the full linter message for the problem nearest to the cursor on the
given line in the preview window. The preview window can be easily closed
with the q key. If there is no message to show, the window will not be
opened.
If a loclist item has a detail key set, the message for that key will be
preferred over text. See |ale-loclist-format|.
A plug mapping <Plug>(ale_detail) is defined for this command.
:ALEInfo :ALEInfo :ALEInfoToFile
Print runtime information about ALE, including the values of global and buffer-local settings for ALE, the linters that are enabled, the commands that have been run, and the output of commands.
ALE will log the commands that are run by default. If you wish to disable
this, set |g:alehistoryenabled| to 0. Because it could be expensive, ALE
does not remember the output of recent commands by default. Set
|g:alehistorylog_output| to 1 to enable logging of output for commands.
ALE will only log the output captured for parsing problems, etc.
You can pass options to the command to control how ALE displays the
information, such as :ALEInfo -echo, etc. >
-preview Show the info in a preview window. -clip OR -clipboard Copy the information to your clipboard. -echo echo all of the information with :echo < The default mode can be configured with |g:aleinfodefault_mode|.
When shown in a preview window, syntax highlights can be defined for the
ale-info filetype.
:ALEInfoToFile will write the ALE runtime information to a given filename.
The filename works just like :write.
:ALEReset :ALEReset :ALEResetBuffer :ALEResetBuffer
:ALEReset will remove all problems reported by ALE for all buffers.
:ALEResetBuffer will remove all problems reported for a single buffer.
Either command will leave ALE linting enabled, so ALE will report problems when linting is performed again. See |ale-lint| for more information.
The following plug mappings are defined, for conveniently defining keybinds:
:ALEReset - <Plug>(ale_reset)
:ALEResetBuffer - <Plug>(ale_reset_buffer)
ALE can be disabled globally or for a buffer with :ALEDisable or
:ALEDisableBuffer.
:ALEStopAllLSPs :ALEStopAllLSPs
:ALEStopAllLSPs will close and stop all channels and jobs for all LSP-like
clients, including tsserver, remove all of the data stored for them, and
delete all of the problems found for them, updating every linted buffer.
This command can be used when LSP clients mess up and need to be restarted.
:ALEStopLSP [linter] :ALEStopLSP
:ALEStopLSP will stop a specific language server with a given linter name.
Completion is supported for currently running language servers. All language
servers with the given name will be stopped across all buffers for all
projects.
If the command is run with a bang (:ALEStopLSP!), all warnings will be
suppressed.
- API ale-api
ALE offers a number of functions for running linters or fixers, or defining
them. The following functions are part of the publicly documented part of that
API, and should be expected to continue to work. Functions documented with
Vim autocmd names ale#Foo are available in the Vim context, and functions
documented with dot names ale.foo are available in Lua scripts.
ale.env(variablename, value) ale.env() ale#Env(variablename, value) ale#Env()
Given a variable name and a string value, produce a string for including in a command for setting environment variables. This function can be used for building a command like so. >
:echo string(ale#Env('VAR', 'some value') . 'command')
'VAR=''some value'' command' # On Linux or Mac OSX
'set VAR="some value" && command' # On Windows
ale.escape(str) ale.escape() ale#Escape(str) ale#Escape()
Given a string, escape that string so it is ready for shell execution.
If the shell is detected to be cmd.exe, ALE will apply its own escaping
that tries to avoid escaping strings unless absolutely necessary to avoid
issues with Windows programs that do not properly handle quoted arguments.
In all other cases, ALE will call |shellescape|.
ale.getfilenamemappings(buffer, name) ale.getfilenamemappings() ale#GetFilenameMappings(buffer, name) ale#GetFilenameMappings()
Given a buffer and the name of either a linter for fixer, return a
|List| of two-item |List|s that describe mapping to and from the local and
foreign file systems for running a particular linter or fixer.
See |g:alefilenamemappings| for details on filename mapping.
ale.has(feature) ale.has() ale#Has(feature) ale#Has()
In Vim, ale#Has returns 1 if ALE supports a given feature, like |has()|
for Vim features. In Lua ale.has returns true instead, and false if a
feature is not supported.
ALE versions can be checked with version strings in the format
ale#Has('ale-x.y.z'), such as ale#Has('ale-2.4.0').
ale.pad(str) ale.pad() ale#Pad(str) ale#Pad()
Given a string or any |empty()| value, return either the string prefixed with a single space, or an empty string. This function can be used to build parts of a command from variables.
ale.queue(delay, [lintingflag, buffer]) ale.queue() ale#Queue(delay, [lintingflag, buffer]) ale#Queue()
Run linters for the current buffer, based on the filetype of the buffer,
with a given delay. A delay of 0 will run the linters immediately.
The linters will always be run in the background. Calling this function
several times will reset an internal timer so ALE doesn’t check buffers too
often.
An optional linting_flag argument can be given. If linting_flag is
'lint_file', then linters where the lint_file option evaluates to 1
will be run. Otherwise, those linters will not be run.
An optional buffer argument can be given for specifying the buffer to
check. The active buffer (bufnr('')) will be checked by default.
*ale-cool-down*
If an exception is thrown when queuing/running ALE linters, ALE will enter a cool down period where it will stop checking anything for a short period of time. This is to prevent ALE from seriously annoying users if a linter is broken, or when developing ALE itself.
ale.setup(config) ale.setup()
Configure ALE global settings, which are documented in |ale-options|. For example: >
require("ale").setup({
completion_enabled = true,
maximum_file_size = 1024 * 1024,
warn_about_trailing_whitespace = false,
})
<
You can also call this function with ale.setup.global to make what context
ALE is being configured in less ambiguous if you like.
ale.setup.buffer(config) ale.setup.buffer()
Configure ALE buffer-local settings, which are documented in |ale-options|. For example: > require(“ale”).setup.buffer({ linters = {"ruff”, “pyright”}, fixers = {"ruff”} }) <
ale.var(buffer, variablename) ale.var() ale#Var(buffer, variablename) ale#Var()
Given a buffer number and an ALE variable name return the value of that
if defined in the buffer, and if not defined in the buffer return the
global value. The ale_ prefix will be added to the Vim variable name.
The ale#Var Vim function will return errors if the variable is not defined
in either the buffer or globally. The ale.var Lua function will return
nil if the variable is not defined in either the buffer or globally.
ale#command#CreateDirectory(buffer) ale#command#CreateDirectory()
Create a new temporary directory with a unique name, and manage that directory with |ale#command#ManageDirectory()|, so it will be removed as soon as possible.
It is advised to only call this function from a callback function for returning a linter command to run.
ale#command#CreateFile(buffer) ale#command#CreateFile()
Create a new temporary file with a unique name, and manage that file with |ale#command#ManageFile()|, so it will be removed as soon as possible.
It is advised to only call this function from a callback function for returning a linter command to run.
ale#command#Run(buffer, command, callback, [options]) ale#command#Run()
Start running a job in the background, and pass the results to the given callback later.
This function can be used for computing the results of ALE linter or fixer
functions asynchronously with jobs. buffer must match the buffer being
linted or fixed, command must be a |String| for a shell command to
execute, callback must be defined as a |Funcref| to call later with the
results, and an optional |Dictionary| of options can be provided.
The callback will receive the arguments (buffer, output, metadata),
where the buffer will match the buffer given to the function, the output
will be a List of lines of output from the job that was run, and the
metadata will be a |Dictionary| with additional information about the job
that was run, including:
`exit_code` - A |Number| with the exit code for the program that was run.
The result of this function is either a special |Dictionary| ALE will use
for waiting for the command to finish, or 0 if the job is not started. The
The return value of the callback will be used as the eventual result for
whatever value is being given to ALE. For example: >
function! s:GetCommand(buffer, output, meta) abort
" Do something with a:output here, from the foo command.
" This is used as the command to run for linting.
return 'final command'
endfunction
" ...
'command': {b -> ale#command#Run(b, 'foo', function('s:GetCommand'))}
< The result of a callback can also be the result of another call to this function, so that several commands can be arbitrarily chained together. For example: >
function! s:GetAnotherCommand(buffer, output, meta) abort
" We can finally return this command.
return 'last command'
endfunction
function! s:GetCommand(buffer, output, meta) abort
" We can return another deferred result.
return ale#command#Run(
\ a:buffer,
\ 'second command',
\ function('s:GetAnotherCommand')
\)
endfunction
" ...
'command': {b -> ale#command#Run(b, 'foo', function('s:GetCommand'))}
<
The following options can be provided.
`cwd` - An optional |String| for setting the working directory
for the command, just as per |ale#linter#Define|.
If not set, or `v:null`, the `cwd` of the last command
that spawned this one will be used.
`output_stream` - Either `'stdout'`, `'stderr'`, `'both'`, or
`'none`' for selecting which output streams to read
lines from.
The default is `'stdout'`
`executable` - An executable for formatting into `%e` in the
command. If this option is not provided, formatting
commands with `%e` will not work.
`read_buffer` - If set to `1`, the buffer will be piped into the
command.
The default is `0`.
`input` - When creating temporary files with `%t` or piping
text into a command `input` can be set to a |List| of
text to use instead of the buffer's text.
`filename_mappings` - A |List| of two-item |List|s describing filename
mappings to apply for formatted filenames in the
command string, as per |g:ale_filename_mappings|.
If the call to this function is being used for a
linter or fixer, the mappings should be provided with
this option, and can be retrieved easily with
|ale#GetFilenameMappings()|.
The default is `[]`.
ale#command#EscapeCommandPart(command_part) ale#command#EscapeCommandPart()
Given a |String|, return a |String| with all % characters replaced with
%% instead. This function can be used to escape strings which are
dynamically generated for commands before handing them over to ALE,
so that ALE doesn’t treat any strings with % formatting sequences
specially.
ale#command#ManageDirectory(buffer, directory) ale#command#ManageDirectory()
Like |ale#command#ManageFile()|, but directories and all of their contents
will be deleted, akin to rm -rf directory, which could lead to loss of
data if mistakes are made. This command will also delete any temporary
filenames given to it.
It is advised to use |ale#command#ManageFile()| instead for deleting single files.
ale#command#ManageFile(buffer, filename) ale#command#ManageFile()
Given a buffer number for a buffer currently running some linting or fixing tasks and a filename, register a filename with ALE for automatic deletion after linting or fixing is complete, or when Vim exits.
If Vim exits suddenly, ALE will try its best to remove temporary files, but ALE cannot guarantee with absolute certainty that the files will be removed. It is advised to create temporary files in the operating system’s managed temporary file directory, such as with |tempname()|.
Directory names should not be given to this function. ALE will only delete
files and symlinks given to this function. This is to prevent entire
directories from being accidentally deleted, say in cases of writing
dir . '/' . filename where filename is actually '', etc. ALE instead
manages directories separately with the |ale#command#ManageDirectory| function.
ale#completion#OmniFunc(findstart, base) ale#completion#OmniFunc()
A completion function to use with ‘omnifunc’.
See |ale-completion|.
ale#engine#GetLoclist(buffer) ale#engine#GetLoclist()
Given a buffer number, this function will return the list of problems reported by ALE for a given buffer in the format accepted by |setqflist()|.
A reference to the buffer’s list of problems will be returned. The list must be copied before applying |map()| or |filter()|.
ale#engine#IsCheckingBuffer(buffer) ale#engine#IsCheckingBuffer()
Given a buffer number, returns 1 when ALE is busy checking that buffer.
This function can be used for status lines, tab names, etc.
*ale#fix#registry#Add()*
ale#fix#registry#Add(name, func, filetypes, desc, [aliases])
Given a |String| name for a name to add to the registry, a |String| func
for a function name, a |List| filetypes for a list of filetypes to
set for suggestions, and a |String| desc for a short description of
the fixer, register a fixer in the registry.
The name can then be used for |g:ale_fixers| in place of the function
name, and suggested for fixing files.
An optional |List| of |String|s for aliases can be passed as the aliases
argument. These aliases can also be used for looking up a fixer function.
ALE will search for fixers in the registry first by name, then by their
aliases.
For example to register a custom fixer for luafmt: >
function! FormatLua(buffer) abort return { \ ‘command’: ‘luafmt –stdin’ } endfunction
execute ale#fix#registry#Add(‘luafmt’, ‘FormatLua’, [‘lua’], ‘luafmt for lua’)
“ You can now use it in g:alefixers let g:alefixers = { \ ‘lua’: [‘luafmt’] } <
ale#linter#Define(filetype, linter) ale#linter#Define()
Given a |String| for a filetype and a |Dictionary| Describing a linter configuration, add a linter for the given filetype. The dictionaries each offer the following options:
name The name of the linter. These names will be used by
|g:ale_linters| option for enabling/disabling
particular linters.
This argument is required.
callback A |String| or |Funcref| for a callback function
accepting two arguments (buffer, lines), for a
buffer number the output is for, and the lines of
output from a linter.
This callback function should return a |List| of
|Dictionary| objects in the format accepted by
|setqflist()|. The |List| will be sorted by line and
then column order so it can be searched with a binary
search by in future before being passed on to the
|location-list|, etc.
This argument is required, unless the linter is an
LSP linter. In which case, this argument must not be
defined, as LSP linters handle diagnostics
automatically. See |ale-lsp-linters|.
If the function named does not exist, including if
the function is later deleted, ALE will behave as if
the callback returned an empty list.
The keys for each item in the List will be handled in
the following manner:
*ale-loclist-format*
`text` - This error message is required.
`detail` - An optional, more descriptive message.
This message can be displayed with the `:ALEDetail`
command instead of the message for `text`, if set.
`lnum` - The line number is required. Any strings
will be automatically converted to numbers by
using |str2nr()|.
Line 0 will be moved to line 1, and lines beyond
the end of the file will be moved to the end.
`col` - The column number is optional and will
default to `0`. Any strings will be automatically
converted to number using |str2nr()|.
`end_col` - An optional end column number.
This key can be set to specify the column problems
end on, for improved highlighting.
`end_lnum` - An optional end line number.
This key can set along with `end_col` for
highlighting multi-line problems.
`bufnr` - This key represents the buffer number the
problems are for. This value will default to
the buffer number being checked.
The `filename` key can be set instead of this key,
and then the eventual `bufnr` value in the final
list will either represent the number for an open
buffer or `-1` for a file not open in any buffer.
`filename` - An optional filename for the file the
problems are for. This should be an absolute path to
a file.
Problems for files which have not yet been opened
will be set in those files after they are opened
and have been checked at least once.
Temporary files in directories used for Vim
temporary files with |tempname()| will be assumed
to be the buffer being checked, unless the `bufnr`
key is also set with a valid number for some other
buffer.
`vcol` - Defaults to `0`.
If set to `1`, ALE will convert virtual column
positions for `col` and `end_col` to byte column
positions. If the buffer is changed in-between
checking it and displaying the results, the
calculated byte column positions will probably be
wrong.
`type` - Defaults to `'E'`.
`nr` - Defaults to `-1`.
Numeric error code. If `nr` is not `-1`, `code`
likely should contain the string representation of
the same value.
`code` - No default; may be unset.
Human-readable |String| error code.
executable A |String| naming the executable itself which
will be run, or a |Funcref| for a function to call
for computing the executable, accepting a buffer
number.
The result can be computed with |ale#command#Run()|.
This value will be used to check if the program
requested is installed or not.
If an `executable` is not defined, the command will
be run without checking if a program is executable
first. Defining an executable path is recommended to
avoid starting too many processes.
command A |String| for a command to run asynchronously, or a
|Funcref| for a function to call for computing the
command, accepting a buffer number.
The result can be computed with |ale#command#Run()|.
The command string can be formatted with format
markers. See |ale-command-format-strings|.
This command will be fed the lines from the buffer to
check, and will produce the lines of output given to
the `callback`.
cwd An optional |String| for setting the working
directory for the command, or a |Funcref| for a
function to call for computing the command, accepting
a buffer number. The working directory can be
specified as a format string for determining the path
dynamically. See |ale-command-format-strings|.
To set the working directory to the directory
containing the file you're checking, you should
probably use `'%s:h'` as the option value.
If this option is absent or the string is empty, the
`command` will be run with no determined working
directory in particular.
The directory specified with this option will be used
as the default working directory for all commands run
in a chain with |ale#command#Run()|, unless otherwise
specified.
output_stream A |String| for the output stream the lines of output
should be read from for the command which is run. The
accepted values are 'stdout', 'stderr', and
'both'. This argument defaults to 'stdout'. This
argument can be set for linter programs which output
their errors and warnings to the stderr stream
instead of stdout. The option 'both' will read
from both stder and stdout at the same time.
read_buffer A |Number| (0 or 1) indicating whether a command
should read the Vim buffer as input via stdin. This
option is set to 1 by default, and can be disabled
if a command manually reads from a temporary file
instead, etc.
This option behaves as if it was set to `0` when the
`lint_file` option evaluates to `1`.
*ale-lint-file*
lint_file A |Number| (0 or 1), or a |Funcref| for a function
accepting a buffer number for computing either 0 or
1, indicating whether a command should read the file
instead of the Vim buffer. This option can be used
for linters which must check the file on disk, and
which cannot check a Vim buffer instead.
The result can be computed with |ale#command#Run()|.
Linters where the eventual value of this option
evaluates to `1` will not be run as a user types, per
|g:ale_lint_on_text_changed|. Linters will instead be
run only when events occur against the file on disk,
including |g:ale_lint_on_enter| and
|g:ale_lint_on_save|. Linters where this option
evaluates to `1` will also be run when the `:ALELint`
command is run.
When this option is evaluates to `1`, ALE will behave
as if `read_buffer` was set to `0`.
*ale-lsp-linters*
lsp A |String| for defining LSP (Language Server Protocol)
linters.
This argument may be omitted or `''` when a linter
does not represent an LSP linter.
When this argument is set to `'stdio'`, then the
linter will be defined as an LSP linter which keeps a
process for a language server running, and
communicates with it directly via a |channel|.
`executable` and `command` must be set.
When this argument is set to `'socket'`, then the
linter will be defined as an LSP linter via a TCP
or named pipe socket connection. `address` must be set.
ALE will not start a server automatically.
When this argument is not empty `project_root` must
be defined.
`language` can be defined to describe the language
for a file. The filetype will be used as the language
by default.
LSP linters handle diagnostics automatically, so
the `callback` argument must not be defined.
An optional `completion_filter` callback may be
defined for filtering completion results.
`initialization_options` may be defined to pass
initialization options to the LSP.
`lsp_config` may be defined to pass configuration
settings to the LSP.
address A |String| representing an address to connect to,
or a |Funcref| accepting a buffer number and
returning the |String|. If the value contains a
colon, it is interpreted as referring to a TCP
socket; otherwise it is interpreted as the path of a
named pipe.
The result can be computed with |ale#command#Run()|.
This argument must only be set if the `lsp` argument
is set to `'socket'`.
project_root A |String| representing a path to the project for
the file being checked with the language server, or
a |Funcref| accepting a buffer number and returning
the |String|.
If an empty string is returned, the file will not be
checked at all.
This argument must only be set if the `lsp` argument
is also set to a non-empty string.
language A |String| representing the name of the language
being checked, or a |Funcref| accepting a buffer
number and returning the |String|. This string will
be sent to the LSP to tell it what type of language
is being checked.
If a language isn't provided, the language will
default to the value of the filetype given to
|ale#linter#Define|.
completion_filter A |String| or |Funcref| for a callback function
accepting a buffer number and a completion item.
The completion item will be a |Dictionary| following
the Language Server Protocol `CompletionItem`
interface as described in the specification,
available online here:
https://microsoft.github.io/language-server-protocol
aliases A |List| of aliases for the linter name.
This argument can be set with alternative names for
selecting the linter with |g:ale_linters|. This
setting can make it easier to guess the linter name
by offering a few alternatives.
initialization_options A |Dictionary| of initialization options for LSPs,
or a |Funcref| for a callback function accepting
a buffer number and returning the |Dictionary|.
This will be fed (as JSON) to the LSP in the
initialize command.
lsp_config A |Dictionary| for configuring a language server,
or a |Funcref| for a callback function accepting
a buffer number and returning the |Dictionary|.
This will be fed (as JSON) to the LSP in the
workspace/didChangeConfiguration command.
If temporary files or directories are created for commands run with
command, then these temporary files or directories can be managed by ALE,
for automatic deletion. See |ale#command#ManageFile()| and
|ale#command#ManageDirectory| for more information.
*ale-command-format-strings*
All command strings will be formatted for special character sequences.
Any substring %s will be replaced with the full path to the current file
being edited. This format option can be used to pass the exact filename
being edited to a program.
For example: >
‘command’: ‘eslint -f unix –stdin –stdin-filename %s’
<
Any substring %t will be replaced with a path to a temporary file. Merely
adding %t will cause ALE to create a temporary file containing the
contents of the buffer being checked. All occurrences of %t in command
strings will reference the one temporary file. The temporary file will be
created inside a temporary directory, and the entire temporary directory
will be automatically deleted, following the behavior of
|ale#command#ManageDirectory|. This option can be used for some linters which
do not support reading from stdin.
For example: >
‘command’: ‘ghc -fno-code -v0 %t’,
<
Any substring %e will be replaced with the escaped executable supplied
with executable. This provides a convenient way to define a command string
which needs to include a dynamic executable name, but which is otherwise
static.
For example: >
‘command’: ‘%e –some-argument’,
<
The character sequence %% can be used to emit a literal % into a
command, so literal character sequences %s and %t can be escaped by
using %%s and %%t instead, etc.
Some |filename-modifiers| can be applied to %s and %t. Only :h, :t,
:r, and :e may be applied, other modifiers will be ignored. Filename
modifiers can be applied to the format markers by placing them after them.
For example: >
‘command’: ‘%s:h %s:e %s:h:t’,
<
Given a path /foo/baz/bar.txt, the above command string will generate
something akin to '/foo/baz' 'txt' 'baz'
If a callback for a command generates part of a command string which might
possibly contain %%, %s, %t, or %e, where the special formatting
behavior is not desired, the |ale#command#EscapeCommandPart()| function can
be used to replace those characters to avoid formatting issues.
*ale-linter-loading-behavior*
Linters for ALE will be loaded by searching |runtimepath| in the following format: >
alelinters/. characters will be split into individual parts, and files
will be loaded for each filetype between the . characters.
Linters can be defined from vimrc and other files as long as this function is loaded first. For example, the following code will define a Hello World linter in vimrc in Vim 8: >
“ Plugins have to be loaded first. “ If you are using a plugin manager, run that first. packloadall
call ale#linter#Define(‘vim’, { \ ‘name’: ‘echo-test’, \ ‘executable’: ‘echo’, \ ‘command’: ‘echo hello world’, \ ‘callback’: {buffer, lines -> map(lines, ‘{"text”: v:val, “lnum”: 1}’)}, }) <
ale#linter#Get(filetype) ale#linter#Get()
Return all of linters configured for a given filetype as a |List| of |Dictionary| values in the format specified by |ale#linter#Define()|.
Filetypes may be dot-separated to invoke linters for multiple filetypes:
for instance, the filetype javascript.jsx will return linters for both the
javascript and jsx filetype.
Aliases may be defined in as described in |g:alelinteraliases|. Aliases are applied after dot-separated filetypes are broken up into their components.
ale#linter#PreventLoading(filetype) ale#linter#PreventLoading()
Given a filetype, prevent any more linters from being loaded from
|runtimepath| for that filetype. This function can be called from vimrc or
similar to prevent ALE from loading linters.
*ale#lsp_linter#SendRequest()*
ale#lsplinter#SendRequest(buffer, lintername, message, [Handler])
Send a custom request to an LSP linter. The arguments are defined as follows:
buffer A valid buffer number.
linter_name A |String| identifying an LSP linter that is available and
enabled for the |filetype| of buffer.
message A |List| in the form [is_notification, method, parameters],
containing three elements:
is_notification - an |Integer| that has value 1 if the
request is a notification, 0 otherwise;
method - a |String|, identifying an LSP method supported
by linter;
parameters - a |dictionary| of LSP parameters that are
applicable to method.
Handler Optional argument, meaningful only when message[0] is 0.
A |Funcref| that is called when a response to the request is
received, and takes as unique argument a dictionary
representing the response obtained from the server.
*ale#other_source#ShowResults()*
ale#othersource#ShowResults(buffer, lintername, loclist)
Show results from another source of information.
buffer must be a valid buffer number, and linter_name must be a unique
name for identifying another source of information. The loclist given
where the problems in a buffer are, and should be provided in the format ALE
uses for regular linter results. See |ale-loclist-format|.
*ale#other_source#StartChecking()*
ale#othersource#StartChecking(buffer, lintername)
Tell ALE that another source of information has started checking a buffer.
buffer must be a valid buffer number, and linter_name must be a unique
name for identifying another source of information.
ale#statusline#Count(buffer) ale#statusline#Count()
Given the number of a buffer which may have problems, return a |Dictionary| containing information about the number of problems detected by ALE. The following keys are supported:
error -> The number of problems with type E and sub_type != 'style'
warning -> The number of problems with type W and sub_type != 'style'
info -> The number of problems with type I
style_error -> The number of problems with type E and sub_type == 'style'
style_warning -> The number of problems with type W and sub_type == 'style'
total -> The total number of problems.
ale#statusline#FirstProblem(buffer, type) ale#statusline#FirstProblem()
Returns a copy of the first entry in the loclist that matches the supplied
buffer number and problem type. If there is no such entry, an empty dictionary
is returned.
Problem type should be one of the strings listed below:
error -> Returns the first loclist item with type E and
sub_type != 'style'
warning -> First item with type W and sub_type != 'style'
info -> First item with type I
style_error -> First item with type E and sub_type == 'style'
style_warning -> First item with type W and sub_type == 'style'
b:alelinted *b:alelinted*
b:ale_linted is set to the number of times a buffer has been checked by
ALE after all linters for one lint cycle have finished checking a buffer.
This variable may not be defined until ALE first checks a buffer, so it
should be accessed with |get()| or |getbufvar()|. For example: >
" Print a message indicating how many times ALE has checked this buffer.
echo 'ALE has checked this buffer ' . get(b:, 'ale_linted') . ' time(s).'
" Print 'checked' using getbufvar() if a buffer has been checked.
echo getbufvar(bufnr(''), 'ale_linted', 0) > 0 ? 'checked' : 'not checked'
<
g:alewantresultsbuffer *g:alewantresultsbuffer*
g:ale_want_results_buffer is set to the number of the buffer being checked
when the |ALEWantResults| event is signaled. This variable should be read to
figure out which buffer other sources should lint. This variable can be read
in Lua scripts in the usual way via vim.g.ale_want_results_buffer.
*ALECompletePost-autocmd*
ALECompletePost ALECompletePost
This |User| autocmd is triggered after ALE inserts an item on
|CompleteDone|. This event can be used to run commands after a buffer
is changed by ALE as the result of completion. For example, :ALEFix can
be configured to run automatically when completion is done: >
augroup FixAfterComplete autocmd! “ Run ALEFix when completion items are added. autocmd User ALECompletePost ALEFix! “ If ALE starts fixing a file, stop linters running for now. autocmd User ALEFixPre ALELintStop augroup END < ALELintPre-autocmd ALELintPre ALELintPre ALELintPost-autocmd ALELintPost ALELintPost ALEFixPre-autocmd ALEFixPre ALEFixPre ALEFixPost-autocmd ALEFixPost ALEFixPost
These |User| autocommands are triggered before and after every lint or fix cycle. They can be used to update statuslines, send notifications, etc. The autocmd commands are run with |:silent|, so |:unsilent| is required for echoing messages.
For example to change the color of the statusline while the linter is running: >
augroup ALEProgress autocmd! autocmd User ALELintPre hi Statusline ctermfg=darkgrey autocmd User ALELintPost hi Statusline ctermfg=NONE augroup END < Or to display the progress in the statusline: >
let s:alerunning = 0 let l:stl .= ‘%{s:alerunning ? “[linting]” : ““}’ augroup ALEProgress autocmd! autocmd User ALELintPre let s:alerunning = 1 | redrawstatus autocmd User ALELintPost let s:alerunning = 0 | redrawstatus augroup END < ALEJobStarted-autocmd ALEJobStarted ALEJobStarted
This |User| autocommand is triggered immediately after a job is successfully run. This provides better accuracy for checking linter status with |ale#engine#IsCheckingBuffer()| over |ALELintPre-autocmd|, which is actually triggered before any linters are executed.
*ALELSPStarted-autocmd*
ALELSPStarted ALELSPStarted
This |User| autocommand is triggered immediately after an LSP connection is successfully initialized. This provides a way to perform any additional initialization work, such as setting up buffer-level mappings.
*ALEWantResults-autocmd*
ALEWantResults ALEWantResults
This |User| autocommand is triggered before ALE begins a lint cycle. Another source can respond by calling |ale#other_source#StartChecking()|, and |ALELintPre| will be signaled thereafter, to allow other plugins to know that another source is checking the buffer.
|g:alewantresults_buffer| will be set to the number for a buffer being checked when the event is signaled, and deleted after the event is done. This variable should be read to know which buffer to check.
Other plugins can use this event to start checking buffers when ALE events for checking buffers are triggered.
- Special Thanks ale-special-thanks
Special thanks to Mark Grealish (https://www.bhalash.com/) for providing ALE’s snazzy looking ale glass logo. Cheers, Mark!
- Contact ale-contact
If you like this plugin, and wish to get in touch, check out the GitHub page for issues and more at https://github.com/dense-analysis/ale
If you wish to contact the author of this plugin directly, please feel free to send an email to devw0rp@gmail.com.
Please drink responsibly, or not at all, which is ironically the preference of w0rp, who is teetotal.
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: