2017-03-28 18:25:44 -04:00
|
|
|
*ale.txt* For Vim version 8.0.
|
2016-11-02 02:19:24 -04:00
|
|
|
*ale*
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-10 07:53:54 -04:00
|
|
|
ALE - Asynchronous Lint Engine
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
CONTENTS *ale-contents*
|
|
|
|
|
2017-01-15 08:20:23 -05:00
|
|
|
1. Introduction.........................|ale-introduction|
|
|
|
|
2. Supported Languages & Tools..........|ale-support|
|
|
|
|
3. Global Options.......................|ale-options|
|
2017-06-26 16:49:13 -04:00
|
|
|
3.1 Highlights........................|ale-highlights|
|
2017-05-20 14:01:12 -04:00
|
|
|
4. Fixing Problems......................|ale-fix|
|
2017-05-27 13:31:52 -04:00
|
|
|
5. Integration Documentation............|ale-integrations|
|
2017-03-28 18:25:44 -04:00
|
|
|
asm...................................|ale-asm-options|
|
|
|
|
gcc.................................|ale-asm-gcc|
|
|
|
|
c.....................................|ale-c-options|
|
|
|
|
clang...............................|ale-c-clang|
|
|
|
|
cppcheck............................|ale-c-cppcheck|
|
|
|
|
gcc.................................|ale-c-gcc|
|
2017-04-05 13:21:47 -04:00
|
|
|
chef..................................|ale-chef-options|
|
|
|
|
foodcritic..........................|ale-chef-foodcritic|
|
2017-03-28 18:25:44 -04:00
|
|
|
cpp...................................|ale-cpp-options|
|
|
|
|
clang...............................|ale-cpp-clang|
|
2017-06-24 11:10:04 -04:00
|
|
|
clangcheck..........................|ale-cpp-clangcheck|
|
2017-03-28 18:25:44 -04:00
|
|
|
clangtidy...........................|ale-cpp-clangtidy|
|
|
|
|
cppcheck............................|ale-cpp-cppcheck|
|
2017-05-10 13:41:58 -04:00
|
|
|
cpplint.............................|ale-cpp-cpplint|
|
2017-03-28 18:25:44 -04:00
|
|
|
gcc.................................|ale-cpp-gcc|
|
|
|
|
css...................................|ale-css-options|
|
|
|
|
stylelint...........................|ale-css-stylelint|
|
|
|
|
cmake.................................|ale-cmake-options|
|
|
|
|
cmakelint...........................|ale-cmake-cmakelint|
|
|
|
|
erlang................................|ale-erlang-options|
|
|
|
|
erlc................................|ale-erlang-erlc|
|
|
|
|
fortran...............................|ale-fortran-options|
|
|
|
|
gcc.................................|ale-fortran-gcc|
|
2017-06-14 04:37:24 -04:00
|
|
|
fusionscript..........................|ale-fuse-options|
|
|
|
|
fusion-lint.........................|ale-fuse-fusionlint|
|
2017-04-15 16:04:43 -04:00
|
|
|
go....................................|ale-go-options|
|
|
|
|
gometalinter........................|ale-go-gometalinter|
|
2017-04-07 10:38:50 -04:00
|
|
|
handlebars............................|ale-handlebars-options|
|
|
|
|
ember-template-lint.................|ale-handlebars-embertemplatelint|
|
2017-03-28 18:25:44 -04:00
|
|
|
html..................................|ale-html-options|
|
|
|
|
htmlhint............................|ale-html-htmlhint|
|
|
|
|
tidy................................|ale-html-tidy|
|
|
|
|
java..................................|ale-java-options|
|
2017-05-12 09:42:32 -04:00
|
|
|
checkstyle..........................|ale-java-checkstyle|
|
2017-03-28 18:25:44 -04:00
|
|
|
javac...............................|ale-java-javac|
|
|
|
|
javascript............................|ale-javascript-options|
|
|
|
|
eslint..............................|ale-javascript-eslint|
|
|
|
|
flow................................|ale-javascript-flow|
|
|
|
|
jshint..............................|ale-javascript-jshint|
|
2017-05-27 13:31:52 -04:00
|
|
|
prettier............................|ale-javascript-prettier|
|
|
|
|
prettier-eslint.....................|ale-javascript-prettier-eslint|
|
2017-06-28 11:35:19 -04:00
|
|
|
prettier-standard...................|ale-javascript-prettier-standard|
|
2017-03-28 18:48:55 -04:00
|
|
|
standard............................|ale-javascript-standard|
|
2017-03-28 18:25:44 -04:00
|
|
|
xo..................................|ale-javascript-xo|
|
2017-05-02 13:27:04 -04:00
|
|
|
kotlin................................|ale-kotlin-options|
|
|
|
|
kotlinc.............................|ale-kotlin-kotlinc|
|
2017-03-28 18:25:44 -04:00
|
|
|
lua...................................|ale-lua-options|
|
|
|
|
luacheck............................|ale-lua-luacheck|
|
2017-05-19 12:41:57 -04:00
|
|
|
objc..................................|ale-objc-options|
|
|
|
|
clang...............................|ale-objc-clang|
|
|
|
|
objcpp................................|ale-objcpp-options|
|
|
|
|
clang...............................|ale-objcpp-clang|
|
2017-03-28 18:25:44 -04:00
|
|
|
ocaml.................................|ale-ocaml-options|
|
|
|
|
merlin..............................|ale-ocaml-merlin|
|
|
|
|
perl..................................|ale-perl-options|
|
|
|
|
perl................................|ale-perl-perl|
|
2017-06-11 16:13:47 -04:00
|
|
|
perlcritic..........................|ale-perl-perlcritic|
|
2017-03-28 18:25:44 -04:00
|
|
|
php...................................|ale-php-options|
|
|
|
|
phpcs...............................|ale-php-phpcs|
|
|
|
|
phpmd...............................|ale-php-phpmd|
|
2017-06-29 06:40:03 -04:00
|
|
|
pug...................................|ale-pug-options|
|
|
|
|
puglint.............................|ale-pug-puglint|
|
2017-03-28 18:25:44 -04:00
|
|
|
python................................|ale-python-options|
|
2017-06-18 06:03:31 -04:00
|
|
|
autopep8............................|ale-python-autopep8|
|
2017-03-28 18:25:44 -04:00
|
|
|
flake8..............................|ale-python-flake8|
|
2017-06-18 06:03:31 -04:00
|
|
|
isort...............................|ale-python-isort|
|
2017-03-28 18:25:44 -04:00
|
|
|
mypy................................|ale-python-mypy|
|
|
|
|
pylint..............................|ale-python-pylint|
|
2017-06-18 06:03:31 -04:00
|
|
|
yapf................................|ale-python-yapf|
|
2017-03-28 18:25:44 -04:00
|
|
|
ruby..................................|ale-ruby-options|
|
2017-04-20 02:37:08 -04:00
|
|
|
reek................................|ale-ruby-reek|
|
2017-03-28 18:25:44 -04:00
|
|
|
rubocop.............................|ale-ruby-rubocop|
|
|
|
|
rust..................................|ale-rust-options|
|
|
|
|
cargo...............................|ale-rust-cargo|
|
|
|
|
rustc...............................|ale-rust-rustc|
|
|
|
|
sass..................................|ale-sass-options|
|
|
|
|
stylelint...........................|ale-sass-stylelint|
|
|
|
|
scss..................................|ale-scss-options|
|
|
|
|
stylelint...........................|ale-scss-stylelint|
|
|
|
|
sh....................................|ale-sh-options|
|
|
|
|
shell...............................|ale-sh-shell|
|
|
|
|
shellcheck..........................|ale-sh-shellcheck|
|
2017-04-19 18:40:58 -04:00
|
|
|
spec..................................|ale-spec-options|
|
|
|
|
rpmlint.............................|ale-spec-rpmlint|
|
2017-07-03 11:57:39 -04:00
|
|
|
stylus................................|ale-stylus-options|
|
|
|
|
stylelint...........................|ale-stylus-stylelint|
|
2017-03-28 18:25:44 -04:00
|
|
|
tex...................................|ale-tex-options|
|
|
|
|
chktex..............................|ale-tex-chktex|
|
|
|
|
lacheck.............................|ale-tex-lacheck|
|
2017-04-18 04:28:54 -04:00
|
|
|
typescript............................|ale-typescript-options|
|
2017-06-20 05:50:38 -04:00
|
|
|
eslint..............................|ale-typescript-eslint|
|
2017-04-18 04:28:54 -04:00
|
|
|
tslint..............................|ale-typescript-tslint|
|
2017-06-13 12:59:09 -04:00
|
|
|
tsserver............................|ale-typescript-tsserver|
|
2017-06-29 04:15:52 -04:00
|
|
|
verilog/systemverilog.................|ale-verilog-options|
|
|
|
|
iverilog............................|ale-verilog-iverilog|
|
|
|
|
verilator...........................|ale-verilog-verilator|
|
2017-03-28 18:25:44 -04:00
|
|
|
vim...................................|ale-vim-options|
|
|
|
|
vint................................|ale-vim-vint|
|
2017-05-18 04:31:12 -04:00
|
|
|
xml...................................|ale-xml-options|
|
|
|
|
xmllint.............................|ale-xml-xmllint|
|
2017-03-28 18:25:44 -04:00
|
|
|
yaml..................................|ale-yaml-options|
|
|
|
|
yamllint............................|ale-yaml-yamllint|
|
2017-05-20 14:01:12 -04:00
|
|
|
6. Commands/Keybinds....................|ale-commands|
|
|
|
|
7. API..................................|ale-api|
|
|
|
|
8. Special Thanks.......................|ale-special-thanks|
|
|
|
|
9. Contact..............................|ale-contact|
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
1. 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 |timer| features
|
|
|
|
as a minimum.
|
|
|
|
|
2017-05-20 14:01:12 -04:00
|
|
|
ALE supports the following key features for linting:
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
1. Running linters when text is changed.
|
|
|
|
2. Running linters when files are opened.
|
|
|
|
3. Running linters when files are saved. (When a global flag is set.)
|
|
|
|
4. Populating the |loclist| with warning and errors.
|
|
|
|
5. Setting |signs| with warnings and errors for error markers.
|
|
|
|
6. Using |echo| to show error messages when the cursor moves.
|
2017-05-20 14:01:12 -04:00
|
|
|
7. Setting syntax highlights for errors.
|
|
|
|
|
|
|
|
ALE can fix problems with files with the |ALEFix| command, using the same job
|
2017-06-28 11:20:01 -04:00
|
|
|
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.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
2. Supported Languages & Tools *ale-support*
|
|
|
|
|
|
|
|
The following languages and tools are supported.
|
|
|
|
|
2017-03-25 19:02:59 -04:00
|
|
|
* ASM: 'gcc'
|
2016-10-20 10:26:56 -04:00
|
|
|
* Ansible: 'ansible-lint'
|
2017-03-01 19:06:09 -05:00
|
|
|
* Asciidoc: 'proselint'
|
2016-10-05 19:22:32 -04:00
|
|
|
* Bash: 'shell' (-n flag), 'shellcheck'
|
|
|
|
* Bourne Shell: 'shell' (-n flag), 'shellcheck'
|
2016-10-31 01:32:39 -04:00
|
|
|
* C: 'cppcheck', 'gcc', 'clang'
|
2017-05-10 13:41:58 -04:00
|
|
|
* C++ (filetype cpp): 'clang', 'clangtidy', 'cppcheck', 'cpplint', 'gcc'
|
2017-01-15 07:42:17 -05:00
|
|
|
* C#: 'mcs'
|
2016-10-30 14:23:32 -04:00
|
|
|
* Chef: 'foodcritic'
|
2017-02-25 12:27:03 -05:00
|
|
|
* CMake: 'cmakelint'
|
2016-10-08 11:52:23 -04:00
|
|
|
* CoffeeScript: 'coffee', 'coffelint'
|
2017-04-15 06:37:09 -04:00
|
|
|
* Crystal: 'crystal'
|
2016-12-06 08:26:06 -05:00
|
|
|
* CSS: 'csslint', 'stylelint'
|
2016-10-07 13:33:16 -04:00
|
|
|
* Cython (pyrex filetype): 'cython'
|
2016-10-05 19:22:32 -04:00
|
|
|
* D: 'dmd'
|
2017-01-30 10:27:26 -05:00
|
|
|
* Dockerfile: 'hadolint'
|
2017-03-27 08:02:25 -04:00
|
|
|
* Elixir: 'credo', 'dogma'
|
2016-12-13 04:06:04 -05:00
|
|
|
* Elm: 'elm-make'
|
2017-01-22 08:42:18 -05:00
|
|
|
* Erlang: 'erlc'
|
2016-10-05 19:22:32 -04:00
|
|
|
* Fortran: 'gcc'
|
2017-04-15 16:04:43 -04:00
|
|
|
* Go: 'gofmt', 'go vet', 'golint', 'go build', 'gosimple', 'staticcheck'
|
2017-06-14 04:35:11 -04:00
|
|
|
* FusionScript: 'fusion-lint'
|
2017-03-03 15:27:07 -05:00
|
|
|
* Haml: 'hamllint'
|
2017-04-07 10:38:50 -04:00
|
|
|
* Handlebars: 'ember-template-lint'
|
2017-04-22 08:23:23 -04:00
|
|
|
* Haskell: 'ghc', 'ghc-mod', 'hlint', 'hdevtools'
|
2017-03-01 19:06:09 -05:00
|
|
|
* HTML: 'HTMLHint', 'proselint', 'tidy'
|
2017-02-11 17:02:38 -05:00
|
|
|
* Java: 'javac'
|
2017-06-03 07:31:27 -04:00
|
|
|
* JavaScript: 'eslint', 'jscs', 'jshint', 'flow', 'prettier', 'prettier-eslint', 'xo'
|
2016-10-05 19:22:32 -04:00
|
|
|
* JSON: 'jsonlint'
|
2017-05-02 13:27:04 -04:00
|
|
|
* Kotlin: 'kotlinc'
|
2017-05-03 18:35:33 -04:00
|
|
|
* LaTeX (tex): 'chktex', 'lacheck', 'proselint'
|
2016-10-12 10:44:53 -04:00
|
|
|
* Lua: 'luacheck'
|
2017-05-01 11:06:04 -04:00
|
|
|
* Markdown: 'mdl', 'proselint', 'vale'
|
2016-10-24 15:32:52 -04:00
|
|
|
* MATLAB: 'mlint'
|
2017-03-18 12:33:26 -04:00
|
|
|
* nim: 'nim check'
|
2017-03-03 16:45:48 -05:00
|
|
|
* nix: 'nix-instantiate'
|
2017-03-01 19:06:09 -05:00
|
|
|
* nroff: 'proselint'
|
2017-05-19 12:41:57 -04:00
|
|
|
* Objective-C: 'clang'
|
|
|
|
* Objective-C++: 'clang'
|
2016-11-23 10:19:36 -05:00
|
|
|
* OCaml: 'merlin' (see |ale-linter-integration-ocaml-merlin|)
|
2016-10-09 11:31:03 -04:00
|
|
|
* Perl: 'perl' (-c flag), 'perlcritic'
|
2017-02-01 11:09:33 -05:00
|
|
|
* PHP: 'hack', 'php' (-l flag), 'phpcs', 'phpmd'
|
2017-03-01 19:06:09 -05:00
|
|
|
* Pod: 'proselint'
|
2016-10-07 17:16:29 -04:00
|
|
|
* Pug: 'pug-lint'
|
2016-11-25 07:00:07 -05:00
|
|
|
* Puppet: 'puppet', 'puppet-lint'
|
2017-06-18 06:03:31 -04:00
|
|
|
* Python: 'autopep8', 'flake8', 'isort', 'mypy', 'pylint', 'yapf'
|
2017-07-03 17:34:22 -04:00
|
|
|
* R: 'lintr'
|
2017-04-26 19:22:30 -04:00
|
|
|
* ReasonML: 'merlin'
|
2017-03-01 19:06:09 -05:00
|
|
|
* reStructuredText: 'proselint'
|
2017-04-19 18:40:58 -04:00
|
|
|
* RPM spec: 'spec'
|
2017-01-19 15:21:54 -05:00
|
|
|
* Rust: 'rustc' (see |ale-integration-rust|)
|
2017-04-20 02:37:08 -04:00
|
|
|
* Ruby: 'reek', 'rubocop'
|
2016-12-06 08:26:06 -05:00
|
|
|
* SASS: 'sasslint', 'stylelint'
|
|
|
|
* SCSS: 'sasslint', 'scsslint', 'stylelint'
|
2016-10-07 11:28:44 -04:00
|
|
|
* Scala: 'scalac'
|
2017-03-13 19:21:59 -04:00
|
|
|
* Slim: 'slim-lint'
|
2017-02-17 21:05:33 -05:00
|
|
|
* SML: 'smlnj'
|
2017-07-03 11:57:39 -04:00
|
|
|
* Stylus: 'stylelint'
|
2017-04-15 06:24:05 -04:00
|
|
|
* SQL: 'sqlint'
|
2016-12-13 10:28:20 -05:00
|
|
|
* Swift: 'swiftlint'
|
2017-03-01 19:06:09 -05:00
|
|
|
* Texinfo: 'proselint'
|
2017-05-01 11:06:04 -04:00
|
|
|
* Text: 'proselint', 'vale'
|
2017-06-20 05:50:38 -04:00
|
|
|
* TypeScript: 'eslint', 'tslint', 'tsserver', 'typecheck'
|
2016-10-08 08:38:31 -04:00
|
|
|
* Verilog: 'iverilog', 'verilator'
|
2016-10-05 19:22:32 -04:00
|
|
|
* Vim: 'vint'
|
2017-03-01 19:06:09 -05:00
|
|
|
* Vim help: 'proselint'
|
|
|
|
* XHTML: 'proselint'
|
2017-05-18 04:31:12 -04:00
|
|
|
* XML: 'xmllint'
|
2016-10-05 19:22:32 -04:00
|
|
|
* YAML: 'yamllint'
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
3. Global Options *ale-options*
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:airline#extensions#ale#enabled *g:airline#extensions#ale#enabled*
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
Enables or disables the |airline|'s native extension for ale, which displays
|
|
|
|
warnings and errors in the status line, prefixed by
|
|
|
|
|airline#extensions#ale#error_symbol| and
|
|
|
|
|airline#extensions#ale#warning_symbol|.
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-05-21 17:42:27 -04:00
|
|
|
g:ale_change_sign_column_color *g:ale_change_sign_column_color*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, 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:ale_sign_column_always|.
|
|
|
|
|
|
|
|
ALE uses the following highlight groups for highlighting the sign column:
|
|
|
|
|
|
|
|
`ALESignColumnWithErrors` - Links to `error` by default.
|
2017-05-21 17:46:22 -04:00
|
|
|
`ALESignColumnWithoutErrors` - Uses the value for `SignColumn` by default.
|
2017-05-21 17:42:27 -04:00
|
|
|
|
2017-06-23 07:00:33 -04:00
|
|
|
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.
|
|
|
|
|
2017-05-21 17:42:27 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:ale_echo_cursor *g:ale_echo_cursor*
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
When 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 to `0` to disable
|
|
|
|
this behaviour.
|
|
|
|
The format of the message can be customizable in |g:ale_echo_msg_format|.
|
2016-10-11 18:11:45 -04:00
|
|
|
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |String|
|
|
|
|
Default: `Error`
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
The string used for error severity in the echoed message.
|
|
|
|
Note |`g:ale_echo_cursor`| should be set to 1
|
|
|
|
Note |`g:ale_echo_msg_format`| should contain the `%severity%` handler
|
2016-10-11 18:11:45 -04:00
|
|
|
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:ale_echo_msg_format *g:ale_echo_msg_format*
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |String|
|
|
|
|
Default: `%s`
|
2016-10-11 18:11:45 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
This variable defines the format of the echoed message. The `%s` is the
|
|
|
|
error message itself, and it can contain the following handlers:
|
|
|
|
- `%linter%` for linter's name
|
|
|
|
- `%severity%` for the type of severity
|
|
|
|
Note |`g:ale_echo_cursor`| should be setted to 1
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:ale_echo_msg_warning_str *g:ale_echo_msg_warning_str*
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |String|
|
|
|
|
Default: `Warning`
|
|
|
|
|
|
|
|
The string used for warning severity in the echoed message.
|
|
|
|
Note |`g:ale_echo_cursor`| should be set to 1
|
|
|
|
Note |`g:ale_echo_msg_format`| should contain the `%severity%` handler
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
2017-03-06 18:15:28 -05:00
|
|
|
g:ale_emit_conflict_warnings *g:ale_emit_conflict_warnings*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
When set to `0`, ALE will not emit any warnings on startup about conflicting
|
|
|
|
plugins. ALE will probably not work if other linting plugins are installed.
|
|
|
|
|
|
|
|
|
2017-02-12 14:26:18 -05:00
|
|
|
g:ale_enabled *g:ale_enabled*
|
2017-05-26 11:20:17 -04:00
|
|
|
*b:ale_enabled*
|
2017-02-12 14:26:18 -05:00
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
When 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 |ALEToggle| command, which changes this option.
|
|
|
|
|
2017-05-26 11:20:17 -04:00
|
|
|
ALE can be disabled in each buffer by setting `let b:ale_enabled = 0`
|
|
|
|
Disabling ALE based on filename patterns can be accomplished by setting
|
|
|
|
a regular expression for |g:ale_pattern_options|. For example: >
|
|
|
|
|
|
|
|
" Disable linting for all minified JS files.
|
|
|
|
let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}}
|
|
|
|
<
|
|
|
|
|
|
|
|
See |g:ale_pattern_options| for more information on that option.
|
|
|
|
|
2017-02-12 14:26:18 -05:00
|
|
|
|
2017-05-20 14:01:12 -04:00
|
|
|
g:ale_fixers *g:ale_fixers*
|
|
|
|
*b: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 overriden with variables in each buffer.
|
|
|
|
|
|
|
|
|
2017-05-30 16:32:51 -04:00
|
|
|
g:ale_fix_on_save *g:ale_fix_on_save*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to 1, ALE will fix files when they are saved.
|
|
|
|
|
|
|
|
If |g:ale_lint_on_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
|
2017-06-08 11:43:28 -04:00
|
|
|
to the file will be saved to the file on disk.
|
2017-05-30 16:32:51 -04:00
|
|
|
|
|
|
|
|
2017-02-16 16:33:44 -05:00
|
|
|
g:ale_history_enabled *g:ale_history_enabled*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
When 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
|
|
|
|
|ALEInfo| command. The size of the buffer can be controlled with the
|
|
|
|
|g:ale_max_buffer_history_size| option.
|
|
|
|
|
|
|
|
This option can be disabled if storing a command history is not desired.
|
|
|
|
|
|
|
|
|
2017-02-16 18:18:57 -05:00
|
|
|
g:ale_history_log_output *g:ale_history_log_output*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When 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:ale_history_enabled| must be set to `1` for this output to be stored or
|
|
|
|
printed.
|
|
|
|
|
|
|
|
ALE will likely consume a lot of memory if this option is on, so it should
|
|
|
|
only be used for debugging problems with linters.
|
|
|
|
|
|
|
|
|
2017-01-22 10:19:09 -05:00
|
|
|
g:ale_keep_list_window_open *g:ale_keep_list_window_open*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When 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 quicfix windows will be closed automatically when there
|
|
|
|
are no warnings or errors.
|
|
|
|
|
|
|
|
See: |g:ale_open_list|
|
|
|
|
|
|
|
|
|
2017-06-01 05:39:21 -04:00
|
|
|
g:ale_list_window_size *g:ale_list_window_size*
|
|
|
|
*b:ale_list_window_size*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `10`
|
|
|
|
|
|
|
|
This number configures the number of lines to set for the height of windows
|
|
|
|
opened automatically for ALE problems. The default of `10` matches the Vim
|
|
|
|
default height.
|
|
|
|
|
|
|
|
See |g:ale_open_list| for information on automatically opening windows
|
|
|
|
for quickfix or the loclist.
|
|
|
|
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
g:ale_lint_delay *g:ale_lint_delay*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `200`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
This variable controls the milliseconds delay after which the linters will
|
|
|
|
be run after text is changed. This option is only meaningful with the
|
2017-03-30 18:21:37 -04:00
|
|
|
|g:ale_lint_on_text_changed| variable set to `always`, `insert`, or `normal`.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_lint_on_enter *g:ale_lint_on_enter*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-06-06 12:01:17 -04:00
|
|
|
When this option is set to `1`, the |BufWinEnter| and |BufRead| events will
|
|
|
|
be used to apply linters when buffers are first opened. If this is not
|
|
|
|
desired, this variable can be set to `0` in your vimrc file to disable this
|
2016-10-09 16:20:21 -04:00
|
|
|
behaviour.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-06-24 07:24:31 -04:00
|
|
|
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.
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-03-27 17:40:25 -04:00
|
|
|
g:ale_lint_on_filetype_changed *g:ale_lint_on_filetype_changed*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
This option will cause ALE to run whenever the filetype is changed. 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.
|
|
|
|
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
g:ale_lint_on_save *g:ale_lint_on_save*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
2017-03-27 15:36:35 -04:00
|
|
|
Default: `1`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
This option will make ALE run the linters whenever a file is saved when it
|
|
|
|
it set to `1` in your vimrc file. This option can be used in combination
|
|
|
|
with the |g:ale_lint_on_enter| and |g:ale_lint_on_text_changed| options to
|
|
|
|
make ALE only check files after that have been saved, if that is what is
|
|
|
|
desired.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:ale_lint_on_text_changed *g:ale_lint_on_text_changed*
|
|
|
|
|
2017-03-30 18:21:37 -04:00
|
|
|
Type: |String|
|
|
|
|
Default: `always`
|
2017-01-22 10:06:33 -05:00
|
|
|
|
|
|
|
By default, ALE will check files with the various supported programs when
|
|
|
|
text is changed by using the |TextChanged| event. If this behaviour is not
|
2017-03-30 18:21:37 -04:00
|
|
|
desired, then this option can be disabled by setting it to `never`. The
|
2017-01-22 10:06:33 -05:00
|
|
|
|g:ale_lint_delay| variable will be used to set a |timer_start()| on a
|
|
|
|
delay, and each change to a file will continue to call |timer_stop()| and
|
|
|
|
|timer_start()| repeatedly until the timer ticks by, and the linters will be
|
|
|
|
run. The checking of files will run in the background, so it should not
|
2017-03-30 18:21:37 -04:00
|
|
|
inhibit editing files. This option can also be set to `insert` or `normal`
|
|
|
|
to lint when text is changed only in insert or normal mode respectively.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_lint_on_insert_leave *g:ale_lint_on_insert_leave*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
This option will make ALE run the linters whenever leaving insert mode when
|
2017-05-25 04:47:59 -04:00
|
|
|
it is set to `1` in your vimrc file.
|
2017-01-22 10:06:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_linter_aliases *g:ale_linter_aliases*
|
2017-04-25 18:52:13 -04:00
|
|
|
*b:ale_linter_aliases*
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |Dictionary|
|
|
|
|
Default: `{}`
|
|
|
|
|
|
|
|
The |g:ale_linter_aliases| 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: >
|
|
|
|
|
|
|
|
{
|
|
|
|
\ 'zsh': 'sh',
|
|
|
|
\ 'csh': 'sh',
|
|
|
|
\}
|
|
|
|
<
|
|
|
|
For example, if you wish to map a new filetype `'foobar'` to run the `'php'`
|
|
|
|
linters, you could set the following: >
|
|
|
|
|
|
|
|
let g:ale_linter_aliases = {'foobar': 'php'}
|
|
|
|
<
|
|
|
|
When combined with the |g:ale_linters| 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.
|
|
|
|
|
2017-04-11 16:10:08 -04:00
|
|
|
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 `html` like so:
|
|
|
|
|
|
|
|
`let g:ale_linter_aliases = {'html': ['html', 'javascript', 'css']}`
|
|
|
|
|
|
|
|
Note that `html` itself was included as an alias. That is because aliases
|
|
|
|
will override the original linters for the aliased filetepe.
|
2017-01-22 10:06:33 -05:00
|
|
|
|
2017-04-25 18:52:13 -04:00
|
|
|
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_aliases`
|
|
|
|
variable, then `g:ale_linter_aliases`, and then a default Dictionary.
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
|
2017-04-25 18:52:13 -04:00
|
|
|
g:ale_linters *g:ale_linters*
|
|
|
|
*b:ale_linters*
|
2017-01-22 10:06:33 -05:00
|
|
|
Type: |Dictionary|
|
|
|
|
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.
|
|
|
|
Only the filetypes specified in the dictionary will be limited in terms
|
|
|
|
of which linters will be run.
|
|
|
|
|
|
|
|
This |Dictionary| will be merged with a default dictionary containing the
|
|
|
|
following values: >
|
|
|
|
|
|
|
|
{
|
|
|
|
\ 'csh': ['shell'],
|
2017-02-15 17:59:26 -05:00
|
|
|
\ 'rust': ['cargo'],
|
|
|
|
\ 'text': [],
|
|
|
|
\ 'zsh': ['shell'],
|
2017-01-22 10:06:33 -05:00
|
|
|
\}
|
|
|
|
<
|
|
|
|
This option can be used to enable only a particular set of linters for a
|
|
|
|
file. For example, you can enable only 'eslint' for JavaScript files: >
|
|
|
|
|
|
|
|
let g:ale_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': []}
|
|
|
|
<
|
|
|
|
All linters available for a given filetype can be enabled by using the
|
|
|
|
string `'all'`: >
|
|
|
|
|
|
|
|
let g:ale_linters = {'c': 'all'}
|
|
|
|
<
|
2017-04-25 18:52:13 -04:00
|
|
|
Linters can be configured in each buffer with buffer-local variables. ALE
|
|
|
|
will first look for linters for filetypes in the `b:ale_linters` variable,
|
|
|
|
then `g:ale_linters`, and then a default Dictionary.
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
|
2017-02-16 16:33:44 -05:00
|
|
|
g:ale_max_buffer_history_size *g:ale_max_buffer_history_size*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `20`
|
|
|
|
|
|
|
|
This 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:ale_history_enabled|.
|
|
|
|
|
|
|
|
|
2017-05-26 16:21:15 -04:00
|
|
|
g:ale_maximum_file_size *g:ale_maximum_file_size*
|
|
|
|
*b:ale_maximum_file_size*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
A 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.
|
|
|
|
|
|
|
|
|
2017-01-22 10:19:09 -05:00
|
|
|
g:ale_open_list *g:ale_open_list*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, this will cause ALE to automatically open a window for
|
|
|
|
the loclist (|lopen|) or for the quickfix list instead if
|
|
|
|
|g:ale_set_quickfix| is `1`. (|copen|)
|
|
|
|
|
|
|
|
The window will be kept open until all warnings or errors are cleared,
|
|
|
|
including those not set by ALE, unless |g:ale_keep_list_window_open| is set
|
|
|
|
to `1`, in which case the window will be kept open until closed manually.
|
|
|
|
|
2017-06-01 05:39:21 -04:00
|
|
|
The window size can be configured with |g:ale_list_window_size|.
|
|
|
|
|
2017-01-22 10:19:09 -05:00
|
|
|
|
2017-05-26 10:59:43 -04:00
|
|
|
g:ale_pattern_options *g:ale_pattern_options*
|
|
|
|
|
|
|
|
Type: |Dictionary|
|
|
|
|
Default: `{}`
|
|
|
|
|
|
|
|
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: >
|
|
|
|
|
|
|
|
let g:ale_pattern_options = {
|
|
|
|
\ '\.foo\.js$': {
|
|
|
|
\ 'ale_linters: {'javascript': ['eslint']},
|
|
|
|
\ },
|
|
|
|
\}
|
|
|
|
<
|
|
|
|
The above example will match any filename ending in `.foo.js`, and use
|
|
|
|
only `eslint` for checking those files by setting `b:ale_linters`.
|
|
|
|
|
|
|
|
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 from `expand('%:p')`.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_pattern_options_enabled *g:ale_pattern_options_enabled*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `!empty(g:ale_pattern_options)`
|
|
|
|
|
|
|
|
This option can be used for turning the behaviour of setting
|
|
|
|
|g:ale_pattern_options| on or off. By default, setting a single key
|
|
|
|
for |g:ale_pattern_options| will turn this option on.
|
|
|
|
|
|
|
|
|
2017-05-31 17:04:33 -04:00
|
|
|
g:ale_set_balloons *g:ale_set_balloons*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `has('balloon_eval')`
|
|
|
|
|
|
|
|
When this option is set to `1`, balloon messages will be displayed for
|
|
|
|
problems. Problems nearest to the cursor on the line the cursor is over will
|
|
|
|
be displayed.
|
|
|
|
|
|
|
|
|
2017-02-12 19:18:51 -05:00
|
|
|
g:ale_set_highlights *g:ale_set_highlights*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `has('syntax')`
|
|
|
|
|
2017-05-21 14:22:48 -04:00
|
|
|
When this option is set to `1`, highlights will be set for problems.
|
|
|
|
|
|
|
|
ALE will use the following highlight groups for problems:
|
|
|
|
|
2017-06-26 16:49:13 -04:00
|
|
|
|ALEError| - Items with `'type': 'E'`
|
|
|
|
|ALEWarning| - Items with `'type': 'W'`
|
|
|
|
|ALEInfo.| - Items with `'type': 'I'`
|
|
|
|
|ALEStyleError| - Items with `'type': 'E'` and `'sub_type': 'style'`
|
|
|
|
|ALEStyleWarning| - Items with `'type': 'W'` and `'sub_type': 'style'`
|
2017-02-12 19:18:51 -05:00
|
|
|
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
g:ale_set_loclist *g:ale_set_loclist*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-01-22 10:19:09 -05:00
|
|
|
When this option is set to `1`, the |loclist| will be populated with any
|
2016-10-09 16:20:21 -04:00
|
|
|
warnings and errors which are found by ALE. This feature can be used to
|
|
|
|
implement jumping between errors through typical use of |lnext| and |lprev|.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
2017-01-22 10:19:09 -05:00
|
|
|
g:ale_set_quickfix *g:ale_set_quickfix*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When this option is set to `1`, the |quickfix| list will be populated with any
|
|
|
|
warnings and errors which are found by ALE, instead of the |loclist|. The
|
|
|
|
loclist will never be populated when this option is on.
|
|
|
|
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
g:ale_set_signs *g:ale_set_signs*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `has('signs')`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
When this option is set to `1`, the |sign| column will be populated with
|
2017-05-20 18:32:41 -04:00
|
|
|
signs marking where problems appear in the file.
|
|
|
|
|
|
|
|
ALE will use the following highlight groups for problems:
|
|
|
|
|
2017-06-26 16:49:13 -04:00
|
|
|
|ALEErrorSign| - Items with `'type': 'E'`
|
|
|
|
|ALEWarningSign| - Items with `'type': 'W'`
|
|
|
|
|ALEInfoSign| - Items with `'type': 'I'`
|
|
|
|
|ALEStyleErrorSign| - Items with `'type': 'E'` and `'sub_type': 'style'`
|
|
|
|
|ALEStyleWarningSign| - Items with `'type': 'W'` and `'sub_type': 'style'`
|
|
|
|
|
|
|
|
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'`
|
|
|
|
|ALEWarningLine| - All items with `'type': 'W'`
|
|
|
|
|ALEInfoLine| - All items with `'type': 'I'`
|
2017-05-20 18:32:41 -04:00
|
|
|
|
|
|
|
The markers for the highlights can be customized with the following options:
|
|
|
|
|
|
|
|
|g:ale_sign_error|
|
|
|
|
|g:ale_sign_warning|
|
|
|
|
|g:ale_sign_info|
|
|
|
|
|g:ale_sign_style_error|
|
|
|
|
|g:ale_sign_style_warning|
|
|
|
|
|
|
|
|
When multiple problems exist on the same line, the signs will take
|
|
|
|
precedence in the order above, from highest to lowest.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_column_always *g:ale_sign_column_always*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
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.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_error *g:ale_sign_error*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |String|
|
|
|
|
Default: `'>>'`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-05-20 18:32:41 -04:00
|
|
|
The sign for errors in the sign gutter.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_info *g:ale_sign_info*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `g:ale_sign_warning`
|
|
|
|
|
|
|
|
The sign for "info" markers in the sign gutter.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_style_error *g:ale_sign_style_error*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `g:ale_sign_error`
|
|
|
|
|
|
|
|
The sign for style errors in the sign gutter.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_style_warning *g:ale_sign_style_warning*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `g:ale_sign_warning`
|
|
|
|
|
|
|
|
The sign for style warnings in the sign gutter.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_offset *g:ale_sign_offset*
|
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1000000`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
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.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
|
2017-01-22 10:06:33 -05:00
|
|
|
g:ale_sign_warning *g:ale_sign_warning*
|
2016-10-10 07:53:54 -04:00
|
|
|
|
|
|
|
Type: |String|
|
2017-01-22 10:06:33 -05:00
|
|
|
Default: `'--'`
|
2016-10-10 07:53:54 -04:00
|
|
|
|
2017-05-20 18:32:41 -04:00
|
|
|
The sign for warnings in the sign gutter.
|
2016-10-10 07:53:54 -04:00
|
|
|
|
|
|
|
|
2017-06-14 12:59:13 -04:00
|
|
|
g:ale_type_map *g:ale_type_map*
|
|
|
|
*b:ale_type_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 error 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 do
|
|
|
|
the following: >
|
|
|
|
|
|
|
|
let g:ale_type_map = {'flake8', {'ES': 'WS', 'E': 'W'}}
|
|
|
|
<
|
|
|
|
If you wanted to turn style errors and warnings into regular errors and
|
|
|
|
warnings, you can use the following: >
|
|
|
|
|
|
|
|
let g:ale_type_map = {'flake8', {'ES': 'E', 'WS': 'W'}}
|
|
|
|
<
|
|
|
|
Type maps can be set per-buffer with `b:ale_type_map`.
|
|
|
|
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
g:ale_warn_about_trailing_whitespace *g:ale_warn_about_trailing_whitespace*
|
2017-05-07 12:17:00 -04:00
|
|
|
b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:23:34 -04:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
When this option is set to `1`, warnings relating to trailing whitespace on
|
|
|
|
lines will be shown in signs, the loclist, and echo messages, etc. If these
|
|
|
|
errors are found to be too irritating while edits are being made, and you
|
|
|
|
have configured Vim to automatically remove trailing whitespace, then you
|
|
|
|
can disable these warnings for some linters by setting this option to `0`.
|
|
|
|
|
|
|
|
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.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-05-07 12:17:00 -04:00
|
|
|
This option may be configured on a per buffer basis.
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-06-26 16:49:13 -04:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
3.1. Highlights *ale-highlights*
|
|
|
|
|
|
|
|
ALEError *ALEError*
|
|
|
|
|
|
|
|
Default: `highlight link ALEError SpellBad`
|
|
|
|
|
|
|
|
The highlight used for highlighted errors. See |g:ale_set_highlights|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEErrorLine *ALEErrorLine*
|
|
|
|
|
|
|
|
Default: Undefined
|
|
|
|
|
|
|
|
The highlight for lines where error signs appear. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEErrorSign *ALEErrorSign*
|
|
|
|
|
|
|
|
Default: `highlight link ALEErrorSign error`
|
|
|
|
|
|
|
|
The highlight used for error signs. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEInfo *ALEInfo.*
|
|
|
|
*ALEInfo-highlight*
|
|
|
|
Default: `highlight link ALEInfo ALEWarning`
|
|
|
|
|
|
|
|
The highlight used for highlighted info messages. See |g:ale_set_highlights|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEInfoSign *ALEInfoSign*
|
|
|
|
|
|
|
|
Default: `highlight link ALEInfoSign ALEWarningSign`
|
|
|
|
|
|
|
|
The highlight used for info message signs. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEInfoLine *ALEInfoLine*
|
|
|
|
|
|
|
|
Default: Undefined
|
|
|
|
|
|
|
|
The highlight for lines where info signs appear. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEStyleError *ALEStyleError*
|
|
|
|
|
|
|
|
Default: `highlight link ALEStyleError ALEError`
|
|
|
|
|
|
|
|
The highlight used for highlighted style errors. See |g:ale_set_highlights|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEStyleErrorSign *ALEStyleErrorSign*
|
|
|
|
|
|
|
|
Default: `highlight link ALEStyleErrorSign ALEErrorSign`
|
|
|
|
|
|
|
|
The highlight used for style error signs. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEStyleWarning *ALEStyleWarning*
|
|
|
|
|
|
|
|
Default: `highlight link ALEStyleWarning ALEError`
|
|
|
|
|
|
|
|
The highlight used for highlighted style warnings. See |g:ale_set_highlights|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEStyleWarningSign *ALEStyleWarningSign*
|
|
|
|
|
|
|
|
Default: `highlight link ALEStyleWarningSign ALEWarningSign`
|
|
|
|
|
|
|
|
The highlight used for style warning signs. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEWarning *ALEWarning*
|
|
|
|
|
|
|
|
Default: `highlight link ALEWarning SpellCap`
|
|
|
|
|
|
|
|
The highlight used for highlighted warnings. See |g:ale_set_highlights|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEWarningLine *ALEWarningLine*
|
|
|
|
|
|
|
|
Default: Undefined
|
|
|
|
|
|
|
|
The highlight for lines where warning signs appear. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEWarningSign *ALEWarningSign*
|
|
|
|
|
|
|
|
Default: `highlight link ALEWarningSign todo`
|
|
|
|
|
|
|
|
The highlight used for warning signs. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
===============================================================================
|
2017-05-20 14:01:12 -04:00
|
|
|
4. Fixing Problems *ale-fix*
|
|
|
|
|
|
|
|
ALE can fix problems with files with the |ALEFix| command. When |ALEFix| is
|
|
|
|
run, the variable |g:ale_fixers| will be read for getting a |List| of commands
|
|
|
|
for filetypes, split on `.`, and the functions named in |g:ale_fixers| will be
|
|
|
|
executed for fixing the errors.
|
|
|
|
|
2017-06-28 11:20:01 -04:00
|
|
|
The |ALEFixSuggest| command can be used to suggest tools that be used to
|
|
|
|
fix problems for the current buffer.
|
|
|
|
|
2017-05-20 14:01:12 -04:00
|
|
|
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.
|
|
|
|
|
2017-06-06 18:13:53 -04:00
|
|
|
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, or a |Dictionary| for describing a command to be
|
|
|
|
run in the background.
|
|
|
|
|
|
|
|
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.
|
2017-05-20 14:01:12 -04:00
|
|
|
|
|
|
|
When a |Dictionary| is returned for an |ALEFix| callback, the following keys
|
|
|
|
are supported for running the commands.
|
|
|
|
|
|
|
|
`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.
|
|
|
|
|
|
|
|
`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.
|
|
|
|
|
|
|
|
*ale-fix-configuration*
|
|
|
|
|
|
|
|
Synchronous functions and asynchronous jobs will be run in a sequence for
|
|
|
|
fixing files, and can be combined. For example:
|
|
|
|
>
|
2017-06-01 16:08:43 -04:00
|
|
|
let g:ale_fixers = {
|
|
|
|
\ 'javascript': [
|
|
|
|
\ 'DoSomething',
|
|
|
|
\ 'eslint',
|
|
|
|
\ {buffer, lines -> filter(lines, 'v:val !=~ ''^\s*//''')},
|
|
|
|
\ ],
|
|
|
|
\}
|
2017-05-20 14:01:12 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2017-06-01 16:13:05 -04:00
|
|
|
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 <F8> <Plug>(ale_fix)
|
|
|
|
<
|
2017-05-30 16:32:51 -04:00
|
|
|
Files can be fixed automatically with the following options, which are all off
|
|
|
|
by default.
|
|
|
|
|
|
|
|
|g:ale_fix_on_save| - Fix files when they are saved.
|
|
|
|
|
2017-05-20 14:01:12 -04:00
|
|
|
|
|
|
|
===============================================================================
|
2017-05-27 13:31:52 -04:00
|
|
|
5. Integration Documentation *ale-integrations*
|
2016-10-06 08:42:52 -04:00
|
|
|
|
2017-05-27 13:31:52 -04:00
|
|
|
Linter and fixer options are documented in individual help files. See the
|
|
|
|
table of contents at |ale-contents|.
|
2016-10-06 08:42:52 -04:00
|
|
|
|
2017-05-27 13:31:52 -04:00
|
|
|
Every option for programs can be set globally, or individually for each
|
|
|
|
buffer. For example, `b:ale_python_flake8_executable` will override any
|
|
|
|
values set for `g:ale_python_flake8_executable`.
|
2017-04-19 18:55:55 -04:00
|
|
|
|
2017-06-18 06:03:31 -04:00
|
|
|
*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:ale_javascript_eslint_executable = 'special-eslint'
|
|
|
|
let g:ale_javascript_eslint_use_global = 1
|
|
|
|
|
|
|
|
" Use the global executable with a special name for flake8.
|
|
|
|
let g:ale_python_flake8_executable = '/foo/bar/flake8'
|
|
|
|
let g:ale_python_flake8_use_global = 1
|
|
|
|
<
|
|
|
|
|
|
|
|
The option |g:ale_virtualenv_dir_names| controls the local virtualenv paths
|
|
|
|
ALE will use to search for Python executables.
|
|
|
|
|
2017-01-12 04:33:55 -05:00
|
|
|
|
2016-10-06 08:42:52 -04:00
|
|
|
===============================================================================
|
2017-05-20 14:01:12 -04:00
|
|
|
6. Commands/Keybinds *ale-commands*
|
|
|
|
|
|
|
|
ALEFix *ALEFix*
|
|
|
|
|
|
|
|
Fix problems with the current buffer. See |ale-fix| for more information.
|
|
|
|
|
2017-06-01 16:13:05 -04:00
|
|
|
A plug mapping `<Plug>(ale_fix)` is defined for this command.
|
|
|
|
|
2016-10-24 17:09:41 -04:00
|
|
|
|
2017-06-28 11:20:01 -04:00
|
|
|
ALEFixSuggest *ALEFixSuggest*
|
|
|
|
|
|
|
|
Suggest tools that can be used to fix problems in the current buffer.
|
|
|
|
|
|
|
|
See |ale-fix| for more information.
|
|
|
|
|
|
|
|
|
2017-02-28 04:10:58 -05:00
|
|
|
ALELint *ALELint*
|
|
|
|
|
|
|
|
Run ALE once for the current buffer. This command can be used to run ALE
|
|
|
|
manually, instead of automatically, if desired.
|
|
|
|
|
2017-03-21 09:38:27 -04:00
|
|
|
This command will also run linters where `lint_file` is set to `1`, or in
|
|
|
|
other words linters which check the file instead of the Vim buffer.
|
|
|
|
|
2017-02-28 04:10:58 -05:00
|
|
|
A plug mapping `<Plug>(ale_lint)` is defined for this command.
|
|
|
|
|
|
|
|
|
2016-10-24 17:09:41 -04:00
|
|
|
ALEPrevious *ALEPrevious*
|
|
|
|
ALEPreviousWrap *ALEPreviousWrap*
|
|
|
|
ALENext *ALENext*
|
2017-03-02 21:55:22 -05:00
|
|
|
ALENextWrap *ALENextWrap*
|
2017-06-03 07:45:52 -04:00
|
|
|
ALEFirst *ALEFirst*
|
|
|
|
ALELast *ALELast*
|
2016-10-24 17:09:41 -04:00
|
|
|
*ale-navigation-commands*
|
|
|
|
|
2017-03-07 18:31:25 -05:00
|
|
|
Move between warnings or errors in a buffer. ALE will only navigate between
|
|
|
|
the errors or warnings it generated, even if both |g:ale_set_quickfix|
|
|
|
|
and |g:ale_set_loclist| are set to `0`.
|
2016-10-24 17:09:41 -04:00
|
|
|
|
|
|
|
`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.
|
|
|
|
|
2017-06-05 11:06:48 -04:00
|
|
|
`ALEFirst` goes to the first error or warning in the buffer, while `ALELast`
|
2017-06-03 07:45:52 -04:00
|
|
|
goes to the last one.
|
|
|
|
|
2016-10-24 17:09:41 -04:00
|
|
|
The following |<Plug>| mappings are defined for the commands: >
|
|
|
|
<Plug>(ale_previous) - ALEPrevious
|
|
|
|
<Plug>(ale_previous_wrap) - ALEPreviousWrap
|
|
|
|
<Plug>(ale_next) - ALENext
|
|
|
|
<Plug>(ale_next_wrap) - ALENextWrap
|
2017-06-03 07:45:52 -04:00
|
|
|
<Plug>(ale_first) - ALEFirst
|
|
|
|
<Plug>(ale_last) - ALELast
|
2016-10-24 17:09:41 -04:00
|
|
|
<
|
|
|
|
For example, these commands could be bound to the keys Ctrl + j
|
|
|
|
and Ctrl + k: >
|
|
|
|
|
|
|
|
" Map movement through errors without wrapping.
|
|
|
|
nmap <silent> <C-k> <Plug>(ale_previous)
|
|
|
|
nmap <silent> <C-j> <Plug>(ale_next)
|
|
|
|
" OR map keys to use wrapping.
|
|
|
|
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
|
|
|
|
nmap <silent> <C-j> <Plug>(ale_next_wrap)
|
|
|
|
<
|
|
|
|
|
2017-02-12 14:26:18 -05:00
|
|
|
ALEToggle *ALEToggle*
|
2017-03-28 18:04:58 -04:00
|
|
|
ALEEnable *ALEEnable*
|
|
|
|
ALEDisable *ALEDisable*
|
2017-02-12 14:26:18 -05:00
|
|
|
|
|
|
|
Enable or disable ALE, including all of its autocmd events, loclist items,
|
|
|
|
quickfix items, signs, current jobs, etc. Calling this option will change
|
|
|
|
the |g:ale_enabled| variable.
|
|
|
|
|
2017-03-02 21:55:22 -05:00
|
|
|
|
|
|
|
ALEDetail *ALEDetail*
|
|
|
|
|
|
|
|
Show the full linter message for the current line. This will only have an
|
|
|
|
effect on lines that contain a linter message.
|
|
|
|
|
|
|
|
A plug mapping `<Plug>(ale_detail)` is defined for this command.
|
|
|
|
|
2017-06-26 17:08:55 -04:00
|
|
|
|
|
|
|
ALEInfo *ALEInfo*
|
|
|
|
ALEInfoToClipboard *ALEInfoToClipboard*
|
|
|
|
|
|
|
|
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:ale_history_enabled| to `0`. Because it could be expensive, ALE
|
|
|
|
does not remember the output of recent commands by default. Set
|
|
|
|
|g:ale_history_log_output| to `1` to enable logging of output for commands.
|
|
|
|
ALE will only log the output captured for parsing problems, etc.
|
|
|
|
|
|
|
|
The command `:ALEInfoToClipboard` can be used to output ALEInfo directly to
|
|
|
|
your clipboard. This might not work on every machine.
|
|
|
|
|
|
|
|
|
2016-10-24 17:09:41 -04:00
|
|
|
===============================================================================
|
2017-05-20 14:01:12 -04:00
|
|
|
7. API *ale-api*
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-03-21 09:38:27 -04:00
|
|
|
ale#Queue(delay, [linting_flag]) *ale#Queue()*
|
2017-03-14 19:51:57 -04:00
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
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
|
|
|
|
again from the same buffer
|
|
|
|
|
2017-03-21 09:38:27 -04:00
|
|
|
An optional `linting_flag` argument can be given. If `linting_flag`
|
|
|
|
is `'lint_file'`, then linters where the `lint_file` option is set to `1` will be
|
|
|
|
run. Linters with `lint_file` set to `1` are not run by default.
|
2017-03-14 19:51:57 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
|
2017-03-31 15:14:53 -04:00
|
|
|
ale#engine#CreateDirectory(buffer) *ale#engine#CreateDirectory()*
|
|
|
|
|
|
|
|
Create a new temporary directory with a unique name, and manage that
|
|
|
|
directory with |ale#engine#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.
|
|
|
|
|
|
|
|
|
2017-02-11 13:14:18 -05:00
|
|
|
ale#engine#EscapeCommandPart(command_part) *ale#engine#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.
|
|
|
|
|
|
|
|
|
2016-10-24 15:21:32 -04:00
|
|
|
ale#engine#GetLoclist(buffer) *ale#engine#GetLoclist()*
|
|
|
|
|
|
|
|
Given a buffer number, this function will rerurn the list of warnings and
|
|
|
|
errors reported by ALE for a given buffer in the format accepted by
|
|
|
|
|setqflist()|.
|
|
|
|
|
|
|
|
|
2017-02-11 10:16:08 -05:00
|
|
|
ale#engine#ManageFile(buffer, filename) *ale#engine#ManageFile()*
|
|
|
|
|
|
|
|
Given a buffer number for a buffer currently running some linting tasks
|
|
|
|
and a filename, register a filename with ALE for automatic deletion after
|
|
|
|
linting 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 separetly with the |ale#engine#ManageDirectory| function.
|
|
|
|
|
|
|
|
|
|
|
|
ale#engine#ManageDirectory(buffer, directory) *ale#engine#ManageDirectory()*
|
|
|
|
|
|
|
|
Like |ale#engine#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#engine#ManageFile()| instead for deleting single
|
|
|
|
files.
|
|
|
|
|
|
|
|
|
2017-05-20 14:01:12 -04:00
|
|
|
ale#fix#registry#Add(name, func, filetypes, desc) *ale#fix#registry#Add()*
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
First pass at optimizing ale to autoload (#80)
* First pass at optimizing ale to autoload
First off, the structure/function names should be revised a bit,
but I will wait for @w0rp's input before unifying the naming style.
Second off, the docs probably need some more work, I just did some
simple find-and-replace work.
With that said, this pull brings major performance gains for ale. On my
slowest system, fully loading ale and all its code takes around 150ms.
I have moved all of ale's autoload-able code to autoload/, and in
addition, implemented lazy-loading of linters. This brings load time on
that same system down to 5ms.
The only downside of lazy loading is that `g:ale_linters` cannot be
changed at runtime; however, it also speeds up performance at runtime by
simplfying the logic greatly.
Please let me know what you think!
Closes #59
* Address Travis/Vint errors
For some reason, ale isn't running vint for me...
* Incorporate feedback, make fixes
Lazy-loading logic is much improved.
* Add header comments; remove incorrect workaround
* Remove unneeded plugin guards
* Fix lazy-loading linter logic
Set the wrong variable....
* Fix capitialization
2016-10-10 14:51:29 -04:00
|
|
|
ale#linter#Define(filetype, linter) *ale#linter#Define()*
|
2017-03-22 04:57:29 -04:00
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
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
|
|
|
|
|loclist|, etc.
|
|
|
|
|
|
|
|
This argument is required.
|
|
|
|
|
2017-02-26 09:51:22 -05:00
|
|
|
The keys for each item in the List will be handled in
|
|
|
|
the following manner:
|
|
|
|
|
|
|
|
`text` - This error message is required.
|
|
|
|
`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
|
|
|
|
coverted to number using `str2nr()`.
|
|
|
|
`bufnr` - The buffer number should match the buffer
|
|
|
|
being checked, and this value will default to
|
|
|
|
the buffer being checked.
|
|
|
|
`vcol` - Defaults to `0`.
|
|
|
|
`type` - Defaults to `'E'`.
|
|
|
|
`nr` - Defaults to `-1`.
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
`executable` A |String| naming the executable itself which
|
2017-03-01 19:06:09 -05:00
|
|
|
will be run. This value will be used to check if the
|
2016-10-05 19:22:32 -04:00
|
|
|
program requested is installed or not.
|
|
|
|
|
|
|
|
Either this or the `executable_callback` argument
|
|
|
|
must be provided.
|
|
|
|
|
|
|
|
`executable_callback ` A |String| or |Funcref| for a callback function
|
|
|
|
accepting a buffer number. A |String| should be
|
|
|
|
returned for the executable to check. This can be
|
|
|
|
used in place of `executable` when more complicated
|
|
|
|
processing is needed.
|
|
|
|
|
|
|
|
`command` A |String| for an executable to run asynchronously.
|
|
|
|
This command will be fed the lines from the buffer to
|
|
|
|
check, and will produce the lines of output given to
|
|
|
|
the `callback`.
|
|
|
|
|
|
|
|
`command_callback` A |String| or |Funcref| for a callback function
|
|
|
|
accepting a buffer number. A |String| should be
|
|
|
|
returned for a command to run. This can be used in
|
|
|
|
place of `command` when more complicated processing
|
|
|
|
is needed.
|
|
|
|
|
2017-02-10 18:11:26 -05:00
|
|
|
If an empty string is returned from the callback,
|
|
|
|
no jobs for linting will be run for that linter.
|
|
|
|
This can be used for skipping a linter call,
|
|
|
|
say if no configuration file was found.
|
|
|
|
|
2017-04-23 13:06:26 -04:00
|
|
|
*ale-command-chain*
|
2017-02-09 04:42:17 -05:00
|
|
|
`command_chain` A |List| of |Dictionary| items defining a series
|
|
|
|
of commands to be run. At least one |Dictionary|
|
|
|
|
should be provided. Each Dictionary must contain the
|
|
|
|
key `callback`, defining a |String| or |Funcref| for
|
|
|
|
a function returning a |String| for a command to run.
|
|
|
|
|
|
|
|
The callback functions for each command after the
|
|
|
|
first command in in the chain should accept two
|
|
|
|
arguments `(buffer, output)`, a buffer number and a
|
|
|
|
|List| of lines of output from the previous command
|
|
|
|
in the chain.
|
|
|
|
|
|
|
|
The first callback function in a chain accepts only
|
|
|
|
a `(buffer)` argument, as there are no previous
|
|
|
|
commands to run which return `output`.
|
|
|
|
|
2017-02-10 18:11:26 -05:00
|
|
|
If an empty string is returned for a command in a
|
|
|
|
chain, that command in the chain will be skipped,
|
|
|
|
and the next function in the chain will be called
|
|
|
|
immediately instead. If the last command in a chain
|
|
|
|
returns an empty string, then no linting will be
|
|
|
|
performed.
|
|
|
|
|
2017-02-09 04:42:17 -05:00
|
|
|
Commands in the chain will all use the
|
|
|
|
`output_stream` value provided in the root
|
|
|
|
|Dictionary|. Each command in the chain can also
|
|
|
|
provide an `output_stream` key to override this value.
|
|
|
|
See the `output_stream` description for more
|
|
|
|
information.
|
|
|
|
|
2017-02-09 18:32:57 -05:00
|
|
|
Commands in the chain all behave as if `read_buffer`
|
|
|
|
is set to `0` by default, except for the last command
|
|
|
|
in the chain, which uses the value set for
|
|
|
|
`read_buffer` in the root |Dictionary|. Each command
|
|
|
|
in the chain can also provide a `read_buffer` key
|
|
|
|
to override these values.
|
|
|
|
See the `read_buffer` description for more
|
|
|
|
information.
|
2017-02-09 04:42:17 -05:00
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
`output_stream` A |String| for the output stream the lines of output
|
|
|
|
should be read from for the command which is run. The
|
2016-10-07 12:08:11 -04:00
|
|
|
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.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2017-02-09 18:32:57 -05:00
|
|
|
`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.
|
|
|
|
|
2017-04-23 13:06:26 -04:00
|
|
|
*ale-lint-file*
|
2017-03-21 10:52:02 -04:00
|
|
|
`lint_file` A |Number| (`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.
|
|
|
|
|
|
|
|
Linters set with this option 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 with this option
|
|
|
|
set to `1` will also be run when linters are run
|
|
|
|
manually, per |ALELint-autocmd|.
|
|
|
|
|
|
|
|
When this option is set to `1`, `read_buffer` will
|
|
|
|
be set automatically to `0`. The two options cannot
|
|
|
|
be used together.
|
|
|
|
|
2017-05-27 16:27:42 -04:00
|
|
|
`aliases` A |List| of aliases for the linter name.
|
|
|
|
|
|
|
|
This option can be set with alternative names for
|
|
|
|
for selecting the linter with |g:ale_linters|. This
|
|
|
|
setting can make it easier to guess the linter name
|
|
|
|
by offering a few alternatives.
|
|
|
|
|
2017-02-09 04:42:17 -05:00
|
|
|
Only one of `command`, `command_callback`, or `command_chain` should be
|
|
|
|
specified. `command_callback` is generally recommended when a command string
|
|
|
|
needs to be generated dynamically, or any global options are used.
|
|
|
|
`command_chain` is recommended where any system calls need to be made to
|
|
|
|
retrieve some kind of information before running the final command.
|
|
|
|
|
2017-02-11 10:16:08 -05:00
|
|
|
If temporary files or directories are created for commands run with
|
|
|
|
`command_callback` or `command_chain`, then these tempoary files or
|
|
|
|
directories can be managed by ALE, for automatic deletion.
|
|
|
|
See |ale#engine#ManageFile()| and |ale#engine#ManageDirectory| for more
|
|
|
|
information.
|
|
|
|
|
2017-04-23 13:06:26 -04:00
|
|
|
*ale-command-format-strings*
|
|
|
|
|
2017-02-11 13:14:18 -05:00
|
|
|
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.
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
For example: >
|
2017-02-11 13:14:18 -05:00
|
|
|
'command': 'eslint -f unix --stdin --stdin-filename %s'
|
2016-10-05 19:22:32 -04:00
|
|
|
<
|
2017-02-11 13:14:18 -05:00
|
|
|
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
|
2017-03-01 19:06:09 -05:00
|
|
|
contents of the buffer being checked. All occurrences of `%t` in command
|
2017-02-11 13:14:18 -05:00
|
|
|
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 behaviour of
|
|
|
|
|ale#engine#ManageDirectory|. This option can be used for some linters which
|
|
|
|
do not support reading from stdin.
|
|
|
|
|
|
|
|
For example: >
|
|
|
|
'command': 'ghc -fno-code -v0 %t',
|
|
|
|
<
|
|
|
|
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.
|
|
|
|
|
|
|
|
If a callback for a command generates part of a command string which might
|
|
|
|
possibly contain `%%`, `%s`, or `%t` where the special formatting behaviour
|
|
|
|
is not desired, the |ale#engine#EscapeCommandPart()| function can be used to
|
|
|
|
replace those characters to avoid formatting issues.
|
|
|
|
|
2017-04-24 17:40:15 -04:00
|
|
|
*ale-linter-loading-behaviour*
|
|
|
|
|
|
|
|
Linters for ALE will be loaded by searching |runtimepath| in the following
|
|
|
|
format: >
|
|
|
|
|
|
|
|
ale_linters/<filetype>/<linter_name>.vim
|
|
|
|
<
|
|
|
|
Any linters which exist anywhere in |runtimepath| with that directory
|
|
|
|
structure will be automatically loaded for the matching |filetype|. Filetypes
|
|
|
|
containing `.` characters will be split into individual parts, and files
|
|
|
|
will be loaded for each filetype between the `.` characters.
|
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
|
First pass at optimizing ale to autoload (#80)
* First pass at optimizing ale to autoload
First off, the structure/function names should be revised a bit,
but I will wait for @w0rp's input before unifying the naming style.
Second off, the docs probably need some more work, I just did some
simple find-and-replace work.
With that said, this pull brings major performance gains for ale. On my
slowest system, fully loading ale and all its code takes around 150ms.
I have moved all of ale's autoload-able code to autoload/, and in
addition, implemented lazy-loading of linters. This brings load time on
that same system down to 5ms.
The only downside of lazy loading is that `g:ale_linters` cannot be
changed at runtime; however, it also speeds up performance at runtime by
simplfying the logic greatly.
Please let me know what you think!
Closes #59
* Address Travis/Vint errors
For some reason, ale isn't running vint for me...
* Incorporate feedback, make fixes
Lazy-loading logic is much improved.
* Add header comments; remove incorrect workaround
* Remove unneeded plugin guards
* Fix lazy-loading linter logic
Set the wrong variable....
* Fix capitialization
2016-10-10 14:51:29 -04:00
|
|
|
ale#linter#Get(filetype) *ale#linter#Get()*
|
2017-03-22 04:57:29 -04:00
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
Return all of linters configured for a given filetype as a |List| of
|
First pass at optimizing ale to autoload (#80)
* First pass at optimizing ale to autoload
First off, the structure/function names should be revised a bit,
but I will wait for @w0rp's input before unifying the naming style.
Second off, the docs probably need some more work, I just did some
simple find-and-replace work.
With that said, this pull brings major performance gains for ale. On my
slowest system, fully loading ale and all its code takes around 150ms.
I have moved all of ale's autoload-able code to autoload/, and in
addition, implemented lazy-loading of linters. This brings load time on
that same system down to 5ms.
The only downside of lazy loading is that `g:ale_linters` cannot be
changed at runtime; however, it also speeds up performance at runtime by
simplfying the logic greatly.
Please let me know what you think!
Closes #59
* Address Travis/Vint errors
For some reason, ale isn't running vint for me...
* Incorporate feedback, make fixes
Lazy-loading logic is much improved.
* Add header comments; remove incorrect workaround
* Remove unneeded plugin guards
* Fix lazy-loading linter logic
Set the wrong variable....
* Fix capitialization
2016-10-10 14:51:29 -04:00
|
|
|
|Dictionary| values in the format specified by |ale#linter#Define()|.
|
2016-10-05 19:22:32 -04:00
|
|
|
|
2016-10-22 09:29:30 -04:00
|
|
|
Filetypes may be dot-seperated 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:ale_linter_aliases|. Aliases
|
|
|
|
are applied after dot-seperated filetypes are broken up into their
|
|
|
|
components.
|
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
|
2017-05-25 08:32:46 -04:00
|
|
|
ale#statusline#Count(buffer) *ale#statusline#Count()*
|
2017-05-24 05:23:13 -04:00
|
|
|
|
2017-05-25 08:32:46 -04:00
|
|
|
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:
|
2017-03-22 04:57:29 -04:00
|
|
|
|
2017-05-24 05:23:13 -04:00
|
|
|
`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.
|
2016-10-07 12:48:47 -04:00
|
|
|
|
2016-10-09 16:20:21 -04:00
|
|
|
|
2017-02-28 04:10:58 -05:00
|
|
|
ALELint *ALELint-autocmd*
|
2017-03-22 04:57:29 -04:00
|
|
|
|
2016-10-13 09:01:48 -04:00
|
|
|
This |User| autocommand is triggered by ALE every time it completes a lint
|
2017-03-22 04:57:29 -04:00
|
|
|
cycle. It can be used to update statuslines, send notifications, or
|
|
|
|
complete any other operation that needs to be done after linting has been
|
|
|
|
performed.
|
2016-10-13 09:01:48 -04:00
|
|
|
|
2017-03-22 04:57:29 -04:00
|
|
|
For example, you can echo a message when linting is complete like so:
|
|
|
|
>
|
|
|
|
autocmd User ALELint echom "ALE run!"
|
|
|
|
<
|
2016-10-13 09:01:48 -04:00
|
|
|
|
2016-10-11 16:55:26 -04:00
|
|
|
===============================================================================
|
2017-05-20 14:01:12 -04:00
|
|
|
8. Special Thanks *ale-special-thanks*
|
2016-10-11 16:55:26 -04:00
|
|
|
|
|
|
|
Special thanks to Mark Grealish (https://www.bhalash.com/) for providing ALE's
|
|
|
|
snazzy looking ale glass logo. Cheers, Mark!
|
2016-10-09 16:20:21 -04:00
|
|
|
|
2016-10-05 19:22:32 -04:00
|
|
|
===============================================================================
|
2017-05-20 14:01:12 -04:00
|
|
|
9. Contact *ale-contact*
|
2016-10-05 19:22:32 -04:00
|
|
|
|
|
|
|
If you like this plugin, and wish to get in touch, check out the GitHub
|
|
|
|
page for issues and more at https://github.com/w0rp/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:
|