2017-03-28 22:25:44 +00:00
|
|
|
*ale.txt* For Vim version 8.0.
|
2016-11-02 06:19:24 +00:00
|
|
|
*ale*
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-10 11:53:54 +00:00
|
|
|
ALE - Asynchronous Lint Engine
|
2016-10-05 23:22:32 +00:00
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
CONTENTS *ale-contents*
|
|
|
|
|
2017-01-15 13:20:23 +00:00
|
|
|
1. Introduction.........................|ale-introduction|
|
|
|
|
2. Supported Languages & Tools..........|ale-support|
|
2017-08-28 21:05:12 +00:00
|
|
|
3. Linting..............................|ale-lint|
|
2018-10-29 18:28:28 +00:00
|
|
|
3.1 Other Sources.....................|ale-lint-other-sources|
|
2017-05-20 18:01:12 +00:00
|
|
|
4. Fixing Problems......................|ale-fix|
|
2017-11-26 23:02:51 +00:00
|
|
|
5. Language Server Protocol Support.....|ale-lsp|
|
|
|
|
5.1 Completion........................|ale-completion|
|
|
|
|
5.2 Go To Definition..................|ale-go-to-definition|
|
2018-04-22 18:49:24 +00:00
|
|
|
5.3 Find References...................|ale-find-references|
|
2018-10-31 16:13:22 +00:00
|
|
|
5.4 Hovering..........................|ale-hover|
|
|
|
|
5.5 Symbol Search.....................|ale-symbol-search|
|
2017-08-28 21:05:12 +00:00
|
|
|
6. Global Options.......................|ale-options|
|
|
|
|
6.1 Highlights........................|ale-highlights|
|
2017-10-24 23:27:40 +00:00
|
|
|
6.2 Options for write-good Linter.....|ale-write-good-options|
|
2017-08-28 21:05:12 +00:00
|
|
|
7. Integration Documentation............|ale-integrations|
|
2018-10-18 08:19:27 +00:00
|
|
|
ansible...............................|ale-ansible-options|
|
|
|
|
ansible-lint........................|ale-ansible-ansible-lint|
|
2017-10-24 23:27:40 +00:00
|
|
|
asciidoc..............................|ale-asciidoc-options|
|
|
|
|
write-good..........................|ale-asciidoc-write-good|
|
2017-03-28 22:25:44 +00:00
|
|
|
asm...................................|ale-asm-options|
|
|
|
|
gcc.................................|ale-asm-gcc|
|
2017-09-10 18:42:45 +00:00
|
|
|
awk...................................|ale-awk-options|
|
|
|
|
gawk................................|ale-awk-gawk|
|
2017-03-28 22:25:44 +00:00
|
|
|
c.....................................|ale-c-options|
|
|
|
|
clang...............................|ale-c-clang|
|
2018-07-22 17:30:57 +00:00
|
|
|
clangd..............................|ale-c-clangd|
|
2017-09-10 18:42:45 +00:00
|
|
|
clang-format........................|ale-c-clangformat|
|
2017-08-05 13:21:02 +00:00
|
|
|
clangtidy...........................|ale-c-clangtidy|
|
2017-03-28 22:25:44 +00:00
|
|
|
cppcheck............................|ale-c-cppcheck|
|
2018-07-25 04:23:13 +00:00
|
|
|
cquery..............................|ale-c-cquery|
|
2018-02-25 14:11:04 +00:00
|
|
|
flawfinder..........................|ale-c-flawfinder|
|
2017-03-28 22:25:44 +00:00
|
|
|
gcc.................................|ale-c-gcc|
|
2018-09-05 00:39:32 +00:00
|
|
|
uncrustify..........................|ale-c-uncrustify|
|
2018-09-26 12:09:37 +00:00
|
|
|
ccls................................|ale-c-ccls|
|
2017-04-05 17:21:47 +00:00
|
|
|
chef..................................|ale-chef-options|
|
|
|
|
foodcritic..........................|ale-chef-foodcritic|
|
2017-11-15 21:46:51 +00:00
|
|
|
clojure...............................|ale-clojure-options|
|
|
|
|
joker...............................|ale-clojure-joker|
|
2018-06-04 16:23:25 +00:00
|
|
|
cloudformation........................|ale-cloudformation-options|
|
|
|
|
cfn-python-lint.....................|ale-cloudformation-cfn-python-lint|
|
2017-09-10 18:42:45 +00:00
|
|
|
cmake.................................|ale-cmake-options|
|
|
|
|
cmakelint...........................|ale-cmake-cmakelint|
|
2017-03-28 22:25:44 +00:00
|
|
|
cpp...................................|ale-cpp-options|
|
|
|
|
clang...............................|ale-cpp-clang|
|
2018-08-22 11:35:10 +00:00
|
|
|
clangd..............................|ale-cpp-clangd|
|
2017-06-24 15:10:04 +00:00
|
|
|
clangcheck..........................|ale-cpp-clangcheck|
|
2017-09-10 18:42:45 +00:00
|
|
|
clang-format........................|ale-cpp-clangformat|
|
2017-03-28 22:25:44 +00:00
|
|
|
clangtidy...........................|ale-cpp-clangtidy|
|
2018-08-24 09:52:33 +00:00
|
|
|
clazy...............................|ale-cpp-clazy|
|
2017-03-28 22:25:44 +00:00
|
|
|
cppcheck............................|ale-cpp-cppcheck|
|
2017-05-10 17:41:58 +00:00
|
|
|
cpplint.............................|ale-cpp-cpplint|
|
2018-06-06 16:03:15 +00:00
|
|
|
cquery..............................|ale-cpp-cquery|
|
2018-02-25 14:11:04 +00:00
|
|
|
flawfinder..........................|ale-cpp-flawfinder|
|
2017-03-28 22:25:44 +00:00
|
|
|
gcc.................................|ale-cpp-gcc|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-cpp-uncrustify|
|
2018-09-26 12:09:37 +00:00
|
|
|
ccls................................|ale-cpp-ccls|
|
2017-09-26 07:19:53 +00:00
|
|
|
c#....................................|ale-cs-options|
|
|
|
|
mcs.................................|ale-cs-mcs|
|
|
|
|
mcsc................................|ale-cs-mcsc|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-cs-uncrustify|
|
2017-03-28 22:25:44 +00:00
|
|
|
css...................................|ale-css-options|
|
2017-09-06 14:21:26 +00:00
|
|
|
prettier............................|ale-css-prettier|
|
2017-03-28 22:25:44 +00:00
|
|
|
stylelint...........................|ale-css-stylelint|
|
2017-09-10 18:42:45 +00:00
|
|
|
cuda..................................|ale-cuda-options|
|
|
|
|
nvcc................................|ale-cuda-nvcc|
|
2018-09-05 00:39:32 +00:00
|
|
|
d.....................................|ale-d-options|
|
2018-10-17 15:11:41 +00:00
|
|
|
dls.................................|ale-d-dls|
|
2018-09-07 19:28:51 +00:00
|
|
|
uncrustify..........................|ale-d-uncrustify|
|
2017-07-18 22:57:33 +00:00
|
|
|
dart..................................|ale-dart-options|
|
|
|
|
dartanalyzer........................|ale-dart-dartanalyzer|
|
2018-07-01 12:55:41 +00:00
|
|
|
dartfmt.............................|ale-dart-dartfmt|
|
2017-09-10 18:42:45 +00:00
|
|
|
dockerfile............................|ale-dockerfile-options|
|
2018-10-26 16:34:32 +00:00
|
|
|
dockerfile_lint.....................|ale-dockerfile-dockerfile_lint|
|
2017-09-10 18:42:45 +00:00
|
|
|
hadolint............................|ale-dockerfile-hadolint|
|
2017-10-22 23:44:44 +00:00
|
|
|
elixir................................|ale-elixir-options|
|
|
|
|
mix.................................|ale-elixir-mix|
|
2018-03-08 14:37:56 +00:00
|
|
|
mix_format..........................|ale-elixir-mix-format|
|
2018-01-22 12:21:07 +00:00
|
|
|
dialyxir............................|ale-elixir-dialyxir|
|
2018-09-28 18:42:50 +00:00
|
|
|
elixir-ls...........................|ale-elixir-elixir-ls|
|
2017-09-10 18:42:45 +00:00
|
|
|
elm...................................|ale-elm-options|
|
|
|
|
elm-format..........................|ale-elm-elm-format|
|
|
|
|
elm-make............................|ale-elm-elm-make|
|
2017-03-28 22:25:44 +00:00
|
|
|
erlang................................|ale-erlang-options|
|
|
|
|
erlc................................|ale-erlang-erlc|
|
2017-07-16 11:35:43 +00:00
|
|
|
syntaxerl...........................|ale-erlang-syntaxerl|
|
2017-08-21 20:34:42 +00:00
|
|
|
eruby.................................|ale-eruby-options|
|
2017-12-19 19:40:00 +00:00
|
|
|
ruumba..............................|ale-eruby-ruumba|
|
2017-12-26 18:00:28 +00:00
|
|
|
fish..................................|ale-fish-options|
|
2017-03-28 22:25:44 +00:00
|
|
|
fortran...............................|ale-fortran-options|
|
|
|
|
gcc.................................|ale-fortran-gcc|
|
2018-07-19 21:27:47 +00:00
|
|
|
language_server.....................|ale-fortran-language-server|
|
2018-01-02 13:22:40 +00:00
|
|
|
fountain..............................|ale-fountain-options|
|
2017-06-14 08:37:24 +00:00
|
|
|
fusionscript..........................|ale-fuse-options|
|
|
|
|
fusion-lint.........................|ale-fuse-fusionlint|
|
2017-12-20 10:10:07 +00:00
|
|
|
git commit............................|ale-gitcommit-options|
|
|
|
|
gitlint.............................|ale-gitcommit-gitlint|
|
2017-09-08 10:06:47 +00:00
|
|
|
glsl..................................|ale-glsl-options|
|
|
|
|
glslang.............................|ale-glsl-glslang|
|
2017-12-01 17:36:44 +00:00
|
|
|
glslls..............................|ale-glsl-glslls|
|
2017-04-15 20:04:43 +00:00
|
|
|
go....................................|ale-go-options|
|
2018-02-04 13:55:09 +00:00
|
|
|
gobuild.............................|ale-go-gobuild|
|
2017-10-03 17:54:35 +00:00
|
|
|
gofmt...............................|ale-go-gofmt|
|
2018-11-11 09:42:57 +00:00
|
|
|
golint..............................|ale-go-golint|
|
2018-08-16 02:02:51 +00:00
|
|
|
govet...............................|ale-go-govet|
|
2017-04-15 20:04:43 +00:00
|
|
|
gometalinter........................|ale-go-gometalinter|
|
2018-02-15 11:23:36 +00:00
|
|
|
staticcheck.........................|ale-go-staticcheck|
|
2018-08-30 02:39:03 +00:00
|
|
|
golangserver........................|ale-go-golangserver|
|
2018-09-06 19:31:12 +00:00
|
|
|
golangci-lint.......................|ale-go-golangci-lint|
|
2017-08-20 12:36:46 +00:00
|
|
|
graphql...............................|ale-graphql-options|
|
2017-11-27 14:22:05 +00:00
|
|
|
eslint..............................|ale-graphql-eslint|
|
2017-08-20 12:36:46 +00:00
|
|
|
gqlint..............................|ale-graphql-gqlint|
|
2018-01-05 12:02:05 +00:00
|
|
|
prettier............................|ale-graphql-prettier|
|
2018-07-27 20:50:59 +00:00
|
|
|
hack..................................|ale-hack-options|
|
|
|
|
hack................................|ale-hack-hack|
|
|
|
|
hackfmt.............................|ale-hack-hackfmt|
|
|
|
|
hhast...............................|ale-hack-hhast|
|
2017-04-07 14:38:50 +00:00
|
|
|
handlebars............................|ale-handlebars-options|
|
|
|
|
ember-template-lint.................|ale-handlebars-embertemplatelint|
|
2017-07-11 12:05:13 +00:00
|
|
|
haskell...............................|ale-haskell-options|
|
2017-11-28 22:58:13 +00:00
|
|
|
brittany............................|ale-haskell-brittany|
|
2018-01-02 04:28:49 +00:00
|
|
|
ghc.................................|ale-haskell-ghc|
|
2018-09-28 08:05:01 +00:00
|
|
|
ghc-mod.............................|ale-haskell-ghc-mod|
|
2018-07-20 14:30:16 +00:00
|
|
|
cabal-ghc...........................|ale-haskell-cabal-ghc|
|
2017-09-10 18:42:45 +00:00
|
|
|
hdevtools...........................|ale-haskell-hdevtools|
|
2017-10-24 21:29:04 +00:00
|
|
|
hfmt................................|ale-haskell-hfmt|
|
2018-08-23 22:23:54 +00:00
|
|
|
hlint...............................|ale-haskell-hlint|
|
2017-07-11 12:05:13 +00:00
|
|
|
stack-build.........................|ale-haskell-stack-build|
|
2018-08-23 22:14:59 +00:00
|
|
|
stylish-haskell.....................|ale-haskell-stylish-haskell|
|
2018-08-02 19:24:58 +00:00
|
|
|
hie.................................|ale-haskell-hie|
|
2018-10-24 00:44:31 +00:00
|
|
|
hcl...................................|ale-hcl-options|
|
|
|
|
terraform-fmt.......................|ale-hcl-terraform-fmt|
|
2017-03-28 22:25:44 +00:00
|
|
|
html..................................|ale-html-options|
|
|
|
|
htmlhint............................|ale-html-htmlhint|
|
|
|
|
tidy................................|ale-html-tidy|
|
2018-11-07 06:30:52 +00:00
|
|
|
prettier............................|ale-html-prettier|
|
2018-08-23 20:23:04 +00:00
|
|
|
stylelint...........................|ale-html-stylelint|
|
2018-08-24 12:24:42 +00:00
|
|
|
write-good..........................|ale-html-write-good|
|
2017-08-10 20:09:58 +00:00
|
|
|
idris.................................|ale-idris-options|
|
|
|
|
idris...............................|ale-idris-idris|
|
2017-03-28 22:25:44 +00:00
|
|
|
java..................................|ale-java-options|
|
2017-05-12 13:42:32 +00:00
|
|
|
checkstyle..........................|ale-java-checkstyle|
|
2017-03-28 22:25:44 +00:00
|
|
|
javac...............................|ale-java-javac|
|
2017-12-09 13:52:15 +00:00
|
|
|
google-java-format..................|ale-java-google-java-format|
|
2018-04-09 15:45:08 +00:00
|
|
|
pmd.................................|ale-java-pmd|
|
2018-08-26 11:58:17 +00:00
|
|
|
javalsp.............................|ale-java-javalsp|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-java-uncrustify|
|
2017-03-28 22:25:44 +00:00
|
|
|
javascript............................|ale-javascript-options|
|
|
|
|
eslint..............................|ale-javascript-eslint|
|
|
|
|
flow................................|ale-javascript-flow|
|
2017-12-04 15:29:44 +00:00
|
|
|
importjs............................|ale-javascript-importjs|
|
2017-09-10 18:42:45 +00:00
|
|
|
jscs................................|ale-javascript-jscs|
|
2017-03-28 22:25:44 +00:00
|
|
|
jshint..............................|ale-javascript-jshint|
|
2017-05-27 17:31:52 +00:00
|
|
|
prettier............................|ale-javascript-prettier|
|
|
|
|
prettier-eslint.....................|ale-javascript-prettier-eslint|
|
2017-06-28 15:35:19 +00:00
|
|
|
prettier-standard...................|ale-javascript-prettier-standard|
|
2017-03-28 22:48:55 +00:00
|
|
|
standard............................|ale-javascript-standard|
|
2017-03-28 22:25:44 +00:00
|
|
|
xo..................................|ale-javascript-xo|
|
2017-09-06 14:21:26 +00:00
|
|
|
json..................................|ale-json-options|
|
2018-01-24 10:36:02 +00:00
|
|
|
fixjson.............................|ale-json-fixjson|
|
2017-09-06 14:21:26 +00:00
|
|
|
jsonlint............................|ale-json-jsonlint|
|
2018-01-24 10:12:29 +00:00
|
|
|
jq..................................|ale-json-jq|
|
2017-09-06 14:21:26 +00:00
|
|
|
prettier............................|ale-json-prettier|
|
2018-09-08 18:11:11 +00:00
|
|
|
julia.................................|ale-julia-options|
|
|
|
|
languageserver......................|ale-julia-languageserver|
|
2017-05-02 17:27:04 +00:00
|
|
|
kotlin................................|ale-kotlin-options|
|
|
|
|
kotlinc.............................|ale-kotlin-kotlinc|
|
2017-09-10 18:42:45 +00:00
|
|
|
ktlint..............................|ale-kotlin-ktlint|
|
2018-07-15 17:54:18 +00:00
|
|
|
languageserver......................|ale-kotlin-languageserver|
|
2017-10-24 23:27:40 +00:00
|
|
|
latex.................................|ale-latex-options|
|
|
|
|
write-good..........................|ale-latex-write-good|
|
2017-10-21 01:29:57 +00:00
|
|
|
less..................................|ale-less-options|
|
2017-11-12 11:25:24 +00:00
|
|
|
lessc...............................|ale-less-lessc|
|
2017-10-21 01:29:57 +00:00
|
|
|
prettier............................|ale-less-prettier|
|
2017-11-12 12:09:19 +00:00
|
|
|
stylelint...........................|ale-less-stylelint|
|
2017-10-10 09:13:09 +00:00
|
|
|
llvm..................................|ale-llvm-options|
|
|
|
|
llc.................................|ale-llvm-llc|
|
2017-03-28 22:25:44 +00:00
|
|
|
lua...................................|ale-lua-options|
|
2018-01-08 15:19:17 +00:00
|
|
|
luac................................|ale-lua-luac|
|
2017-03-28 22:25:44 +00:00
|
|
|
luacheck............................|ale-lua-luacheck|
|
2017-10-24 23:27:40 +00:00
|
|
|
markdown..............................|ale-markdown-options|
|
2018-02-26 03:46:51 +00:00
|
|
|
mdl.................................|ale-markdown-mdl|
|
2018-01-15 02:22:09 +00:00
|
|
|
prettier............................|ale-markdown-prettier|
|
2018-07-16 12:34:30 +00:00
|
|
|
remark-lint.........................|ale-markdown-remark-lint|
|
2018-03-24 05:39:05 +00:00
|
|
|
textlint............................|ale-markdown-textlint|
|
2017-10-24 23:27:40 +00:00
|
|
|
write-good..........................|ale-markdown-write-good|
|
2018-03-25 17:43:51 +00:00
|
|
|
mercury...............................|ale-mercury-options|
|
|
|
|
mmc.................................|ale-mercury-mmc|
|
2018-05-04 19:44:32 +00:00
|
|
|
nasm..................................|ale-nasm-options|
|
|
|
|
nasm................................|ale-nasm-nasm|
|
2017-10-24 23:27:40 +00:00
|
|
|
nroff.................................|ale-nroff-options|
|
|
|
|
write-good..........................|ale-nroff-write-good|
|
2017-05-19 16:41:57 +00:00
|
|
|
objc..................................|ale-objc-options|
|
|
|
|
clang...............................|ale-objc-clang|
|
2018-08-22 11:35:10 +00:00
|
|
|
clangd..............................|ale-objc-clangd|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-objc-uncrustify|
|
2018-09-26 12:09:37 +00:00
|
|
|
ccls................................|ale-objc-ccls|
|
2017-05-19 16:41:57 +00:00
|
|
|
objcpp................................|ale-objcpp-options|
|
|
|
|
clang...............................|ale-objcpp-clang|
|
2018-08-22 11:35:10 +00:00
|
|
|
clangd..............................|ale-objcpp-clangd|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-objcpp-uncrustify|
|
2017-03-28 22:25:44 +00:00
|
|
|
ocaml.................................|ale-ocaml-options|
|
|
|
|
merlin..............................|ale-ocaml-merlin|
|
2017-11-11 18:27:41 +00:00
|
|
|
ols.................................|ale-ocaml-ols|
|
2018-08-26 11:47:56 +00:00
|
|
|
ocamlformat.........................|ale-ocaml-ocamlformat|
|
2018-09-05 00:39:32 +00:00
|
|
|
pawn..................................|ale-pawn-options|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-pawn-uncrustify|
|
2017-03-28 22:25:44 +00:00
|
|
|
perl..................................|ale-perl-options|
|
|
|
|
perl................................|ale-perl-perl|
|
2017-06-11 20:13:47 +00:00
|
|
|
perlcritic..........................|ale-perl-perlcritic|
|
2018-04-21 13:09:38 +00:00
|
|
|
perltidy............................|ale-perl-perltidy|
|
2018-09-28 23:18:40 +00:00
|
|
|
perl6.................................|ale-perl6-options|
|
|
|
|
perl6...............................|ale-perl6-perl6|
|
2017-03-28 22:25:44 +00:00
|
|
|
php...................................|ale-php-options|
|
2017-08-07 12:08:51 +00:00
|
|
|
langserver..........................|ale-php-langserver|
|
2017-10-24 21:25:02 +00:00
|
|
|
phan................................|ale-php-phan|
|
2017-09-10 18:42:45 +00:00
|
|
|
phpcbf..............................|ale-php-phpcbf|
|
2017-03-28 22:25:44 +00:00
|
|
|
phpcs...............................|ale-php-phpcs|
|
|
|
|
phpmd...............................|ale-php-phpmd|
|
2017-07-16 14:04:25 +00:00
|
|
|
phpstan.............................|ale-php-phpstan|
|
2018-09-27 15:48:47 +00:00
|
|
|
psalm...............................|ale-php-psalm|
|
2018-03-01 14:41:05 +00:00
|
|
|
php-cs-fixer........................|ale-php-php-cs-fixer|
|
2018-11-01 17:20:48 +00:00
|
|
|
php.................................|ale-php-php|
|
2018-01-27 11:40:40 +00:00
|
|
|
po....................................|ale-po-options|
|
|
|
|
write-good..........................|ale-po-write-good|
|
2017-10-24 23:27:40 +00:00
|
|
|
pod...................................|ale-pod-options|
|
|
|
|
write-good..........................|ale-pod-write-good|
|
2018-02-10 19:04:43 +00:00
|
|
|
pony..................................|ale-pony-options|
|
|
|
|
ponyc...............................|ale-pony-ponyc|
|
2018-10-26 16:29:17 +00:00
|
|
|
prolog................................|ale-prolog-options|
|
|
|
|
swipl...............................|ale-prolog-swipl|
|
2017-11-10 09:37:23 +00:00
|
|
|
proto.................................|ale-proto-options|
|
|
|
|
protoc-gen-lint.....................|ale-proto-protoc-gen-lint|
|
2017-06-29 10:40:03 +00:00
|
|
|
pug...................................|ale-pug-options|
|
|
|
|
puglint.............................|ale-pug-puglint|
|
2017-09-10 18:42:45 +00:00
|
|
|
puppet................................|ale-puppet-options|
|
2018-08-27 18:12:56 +00:00
|
|
|
puppet..............................|ale-puppet-puppet|
|
2017-09-10 18:42:45 +00:00
|
|
|
puppetlint..........................|ale-puppet-puppetlint|
|
2018-07-04 11:36:50 +00:00
|
|
|
puppet-languageserver...............|ale-puppet-languageserver|
|
2018-06-25 07:51:50 +00:00
|
|
|
pyrex (cython)........................|ale-pyrex-options|
|
|
|
|
cython..............................|ale-pyrex-cython|
|
2017-03-28 22:25:44 +00:00
|
|
|
python................................|ale-python-options|
|
2017-06-18 10:03:31 +00:00
|
|
|
autopep8............................|ale-python-autopep8|
|
2018-04-06 09:08:25 +00:00
|
|
|
black...............................|ale-python-black|
|
2017-03-28 22:25:44 +00:00
|
|
|
flake8..............................|ale-python-flake8|
|
2017-06-18 10:03:31 +00:00
|
|
|
isort...............................|ale-python-isort|
|
2017-03-28 22:25:44 +00:00
|
|
|
mypy................................|ale-python-mypy|
|
2017-12-01 17:04:30 +00:00
|
|
|
prospector..........................|ale-python-prospector|
|
2017-08-25 11:46:56 +00:00
|
|
|
pycodestyle.........................|ale-python-pycodestyle|
|
2018-06-05 02:43:02 +00:00
|
|
|
pyflakes............................|ale-python-pyflakes|
|
2017-03-28 22:25:44 +00:00
|
|
|
pylint..............................|ale-python-pylint|
|
2017-11-08 17:58:56 +00:00
|
|
|
pyls................................|ale-python-pyls|
|
2018-07-01 18:59:49 +00:00
|
|
|
pyre................................|ale-python-pyre|
|
2018-07-26 07:41:27 +00:00
|
|
|
vulture.............................|ale-python-vulture|
|
2017-06-18 10:03:31 +00:00
|
|
|
yapf................................|ale-python-yapf|
|
2018-04-05 19:09:41 +00:00
|
|
|
qml...................................|ale-qml-options|
|
|
|
|
qmlfmt..............................|ale-qml-qmlfmt|
|
2017-09-03 22:36:58 +00:00
|
|
|
r.....................................|ale-r-options|
|
|
|
|
lintr...............................|ale-r-lintr|
|
2017-09-10 18:42:45 +00:00
|
|
|
reasonml..............................|ale-reasonml-options|
|
|
|
|
merlin..............................|ale-reasonml-merlin|
|
2017-11-11 18:27:41 +00:00
|
|
|
ols.................................|ale-reasonml-ols|
|
2017-10-29 15:27:52 +00:00
|
|
|
refmt...............................|ale-reasonml-refmt|
|
2017-10-24 23:27:40 +00:00
|
|
|
restructuredtext......................|ale-restructuredtext-options|
|
|
|
|
write-good..........................|ale-restructuredtext-write-good|
|
2017-03-28 22:25:44 +00:00
|
|
|
ruby..................................|ale-ruby-options|
|
2017-07-12 09:43:47 +00:00
|
|
|
brakeman............................|ale-ruby-brakeman|
|
|
|
|
rails_best_practices................|ale-ruby-rails_best_practices|
|
2017-04-20 06:37:08 +00:00
|
|
|
reek................................|ale-ruby-reek|
|
2017-03-28 22:25:44 +00:00
|
|
|
rubocop.............................|ale-ruby-rubocop|
|
2017-11-28 09:47:04 +00:00
|
|
|
ruby................................|ale-ruby-ruby|
|
2018-03-11 04:33:57 +00:00
|
|
|
rufo................................|ale-ruby-rufo|
|
2018-08-24 04:02:51 +00:00
|
|
|
solargraph..........................|ale-ruby-solargraph|
|
2017-03-28 22:25:44 +00:00
|
|
|
rust..................................|ale-rust-options|
|
|
|
|
cargo...............................|ale-rust-cargo|
|
2017-08-07 12:00:17 +00:00
|
|
|
rls.................................|ale-rust-rls|
|
2017-03-28 22:25:44 +00:00
|
|
|
rustc...............................|ale-rust-rustc|
|
2017-10-21 17:31:49 +00:00
|
|
|
rustfmt.............................|ale-rust-rustfmt|
|
2017-03-28 22:25:44 +00:00
|
|
|
sass..................................|ale-sass-options|
|
|
|
|
stylelint...........................|ale-sass-stylelint|
|
2017-07-13 22:41:01 +00:00
|
|
|
scala.................................|ale-scala-options|
|
2018-08-27 05:12:56 +00:00
|
|
|
sbtserver...........................|ale-scala-sbtserver|
|
2018-06-02 18:59:53 +00:00
|
|
|
scalafmt............................|ale-scala-scalafmt|
|
2017-07-13 22:41:01 +00:00
|
|
|
scalastyle..........................|ale-scala-scalastyle|
|
2017-03-28 22:25:44 +00:00
|
|
|
scss..................................|ale-scss-options|
|
2017-09-06 14:21:26 +00:00
|
|
|
prettier............................|ale-scss-prettier|
|
2017-03-28 22:25:44 +00:00
|
|
|
stylelint...........................|ale-scss-stylelint|
|
|
|
|
sh....................................|ale-sh-options|
|
2018-06-07 17:55:43 +00:00
|
|
|
sh-language-server..................|ale-sh-language-server|
|
2017-03-28 22:25:44 +00:00
|
|
|
shell...............................|ale-sh-shell|
|
|
|
|
shellcheck..........................|ale-sh-shellcheck|
|
2017-11-05 21:24:41 +00:00
|
|
|
shfmt...............................|ale-sh-shfmt|
|
2017-09-03 18:56:14 +00:00
|
|
|
sml...................................|ale-sml-options|
|
|
|
|
smlnj...............................|ale-sml-smlnj|
|
2017-09-13 17:45:18 +00:00
|
|
|
solidity..............................|ale-solidity-options|
|
2017-12-04 17:23:34 +00:00
|
|
|
solhint.............................|ale-solidity-solhint|
|
2017-09-13 17:45:18 +00:00
|
|
|
solium..............................|ale-solidity-solium|
|
2017-04-19 22:40:58 +00:00
|
|
|
spec..................................|ale-spec-options|
|
|
|
|
rpmlint.............................|ale-spec-rpmlint|
|
2018-09-07 22:55:26 +00:00
|
|
|
sql...................................|ale-sql-options|
|
|
|
|
sqlfmt..............................|ale-sql-sqlfmt|
|
2017-07-03 15:57:39 +00:00
|
|
|
stylus................................|ale-stylus-options|
|
|
|
|
stylelint...........................|ale-stylus-stylelint|
|
2017-08-02 22:05:19 +00:00
|
|
|
tcl...................................|ale-tcl-options|
|
|
|
|
nagelfar............................|ale-tcl-nagelfar|
|
2017-10-26 18:32:33 +00:00
|
|
|
terraform.............................|ale-terraform-options|
|
2018-10-24 00:44:31 +00:00
|
|
|
fmt.................................|ale-terraform-fmt|
|
2017-10-26 18:32:33 +00:00
|
|
|
tflint..............................|ale-terraform-tflint|
|
2017-03-28 22:25:44 +00:00
|
|
|
tex...................................|ale-tex-options|
|
|
|
|
chktex..............................|ale-tex-chktex|
|
|
|
|
lacheck.............................|ale-tex-lacheck|
|
2017-10-24 23:27:40 +00:00
|
|
|
texinfo...............................|ale-texinfo-options|
|
|
|
|
write-good..........................|ale-texinfo-write-good|
|
|
|
|
text..................................|ale-text-options|
|
2018-03-24 05:39:05 +00:00
|
|
|
textlint............................|ale-text-textlint|
|
2017-10-24 23:27:40 +00:00
|
|
|
write-good..........................|ale-text-write-good|
|
2017-08-30 17:59:40 +00:00
|
|
|
thrift................................|ale-thrift-options|
|
|
|
|
thrift..............................|ale-thrift-thrift|
|
2017-04-18 08:28:54 +00:00
|
|
|
typescript............................|ale-typescript-options|
|
2017-06-20 09:50:38 +00:00
|
|
|
eslint..............................|ale-typescript-eslint|
|
2017-09-06 14:21:26 +00:00
|
|
|
prettier............................|ale-typescript-prettier|
|
2017-04-18 08:28:54 +00:00
|
|
|
tslint..............................|ale-typescript-tslint|
|
2017-06-13 16:59:09 +00:00
|
|
|
tsserver............................|ale-typescript-tsserver|
|
2018-09-05 00:39:32 +00:00
|
|
|
vala..................................|ale-vala-options|
|
2018-09-07 01:59:03 +00:00
|
|
|
uncrustify..........................|ale-vala-uncrustify|
|
2017-06-29 08:15:52 +00:00
|
|
|
verilog/systemverilog.................|ale-verilog-options|
|
|
|
|
iverilog............................|ale-verilog-iverilog|
|
|
|
|
verilator...........................|ale-verilog-verilator|
|
2017-03-28 22:25:44 +00:00
|
|
|
vim...................................|ale-vim-options|
|
|
|
|
vint................................|ale-vim-vint|
|
2017-10-24 23:27:40 +00:00
|
|
|
vim help..............................|ale-vim-help-options|
|
|
|
|
write-good..........................|ale-vim-help-write-good|
|
2018-01-31 16:29:01 +00:00
|
|
|
vue...................................|ale-vue-options|
|
|
|
|
prettier............................|ale-vue-prettier|
|
2018-07-05 12:04:20 +00:00
|
|
|
vls.................................|ale-vue-vls|
|
2017-10-24 23:27:40 +00:00
|
|
|
xhtml.................................|ale-xhtml-options|
|
|
|
|
write-good..........................|ale-xhtml-write-good|
|
2017-05-18 08:31:12 +00:00
|
|
|
xml...................................|ale-xml-options|
|
|
|
|
xmllint.............................|ale-xml-xmllint|
|
2017-03-28 22:25:44 +00:00
|
|
|
yaml..................................|ale-yaml-options|
|
2018-08-08 17:48:28 +00:00
|
|
|
prettier............................|ale-yaml-prettier|
|
2017-07-17 19:28:21 +00:00
|
|
|
swaglint............................|ale-yaml-swaglint|
|
2017-03-28 22:25:44 +00:00
|
|
|
yamllint............................|ale-yaml-yamllint|
|
2018-08-03 19:59:32 +00:00
|
|
|
yang..................................|ale-yang-options|
|
|
|
|
yang-lsp............................|ale-yang-lsp|
|
2017-08-28 21:05:12 +00:00
|
|
|
8. Commands/Keybinds....................|ale-commands|
|
|
|
|
9. API..................................|ale-api|
|
|
|
|
10. Special Thanks......................|ale-special-thanks|
|
|
|
|
11. Contact.............................|ale-contact|
|
2016-10-05 23:22:32 +00: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,
|
2018-03-21 16:02:43 +00:00
|
|
|
Vim must be compiled with the |job| and |channel| and |timers| features
|
2016-10-05 23:22:32 +00:00
|
|
|
as a minimum.
|
|
|
|
|
2017-05-20 18:01:12 +00:00
|
|
|
ALE supports the following key features for linting:
|
2016-10-05 23:22:32 +00: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 18:01:12 +00:00
|
|
|
7. Setting syntax highlights for errors.
|
|
|
|
|
|
|
|
ALE can fix problems with files with the |ALEFix| command, using the same job
|
2017-06-28 15:20:01 +00: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 23:22:32 +00:00
|
|
|
|
2018-06-28 15:20:30 +00:00
|
|
|
If you are interested in contributing to the development of ALE, read the
|
|
|
|
developer documentation. See |ale-development|
|
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
===============================================================================
|
|
|
|
2. Supported Languages & Tools *ale-support*
|
|
|
|
|
|
|
|
The following languages and tools are supported.
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
Notes:
|
|
|
|
|
|
|
|
`^` No linters for text or Vim help filetypes are enabled by default.
|
2017-08-28 21:08:55 +00:00
|
|
|
`!!` These linters check only files on disk. See |ale-lint-file-linters|
|
2017-08-28 21:05:12 +00:00
|
|
|
|
|
|
|
* ASM: `gcc`
|
|
|
|
* Ansible: `ansible-lint`
|
2017-11-20 10:57:13 +00:00
|
|
|
* API Blueprint: `drafter`
|
2017-12-18 14:26:52 +00:00
|
|
|
* AsciiDoc: `alex`!!, `proselint`, `redpen`, `write-good`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Awk: `gawk`
|
2018-06-07 17:55:43 +00:00
|
|
|
* Bash: `language-server`, `shell` (-n flag), `shellcheck`, `shfmt`
|
2017-11-05 21:24:41 +00:00
|
|
|
* Bourne Shell: `shell` (-n flag), `shellcheck`, `shfmt`
|
2018-09-26 14:50:43 +00:00
|
|
|
* C: `cppcheck`, `cpplint`!!, `clang`, `clangd`, `clangtidy`!!, `clang-format`, `cquery`, `flawfinder`, `gcc`, `uncrustify`, `ccls`
|
|
|
|
* C++ (filetype cpp): `clang`, `clangd`, `clangcheck`!!, `clangtidy`!!, `clang-format`, `clazy`!!, `cppcheck`, `cpplint`!!, `cquery`, `flawfinder`, `gcc`, `uncrustify`, `ccls`
|
2017-09-07 18:23:58 +00:00
|
|
|
* CUDA: `nvcc`!!
|
2018-09-05 00:39:32 +00:00
|
|
|
* C#: `mcs`, `mcsc`!!, `uncrustify`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Chef: `foodcritic`
|
2017-11-15 21:46:51 +00:00
|
|
|
* Clojure: `joker`
|
2018-06-04 16:23:25 +00:00
|
|
|
* CloudFormation: `cfn-python-lint`
|
2017-08-28 21:05:12 +00:00
|
|
|
* CMake: `cmakelint`
|
|
|
|
* CoffeeScript: `coffee`, `coffeelint`
|
2017-08-28 21:08:55 +00:00
|
|
|
* Crystal: `crystal`!!
|
2017-11-12 12:11:15 +00:00
|
|
|
* CSS: `csslint`, `prettier`, `stylelint`
|
2018-04-17 04:29:13 +00:00
|
|
|
* Cucumber: `cucumber`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Cython (pyrex filetype): `cython`
|
2018-10-17 15:11:41 +00:00
|
|
|
* D: `dls`, `dmd`, `uncrustify`
|
2017-11-08 06:11:49 +00:00
|
|
|
* Dafny: `dafny`!!
|
2018-07-01 12:55:41 +00:00
|
|
|
* Dart: `dartanalyzer`!!, `language_server`, dartfmt!!
|
2018-10-26 16:34:32 +00:00
|
|
|
* Dockerfile: `dockerfile_lint`, `hadolint`
|
2018-09-28 18:42:50 +00:00
|
|
|
* Elixir: `credo`, `dialyxir`, `dogma`, `mix`!!, `elixir-ls`
|
2017-09-10 11:58:42 +00:00
|
|
|
* Elm: `elm-format, elm-make`
|
2017-12-19 19:40:00 +00:00
|
|
|
* Erb: `erb`, `erubi`, `erubis`, `ruumba`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Erlang: `erlc`, `SyntaxErl`
|
2017-12-26 18:00:28 +00:00
|
|
|
* Fish: `fish` (-n flag)
|
2018-07-19 17:25:45 +00:00
|
|
|
* Fortran: `gcc`, `language_server`
|
2017-12-20 18:39:10 +00:00
|
|
|
* Fountain: `proselint`
|
2017-08-28 21:05:12 +00:00
|
|
|
* FusionScript: `fusion-lint`
|
2017-12-20 10:10:07 +00:00
|
|
|
* Git Commit Messages: `gitlint`
|
2017-12-01 17:36:44 +00:00
|
|
|
* GLSL: glslang, `glslls`
|
2018-09-19 18:33:23 +00:00
|
|
|
* Go: `gofmt`, `goimports`, `go mod`!!, `go vet`!!, `golint`, `gotype`!!, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!!, `golangserver`, `golangci-lint`!!
|
2018-01-05 12:02:05 +00:00
|
|
|
* GraphQL: `eslint`, `gqlint`, `prettier`
|
2018-07-27 20:50:59 +00:00
|
|
|
* Hack: `hack`, `hackfmt`, `hhast`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Haml: `haml-lint`
|
|
|
|
* Handlebars: `ember-template-lint`
|
2018-09-28 08:05:01 +00:00
|
|
|
* Haskell: `brittany`, `ghc`, `cabal-ghc`, `stylish-haskell`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `hlint`, `hdevtools`, `hfmt`, `hie`
|
2018-10-24 01:20:03 +00:00
|
|
|
* HCL: `terraform-fmt`
|
2018-11-07 06:30:52 +00:00
|
|
|
* HTML: `alex`!!, `HTMLHint`, `proselint`, `tidy`, `prettier`, `write-good`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Idris: `idris`
|
2018-09-05 00:39:32 +00:00
|
|
|
* Java: `checkstyle`, `javac`, `google-java-format`, `PMD`, `javalsp`, `uncrustify`
|
2017-12-18 10:37:21 +00:00
|
|
|
* JavaScript: `eslint`, `flow`, `jscs`, `jshint`, `prettier`, `prettier-eslint`, `prettier-standard`, `standard`, `xo`
|
2018-01-24 10:36:02 +00:00
|
|
|
* JSON: `fixjson`, `jsonlint`, `jq`, `prettier`
|
2018-09-09 18:47:55 +00:00
|
|
|
* Julia: `languageserver`
|
2018-07-15 17:54:18 +00:00
|
|
|
* Kotlin: `kotlinc`!!, `ktlint`!!, `languageserver`
|
2017-12-18 14:26:52 +00:00
|
|
|
* LaTeX (tex): `alex`!!, `chktex`, `lacheck`, `proselint`, `redpen`, `vale`, `write-good`
|
2017-11-12 12:09:19 +00:00
|
|
|
* Less: `lessc`, `prettier`, `stylelint`
|
2017-10-10 09:13:09 +00:00
|
|
|
* LLVM: `llc`
|
2018-01-08 15:19:17 +00:00
|
|
|
* Lua: `luac`, `luacheck`
|
2017-12-18 14:26:52 +00:00
|
|
|
* Mail: `alex`!!, `proselint`, `vale`
|
2017-10-24 12:09:56 +00:00
|
|
|
* Make: `checkmake`
|
2018-03-24 05:39:05 +00:00
|
|
|
* Markdown: `alex`!!, `markdownlint`!!, `mdl`, `prettier`, `proselint`, `redpen`, `remark-lint`, `textlint`, `vale`, `write-good`
|
2017-08-28 21:05:12 +00:00
|
|
|
* MATLAB: `mlint`
|
2018-03-25 17:43:51 +00:00
|
|
|
* Mercury: `mmc`!!
|
2018-05-04 19:44:32 +00:00
|
|
|
* NASM: `nasm`!!
|
2017-08-28 21:08:55 +00:00
|
|
|
* Nim: `nim check`!!
|
2017-08-28 21:05:12 +00:00
|
|
|
* nix: `nix-instantiate`
|
2017-12-18 14:26:52 +00:00
|
|
|
* nroff: `alex`!!, `proselint`, `write-good`
|
2018-09-26 14:50:43 +00:00
|
|
|
* Objective-C: `clang`, `clangd`, `uncrustify`, `ccls`
|
2018-09-07 01:59:03 +00:00
|
|
|
* Objective-C++: `clang`, `clangd`, `uncrustify`
|
2018-08-26 11:47:56 +00:00
|
|
|
* OCaml: `merlin` (see |ale-ocaml-merlin|), `ols`, `ocamlformat`
|
2018-09-05 00:39:32 +00:00
|
|
|
* Pawn: `uncrustify`
|
2018-04-21 13:09:38 +00:00
|
|
|
* Perl: `perl -c`, `perl-critic`, `perltidy`
|
2018-09-28 23:18:40 +00:00
|
|
|
* Perl6: `perl6 -c`
|
2018-09-27 15:48:47 +00:00
|
|
|
* PHP: `langserver`, `phan`, `php -l`, `phpcs`, `phpmd`, `phpstan`, `phpcbf`, `php-cs-fixer`, `psalm`!!
|
2018-01-27 11:40:40 +00:00
|
|
|
* PO: `alex`!!, `msgfmt`, `proselint`, `write-good`
|
2017-12-18 14:26:52 +00:00
|
|
|
* Pod: `alex`!!, `proselint`, `write-good`
|
2018-02-10 19:04:43 +00:00
|
|
|
* Pony: `ponyc`
|
2018-10-26 16:29:17 +00:00
|
|
|
* Prolog: `swipl`
|
2017-11-10 09:43:42 +00:00
|
|
|
* proto: `protoc-gen-lint`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Pug: `pug-lint`
|
2018-07-04 11:36:50 +00:00
|
|
|
* Puppet: `languageserver`, `puppet`, `puppet-lint`
|
2018-07-26 12:41:13 +00:00
|
|
|
* Python: `autopep8`, `black`, `flake8`, `isort`, `mypy`, `prospector`, `pycodestyle`, `pyls`, `pyre`, `pylint`!!, `vulture`!!, `yapf`
|
2018-04-05 19:09:41 +00:00
|
|
|
* QML: `qmlfmt`, `qmllint`
|
2017-08-28 21:05:12 +00:00
|
|
|
* R: `lintr`
|
2017-11-11 18:27:41 +00:00
|
|
|
* ReasonML: `merlin`, `ols`, `refmt`
|
2017-12-18 14:26:52 +00:00
|
|
|
* reStructuredText: `alex`!!, `proselint`, `redpen`, `rstcheck`, `vale`, `write-good`
|
2017-11-17 06:21:18 +00:00
|
|
|
* Re:VIEW: `redpen`
|
2017-08-28 21:05:12 +00:00
|
|
|
* RPM spec: `rpmlint`
|
2018-08-24 04:02:51 +00:00
|
|
|
* Ruby: `brakeman`, `rails_best_practices`!!, `reek`, `rubocop`, `ruby`, `rufo`, `solargraph`
|
2017-10-21 17:31:49 +00:00
|
|
|
* Rust: `cargo`!!, `rls`, `rustc` (see |ale-integration-rust|), `rustfmt`
|
2017-08-28 21:05:12 +00:00
|
|
|
* SASS: `sass-lint`, `stylelint`
|
2017-11-12 12:11:15 +00:00
|
|
|
* SCSS: `prettier`, `sass-lint`, `scss-lint`, `stylelint`
|
2018-08-27 05:12:56 +00:00
|
|
|
* Scala: `fsc`, `sbtserver`, `scalac`, `scalafmt`, `scalastyle`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Slim: `slim-lint`
|
|
|
|
* SML: `smlnj`
|
2018-04-05 19:04:11 +00:00
|
|
|
* Solidity: `solhint`, `solium`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Stylus: `stylelint`
|
2018-09-07 22:55:26 +00:00
|
|
|
* SQL: `sqlint`, `sqlfmt`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Swift: `swiftlint`, `swiftformat`
|
2017-08-28 21:08:55 +00:00
|
|
|
* Tcl: `nagelfar`!!
|
2018-10-24 01:20:03 +00:00
|
|
|
* Terraform: `fmt`, `tflint`
|
2017-12-18 14:26:52 +00:00
|
|
|
* Texinfo: `alex`!!, `proselint`, `write-good`
|
2018-03-24 05:39:05 +00:00
|
|
|
* Text^: `alex`!!, `proselint`, `redpen`, `textlint`, `vale`, `write-good`
|
2017-08-30 17:59:40 +00:00
|
|
|
* Thrift: `thrift`
|
2017-11-12 12:11:15 +00:00
|
|
|
* TypeScript: `eslint`, `prettier`, `tslint`, `tsserver`, `typecheck`
|
2018-09-05 00:39:32 +00:00
|
|
|
* VALA: `uncrustify`
|
2017-08-28 21:05:12 +00:00
|
|
|
* Verilog: `iverilog`, `verilator`
|
|
|
|
* Vim: `vint`
|
2017-12-18 14:26:52 +00:00
|
|
|
* Vim help^: `alex`!!, `proselint`, `write-good`
|
2018-07-05 12:04:20 +00:00
|
|
|
* Vue: `prettier`, `vls`
|
2017-12-18 14:26:52 +00:00
|
|
|
* XHTML: `alex`!!, `proselint`, `write-good`
|
2017-08-28 21:05:12 +00:00
|
|
|
* XML: `xmllint`
|
2018-08-08 17:48:28 +00:00
|
|
|
* YAML: `prettier`, `swaglint`, `yamllint`
|
2018-08-03 19:59:32 +00:00
|
|
|
* YANG: `yang-lsp`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
|
|
|
===============================================================================
|
2017-08-28 21:05:12 +00:00
|
|
|
3. 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:ale_lint_on_text_changed|
|
2018-07-16 23:18:20 +00:00
|
|
|
* On leaving insert mode. (off by default) - |g:ale_lint_on_insert_leave|
|
2017-08-28 21:05:12 +00:00
|
|
|
* When you open a new or modified buffer. - |g:ale_lint_on_enter|
|
|
|
|
* When you save a buffer. - |g:ale_lint_on_save|
|
|
|
|
* When the filetype changes for a buffer. - |g:ale_lint_on_filetype_changed|
|
2017-10-14 21:00:53 +00:00
|
|
|
* If ALE is used to check code manually. - |:ALELint|
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
*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:ale_echo_cursor|.
|
2017-08-28 21:05:12 +00:00
|
|
|
|
|
|
|
*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:ale_lint_on_enter|
|
|
|
|
* When you save a buffer. - |g:ale_lint_on_save|
|
|
|
|
* When the filetype changes for a buffer. - |g:ale_lint_on_filetype_changed|
|
2017-10-14 21:00:53 +00:00
|
|
|
* If ALE is used to check code manually. - |:ALELint|
|
2017-08-28 21:05:12 +00:00
|
|
|
|
|
|
|
ALE will report problems with your code in the following ways, listed with
|
|
|
|
their relevant options.
|
|
|
|
|
2018-09-14 11:42:26 +00:00
|
|
|
* By updating loclist. (On by default) - |g:ale_set_loclist|
|
|
|
|
* By updating quickfix. (Off by default) - |g:ale_set_quickfix|
|
|
|
|
* By setting error highlights. - |g:ale_set_highlights|
|
|
|
|
* By creating signs in the sign column. - |g:ale_set_signs|
|
|
|
|
* By echoing messages based on your cursor. - |g:ale_echo_cursor|
|
2018-11-06 06:45:40 +00:00
|
|
|
* By inline text based on your cursor. - |g:ale_virtualtext_cursor|
|
2018-09-14 11:42:26 +00:00
|
|
|
* By displaying the preview based on your cursor. - |g:ale_cursor_detail|
|
|
|
|
* By showing balloons for your mouse cursor - |g:ale_set_balloons|
|
2017-08-28 21:05:12 +00:00
|
|
|
|
|
|
|
Please consult the documentation for each option, which can reveal some other
|
|
|
|
ways of tweaking the behaviour 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:ale_enabled|. The
|
|
|
|
|g:ale_pattern_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
|
2017-11-19 13:56:09 +00:00
|
|
|
project configuration files. Buffer-local settings can also be used in
|
|
|
|
ftplugin files for different filetypes.
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2018-05-30 20:10:37 +00:00
|
|
|
ALE offers several options for controlling which linters are run.
|
|
|
|
|
|
|
|
* Selecting linters to run. - |g:ale_linters|
|
|
|
|
* Aliasing filetypes for linters - |g:ale_linter_aliases|
|
|
|
|
* Only running linters you asked for. - |g:ale_linters_explicit|
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2018-10-29 18:28:28 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
3.1 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', [
|
2018-10-29 18:36:03 +00:00
|
|
|
\ {'text': 'Something went wrong', 'lnum': 13},
|
2018-10-29 18:28:28 +00:00
|
|
|
\])
|
|
|
|
<
|
|
|
|
|
|
|
|
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#other_source#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:ale_want_results_buffer| 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.
|
|
|
|
|
|
|
|
A plugin might integrate its own checks with ALE like so: >
|
|
|
|
|
|
|
|
augroup SomeGroupName
|
|
|
|
autocmd!
|
|
|
|
autocmd User ALEWantResults call Hook(g:ale_want_results_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(buffer, 'some-name', a:results)
|
|
|
|
endfunction
|
|
|
|
<
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
===============================================================================
|
|
|
|
4. Fixing Problems *ale-fix*
|
|
|
|
|
2018-04-17 23:59:16 +00:00
|
|
|
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: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-08-28 21:05:12 +00:00
|
|
|
|
|
|
|
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, 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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2017-11-22 22:32:53 +00:00
|
|
|
`process_with` An optional callback for post-processing.
|
|
|
|
|
|
|
|
The callback must accept two arguments,
|
|
|
|
`(buffer, output)`, which can be used for converting
|
|
|
|
the output from a command into lines to replace the
|
|
|
|
buffer's contents with.
|
|
|
|
|
|
|
|
A |List| of |String|s must be returned.
|
|
|
|
|
2017-11-07 23:20:14 +00:00
|
|
|
`chain_with` An optional key for defining a callback to call next.
|
|
|
|
|
|
|
|
The callback must accept two or three arguments,
|
|
|
|
`(buffer, output)` or `(buffer, output, input)` .
|
|
|
|
Functions receiving a variable number of arguments will
|
|
|
|
only receive the first two values. The `output` argument
|
|
|
|
will contain the lines of output from the command run.
|
|
|
|
The `input` argument is the List of lines for the
|
|
|
|
buffer, after applying any previous fixers.
|
|
|
|
|
|
|
|
The callback must return the same values returned for
|
|
|
|
any fixer function. This allows fixer functions to be
|
|
|
|
chained recursively.
|
|
|
|
|
|
|
|
When the command string returned for a fixer is an empty
|
|
|
|
string, the next command in the chain will still be run.
|
|
|
|
This allows commands to be skipped, like version checks
|
|
|
|
that are cached. An empty List will be passed to the
|
|
|
|
next callback in the chain for the `output`.
|
|
|
|
|
2017-11-22 13:01:13 +00:00
|
|
|
`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 `0` when `chain_with` is defined
|
|
|
|
as anything other than `v:null`, and defaults to `1`
|
|
|
|
otherwise. This is so earlier commands in a chain
|
|
|
|
do not receive the buffer's data by default.
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
*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.
|
|
|
|
|
2017-11-11 23:04:08 +00:00
|
|
|
For buffer-local settings, such as in |g:ale_pattern_options| 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
|
|
|
|
<
|
2017-08-28 21:05:12 +00: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)
|
|
|
|
<
|
|
|
|
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-11-26 23:02:51 +00:00
|
|
|
5. Language Server Protocol Support *ale-lsp*
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2017-11-26 23:02:51 +00:00
|
|
|
ALE offers some support for integrating 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.
|
|
|
|
|
2018-08-05 05:38:16 +00:00
|
|
|
ALE supports the following LSP/tsserver features:
|
2017-11-26 23:02:51 +00:00
|
|
|
|
|
|
|
1. Diagnostics/linting - Enabled via selecting linters as usual.
|
2018-08-05 05:38:16 +00:00
|
|
|
2. Completion
|
2017-11-26 23:02:51 +00:00
|
|
|
3. Go to definition
|
|
|
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
5.1 Completion *ale-completion*
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2017-11-26 23:02:51 +00:00
|
|
|
ALE offers limited support for automatic completion of code while you type.
|
2018-08-05 05:38:16 +00:00
|
|
|
Completion is only supported while at least one LSP linter is enabled. ALE
|
2017-11-26 23:02:51 +00:00
|
|
|
will only suggest symbols provided by the LSP servers.
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
Suggestions will be made while you type after completion is enabled.
|
2018-10-18 08:10:59 +00:00
|
|
|
Completion can be enabled by setting |g:ale_completion_enabled| to `1`. This
|
|
|
|
setting must be set to `1` before ALE is loaded. The delay for completion can
|
|
|
|
be configured with |g:ale_completion_delay|. ALE will only suggest so many
|
|
|
|
possible matches for completion. The maximum number of items can be controlled
|
|
|
|
with |g:ale_completion_max_suggestions|.
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2018-05-03 10:17:41 +00:00
|
|
|
If you don't like some of the suggestions you see, you can filter them out
|
|
|
|
with |g:ale_completion_excluded_words| or |b:ale_completion_excluded_words|.
|
|
|
|
|
2018-07-31 19:34:37 +00:00
|
|
|
*ale-completion-completopt-bug*
|
|
|
|
|
|
|
|
ALE implements completion as you type by temporarily adjusting |completeopt|
|
|
|
|
before opening the omnicomplete menu with <C-x><C-o>. In some versions of Vim,
|
|
|
|
the value set for the option will not be respected. If you experience issues
|
|
|
|
with Vim automatically inserting text while you type, set the following option
|
|
|
|
in vimrc, and your issues should go away. >
|
|
|
|
|
|
|
|
set completeopt=menu,menuone,preview,noselect,noinsert
|
|
|
|
<
|
2017-08-28 21:05:12 +00:00
|
|
|
|
2017-11-26 23:02:51 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
5.2 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 following commands are supported:
|
|
|
|
|
|
|
|
|ALEGoToDefinition| - Open the definition of the symbol under the cursor.
|
|
|
|
|ALEGoToDefinitionInTab| - The same, but for opening the file in a new tab.
|
|
|
|
|
|
|
|
|
2018-04-22 18:49:24 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
5.3 Find References *ale-find-references*
|
|
|
|
|
|
|
|
ALE supports finding references for symbols though any enabled LSP linters.
|
|
|
|
ALE will display a preview window showing the places where a symbol is
|
|
|
|
referenced in a codebase when a command is run. The following commands are
|
2018-04-22 19:32:39 +00:00
|
|
|
supported:
|
2018-04-22 18:49:24 +00:00
|
|
|
|
|
|
|
|ALEFindReferences| - Find references for the word under the cursor.
|
|
|
|
|
|
|
|
|
2018-04-24 20:03:06 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
5.4 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.
|
|
|
|
|
2018-10-15 17:01:49 +00:00
|
|
|
If |g:ale_set_balloons| is set to `1` and your version of Vim supports the
|
2018-05-30 18:44:01 +00:00
|
|
|
|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.
|
2018-05-17 08:57:04 +00:00
|
|
|
|
2018-10-15 17:01:49 +00:00
|
|
|
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:ale_set_balloons| is set to
|
|
|
|
`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
|
|
|
|
<
|
2018-04-24 20:03:06 +00:00
|
|
|
|
2018-10-31 16:13:22 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
5.5 Symbol Search *ale-symbol-search*
|
|
|
|
|
|
|
|
ALE supports searching for workspace symbols via LSP linters. The following
|
|
|
|
commands are supported:
|
|
|
|
|
|
|
|
|ALESymbolSearch| - Search for symbols in the workspace.
|
|
|
|
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
===============================================================================
|
|
|
|
6. Global Options *ale-options*
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:airline#extensions#ale#enabled *g:airline#extensions#ale#enabled*
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-01-22 15:06:33 +00: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 22:11:45 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-11-30 10:34:51 +00:00
|
|
|
g:ale_cache_executable_check_failures *g:ale_cache_executable_check_failures*
|
|
|
|
|
|
|
|
Type: |Number|
|
2018-05-28 18:19:20 +00:00
|
|
|
Default: undefined
|
2017-11-30 10:34:51 +00:00
|
|
|
|
|
|
|
When set to `1`, ALE will cache failing executable checks for linters. By
|
|
|
|
default, only executable checks which succeed will be cached.
|
|
|
|
|
|
|
|
When this option is set to `1`, Vim will have to be restarted after new
|
|
|
|
executables are installed for ALE to be able to run linters for those
|
|
|
|
executables.
|
|
|
|
|
|
|
|
|
2017-05-21 21:42:27 +00: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 21:46:22 +00:00
|
|
|
`ALESignColumnWithoutErrors` - Uses the value for `SignColumn` by default.
|
2017-05-21 21:42:27 +00:00
|
|
|
|
2017-06-23 11:00:33 +00: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 21:42:27 +00:00
|
|
|
|
2018-09-14 11:42:26 +00:00
|
|
|
g:ale_close_preview_on_insert *g:ale_close_preview_on_insert*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When this option is set to `1`, ALE's |preview-window| will be automatically
|
|
|
|
closed upon entering Insert Mode. This option can be used in combination
|
|
|
|
with |g:ale_cursor_detail| for automatically displaying the preview window
|
|
|
|
on problem lines, and automatically closing it again when editing text.
|
|
|
|
|
|
|
|
This setting must be set to `1` before ALE is loaded for this behavior
|
|
|
|
to be enabled. See |ale-lint-settings-on-startup|.
|
|
|
|
|
|
|
|
|
2017-12-20 12:20:38 +00:00
|
|
|
g:ale_command_wrapper *g:ale_command_wrapper*
|
|
|
|
*b:ale_command_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:ale_command_wrapper = 'nice -n5'
|
|
|
|
<
|
|
|
|
Use the |ALEInfo| command 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:ale_command_wrapper = '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:ale_command_wrapper = 'other-wrapper -c %@ -x'
|
|
|
|
<
|
|
|
|
For commands including `&&` or `;`, 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.
|
|
|
|
|
|
|
|
|
2017-08-17 23:08:58 +00:00
|
|
|
g:ale_completion_delay *g:ale_completion_delay*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `100`
|
|
|
|
|
|
|
|
The number of milliseconds before ALE will send a request to a language
|
|
|
|
server for completions after you have finished typing.
|
|
|
|
|
|
|
|
See |ale-completion|
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_completion_enabled *g:ale_completion_enabled*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When this option is set to `1`, completion support will be enabled.
|
|
|
|
|
2018-10-18 08:10:59 +00:00
|
|
|
This setting must be set to `1` before ALE is loaded for this behavior
|
|
|
|
to be enabled.
|
|
|
|
|
2017-08-17 23:08:58 +00:00
|
|
|
See |ale-completion|
|
|
|
|
|
|
|
|
|
2018-05-03 10:17:41 +00:00
|
|
|
g:ale_completion_excluded_words *g:ale_completion_excluded_words*
|
|
|
|
*b:ale_completion_excluded_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 `it` or `describe` so we can use snippets for those words.
|
|
|
|
let b:ale_completion_excluded_words = ['it', 'describe']
|
|
|
|
<
|
|
|
|
|
2017-08-17 23:08:58 +00:00
|
|
|
g:ale_completion_max_suggestions *g:ale_completion_max_suggestions*
|
|
|
|
|
|
|
|
Type: |Number|
|
2017-08-18 21:34:18 +00:00
|
|
|
Default: `50`
|
2017-08-17 23:08:58 +00:00
|
|
|
|
|
|
|
The 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.
|
|
|
|
|
2018-09-14 11:42:26 +00:00
|
|
|
g:ale_cursor_detail *g:ale_cursor_detail*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When this option is set to `1`, 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:ale_echo_cursor| 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:ale_echo_delay|.
|
|
|
|
|
|
|
|
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:ale_close_preview_on_insert| to `1`.
|
|
|
|
|
|
|
|
Either this setting or |g:ale_echo_cursor| must be set to `1` before ALE is
|
|
|
|
loaded for messages to be displayed. See |ale-lint-settings-on-startup|.
|
|
|
|
|
2017-08-17 23:08:58 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:ale_echo_cursor *g:ale_echo_cursor*
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-01-22 15:06:33 +00: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
|
2018-09-14 11:42:26 +00:00
|
|
|
this behavior.
|
|
|
|
|
|
|
|
Messages are only displayed after a short delay. See |g:ale_echo_delay|.
|
|
|
|
|
|
|
|
The format of the message can be customized with |g:ale_echo_msg_format|.
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2018-09-14 11:42:26 +00:00
|
|
|
Either this setting or |g:ale_cursor_detail| must be set to `1` before ALE
|
|
|
|
is loaded for messages to be displayed. See |ale-lint-settings-on-startup|.
|
2018-07-16 23:18:20 +00:00
|
|
|
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-10-12 22:25:41 +00:00
|
|
|
g:ale_echo_delay *g:ale_echo_delay*
|
|
|
|
*b:ale_echo_delay*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `10`
|
|
|
|
|
|
|
|
Given any integer, this option controls the number of milliseconds before
|
2018-09-14 11:42:26 +00:00
|
|
|
ALE will echo or preview a message for a problem near the cursor.
|
2017-10-12 22:25:41 +00:00
|
|
|
|
|
|
|
The value can be increased to decrease the amount of processing ALE will do
|
|
|
|
for files displaying a large number of problems.
|
|
|
|
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
Type: |String|
|
2017-11-12 23:01:11 +00:00
|
|
|
Default: `'Error'`
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-11-12 23:01:11 +00:00
|
|
|
The string used for `%severity%` for errors. See |g:ale_echo_msg_format|
|
2016-10-11 22:11:45 +00:00
|
|
|
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:ale_echo_msg_format *g:ale_echo_msg_format*
|
2017-11-19 23:44:02 +00:00
|
|
|
b:ale_echo_msg_format *b:ale_echo_msg_format*
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
Type: |String|
|
2017-11-13 00:47:34 +00:00
|
|
|
Default: `'%code: %%s'`
|
2016-10-11 22:11:45 +00:00
|
|
|
|
2017-11-12 23:01:11 +00:00
|
|
|
This variable defines a message format for echoed messages. The following
|
|
|
|
sequences of characters will be replaced.
|
|
|
|
|
2017-11-13 00:47:34 +00:00
|
|
|
`%s` - replaced with the text for the problem
|
|
|
|
`%...code...% `- replaced with the error code
|
|
|
|
`%linter%` - replaced with the name of the linter
|
|
|
|
`%severity%` - replaced withe severity of the problem
|
2017-11-12 23:01:11 +00:00
|
|
|
|
|
|
|
The strings for `%severity%` can be configured with the following options.
|
|
|
|
|
|
|
|
|g:ale_echo_msg_error_str| - Defaults to `'Error'`
|
2017-11-14 10:28:36 +00:00
|
|
|
|g:ale_echo_msg_info_str| - Defaults to `'Info'`
|
2017-11-12 23:01:11 +00:00
|
|
|
|g:ale_echo_msg_warning_str| - Defaults to `'Warning'`
|
|
|
|
|
2017-11-13 00:47:34 +00:00
|
|
|
`%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): message` will be printed for `'%(code): %%s'` and simply the
|
|
|
|
message will be printed when there is no code.
|
|
|
|
|
2017-11-12 23:01:11 +00:00
|
|
|
|g:ale_echo_cursor| needs to be set to 1 for messages to be displayed.
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-11-19 23:44:02 +00:00
|
|
|
The echo message format can also be configured separately for each buffer,
|
|
|
|
so different formats can be used for differnt languages. (Say in ftplugin
|
|
|
|
files.)
|
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-11-12 23:19:26 +00:00
|
|
|
g:ale_echo_msg_info_str *g:ale_echo_msg_info_str*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `'Info'`
|
|
|
|
|
|
|
|
The string used for `%severity%` for info. See |g:ale_echo_msg_format|
|
|
|
|
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:ale_echo_msg_warning_str *g:ale_echo_msg_warning_str*
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
Type: |String|
|
2017-11-12 23:01:11 +00:00
|
|
|
Default: `'Warning'`
|
2017-01-22 15:06:33 +00:00
|
|
|
|
2017-11-12 23:01:11 +00:00
|
|
|
The string used for `%severity%` for warnings. See |g:ale_echo_msg_format|
|
2016-10-05 23:22:32 +00:00
|
|
|
|
|
|
|
|
2017-02-12 19:26:18 +00:00
|
|
|
g:ale_enabled *g:ale_enabled*
|
2017-05-26 15:20:17 +00:00
|
|
|
*b:ale_enabled*
|
2017-02-12 19:26:18 +00: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 15:20:17 +00: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 19:26:18 +00:00
|
|
|
|
2017-05-20 18:01:12 +00: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.
|
|
|
|
|
2017-10-02 16:11:54 +00:00
|
|
|
This variable can be overridden with variables in each buffer.
|
2017-11-11 23:04:08 +00:00
|
|
|
`b:ale_fixers` can be set to a |List| of callbacks instead, which can be
|
|
|
|
more convenient.
|
2017-05-20 18:01:12 +00:00
|
|
|
|
2018-06-21 00:21:11 +00:00
|
|
|
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:ale_fixers = {'python': ['bar'], 'html': [], '*': ['foo']}
|
|
|
|
<
|
2017-05-20 18:01:12 +00:00
|
|
|
|
2017-05-30 20:32:51 +00:00
|
|
|
g:ale_fix_on_save *g:ale_fix_on_save*
|
2017-10-30 22:19:57 +00:00
|
|
|
b:ale_fix_on_save *b:ale_fix_on_save*
|
2017-05-30 20:32:51 +00:00
|
|
|
|
|
|
|
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 15:43:28 +00:00
|
|
|
to the file will be saved to the file on disk.
|
2017-05-30 20:32:51 +00:00
|
|
|
|
2018-11-10 10:06:48 +00:00
|
|
|
Files will not be fixed on `:wq`, so you should check your code before
|
|
|
|
closing a buffer.
|
|
|
|
|
2017-10-30 22:19:57 +00:00
|
|
|
Fixing files can be disabled or enabled for individual buffers by setting
|
|
|
|
`b:ale_fix_on_save` to `0` or `1`.
|
|
|
|
|
2017-05-30 20:32:51 +00:00
|
|
|
|
2017-02-16 21:33:44 +00: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 23:18:57 +00:00
|
|
|
g:ale_history_log_output *g:ale_history_log_output*
|
|
|
|
|
|
|
|
Type: |Number|
|
2017-07-03 23:16:53 +00:00
|
|
|
Default: `1`
|
2017-02-16 23:18:57 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2017-07-03 23:16:53 +00:00
|
|
|
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.
|
2017-02-16 23:18:57 +00:00
|
|
|
|
|
|
|
|
2017-01-22 15:19:09 +00:00
|
|
|
g:ale_keep_list_window_open *g:ale_keep_list_window_open*
|
2017-08-07 23:46:42 +00:00
|
|
|
*b:ale_keep_list_window_open*
|
2017-01-22 15:19:09 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
2018-02-25 12:43:13 +00:00
|
|
|
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 quickfix windows will be closed automatically when there are no
|
|
|
|
warnings or errors.
|
2017-01-22 15:19:09 +00:00
|
|
|
|
2017-08-17 23:08:58 +00:00
|
|
|
See |g:ale_open_list|
|
2017-01-22 15:19:09 +00:00
|
|
|
|
|
|
|
|
2017-06-01 09:39:21 +00: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 23:22:32 +00:00
|
|
|
g:ale_lint_delay *g:ale_lint_delay*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `200`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:20:21 +00: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 22:21:37 +00:00
|
|
|
|g:ale_lint_on_text_changed| variable set to `always`, `insert`, or `normal`.
|
2016-10-05 23:22:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_lint_on_enter *g:ale_lint_on_enter*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
When 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 to `0` in your vimrc file to disable this behavior.
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-06-24 11:24:31 +00: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.
|
2017-08-20 12:35:27 +00:00
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
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|.
|
2017-06-24 11:24:31 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-03-27 21:40:25 +00:00
|
|
|
g:ale_lint_on_filetype_changed *g:ale_lint_on_filetype_changed*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
This 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.
|
2017-03-27 21:40:25 +00:00
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
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|.
|
2017-09-02 15:57:01 +00:00
|
|
|
|
2017-03-27 21:40:25 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
g:ale_lint_on_save *g:ale_lint_on_save*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
2017-03-27 19:36:35 +00:00
|
|
|
Default: `1`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:20:21 +00: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 23:22:32 +00:00
|
|
|
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:ale_lint_on_text_changed *g:ale_lint_on_text_changed*
|
|
|
|
|
2017-03-30 22:21:37 +00:00
|
|
|
Type: |String|
|
2018-07-16 23:18:20 +00:00
|
|
|
Default: `'always'`
|
|
|
|
|
|
|
|
This option controls how ALE will check your files as you make changes.
|
|
|
|
The following values can be used.
|
|
|
|
|
|
|
|
`'always'`, `'1'`, or `1` - Check buffers on |TextChanged| or |TextChangedI|.
|
|
|
|
`'normal'` - Check buffers only on |TextChanged|.
|
|
|
|
`'insert'` - Check buffers only on |TextChangedI|.
|
|
|
|
`'never'`, `'0'`, or `0` - Never check buffers on changes.
|
2017-01-22 15:06:33 +00:00
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
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:ale_lint_delay|
|
|
|
|
variable.
|
2018-09-25 09:17:45 +00:00
|
|
|
*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:ale_lint_on_insert_leave| below, and set this option to `'normal'`, or
|
|
|
|
disable it entirely.
|
2018-07-16 23:18:20 +00:00
|
|
|
|
|
|
|
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|.
|
2017-03-30 22:21:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_lint_on_insert_leave *g:ale_lint_on_insert_leave*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
2017-11-13 10:27:20 +00:00
|
|
|
When set to `1` in your vimrc file, this option will cause ALE to run
|
|
|
|
linters when you leave insert mode.
|
2017-01-22 15:06:33 +00:00
|
|
|
|
2017-11-13 10:27:20 +00:00
|
|
|
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|
|
2018-09-25 09:17:45 +00:00
|
|
|
with the following mapping. >
|
2017-11-13 10:27:20 +00:00
|
|
|
|
|
|
|
" Make using Ctrl+C do the same as Escape, to trigger autocmd commands
|
|
|
|
inoremap <C-c> <Esc>
|
|
|
|
<
|
2018-07-16 23:18:20 +00:00
|
|
|
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|.
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
|
|
|
|
g:ale_linter_aliases *g:ale_linter_aliases*
|
2017-04-25 22:52:13 +00:00
|
|
|
*b:ale_linter_aliases*
|
2017-01-22 15:06:33 +00: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: >
|
|
|
|
|
|
|
|
{
|
2018-05-26 10:41:52 +00:00
|
|
|
\ 'Dockerfile': 'dockerfile',
|
2017-01-22 15:06:33 +00:00
|
|
|
\ 'csh': 'sh',
|
2018-05-26 10:41:52 +00:00
|
|
|
\ 'plaintex': 'tex',
|
|
|
|
\ 'systemverilog': 'verilog',
|
2018-06-23 17:20:39 +00:00
|
|
|
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
|
2018-05-26 10:41:52 +00:00
|
|
|
\ 'vimwiki': 'markdown',
|
2018-11-08 09:18:58 +00:00
|
|
|
\ 'vue': ['vue', 'javascript'],
|
2018-05-26 10:41:52 +00:00
|
|
|
\ 'zsh': 'sh',
|
2017-01-22 15:06:33 +00:00
|
|
|
\}
|
|
|
|
<
|
|
|
|
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 20:10:08 +00: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
|
2017-11-11 14:27:53 +00:00
|
|
|
will override the original linters for the aliased filetype.
|
2017-01-22 15:06:33 +00:00
|
|
|
|
2017-04-25 22:52:13 +00: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.
|
|
|
|
|
2018-10-26 08:22:33 +00:00
|
|
|
`b:ale_linter_aliases` can be set to a |List| or a |String|, to tell ALE to
|
|
|
|
load the linters for specific filetypes for a given buffer. >
|
2017-11-12 00:11:50 +00:00
|
|
|
|
|
|
|
let b:ale_linter_aliases = ['html', 'javascript', 'css']
|
2018-10-26 08:22:33 +00:00
|
|
|
" OR, Alias a filetype to only a single filetype with a String.
|
|
|
|
let b:ale_linter_aliases = 'javascript'
|
2017-11-12 00:11:50 +00:00
|
|
|
<
|
|
|
|
No linters will be loaded when the buffer's filetype is empty.
|
2017-01-22 15:06:33 +00:00
|
|
|
|
2017-04-25 22:52:13 +00:00
|
|
|
g:ale_linters *g:ale_linters*
|
|
|
|
*b:ale_linters*
|
2017-01-22 15:06:33 +00:00
|
|
|
Type: |Dictionary|
|
|
|
|
Default: `{}`
|
|
|
|
|
2017-11-14 19:55:28 +00:00
|
|
|
The |g:ale_linters| option sets a |Dictionary| mapping a filetype to a
|
|
|
|
|List| of linter programs to be run when checking particular filetypes.
|
2017-01-22 15:06:33 +00:00
|
|
|
|
|
|
|
This |Dictionary| will be merged with a default dictionary containing the
|
|
|
|
following values: >
|
|
|
|
|
|
|
|
{
|
|
|
|
\ 'csh': ['shell'],
|
2017-11-14 19:55:28 +00:00
|
|
|
\ 'go': ['gofmt', 'golint', 'go vet'],
|
2018-08-02 20:09:51 +00:00
|
|
|
\ 'hack': ['hack'],
|
2017-11-14 19:55:28 +00:00
|
|
|
\ 'help': [],
|
2017-12-02 20:43:47 +00:00
|
|
|
\ 'perl': ['perlcritic'],
|
2018-09-28 23:18:40 +00:00
|
|
|
\ 'perl6': [],
|
2017-11-14 19:55:28 +00:00
|
|
|
\ 'python': ['flake8', 'mypy', 'pylint'],
|
2017-02-15 22:59:26 +00:00
|
|
|
\ 'rust': ['cargo'],
|
2017-11-14 19:55:28 +00:00
|
|
|
\ 'spec': [],
|
2017-02-15 22:59:26 +00:00
|
|
|
\ 'text': [],
|
2018-11-08 09:18:58 +00:00
|
|
|
\ 'vue': ['eslint', 'vls'],
|
2017-02-15 22:59:26 +00:00
|
|
|
\ 'zsh': ['shell'],
|
2017-01-22 15:06:33 +00:00
|
|
|
\}
|
|
|
|
<
|
|
|
|
This option can be used to enable only a particular set of linters for a
|
2017-11-14 19:55:28 +00:00
|
|
|
file. For example, you can enable only `eslint` for JavaScript files: >
|
2017-01-22 15:06:33 +00:00
|
|
|
|
|
|
|
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': []}
|
|
|
|
<
|
2017-11-14 19:55:28 +00:00
|
|
|
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. >
|
2017-01-22 15:06:33 +00:00
|
|
|
|
|
|
|
let g:ale_linters = {'c': 'all'}
|
|
|
|
<
|
2017-04-25 22:52:13 +00: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,
|
2017-11-14 19:55:28 +00:00
|
|
|
then `g:ale_linters`, and then the default Dictionary mentioned above.
|
2017-04-25 22:52:13 +00:00
|
|
|
|
2017-11-11 23:55:04 +00:00
|
|
|
`b:ale_linters` can 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:ale_linters = {'javascript': ['eslint'], 'html': ['tidy']}
|
|
|
|
" Use a List for the same setting. This will work in most cases.
|
|
|
|
let b:ale_linters = ['eslint', 'tidy']
|
|
|
|
" Disable all linters for the buffer.
|
|
|
|
let b:ale_linters = []
|
|
|
|
" Explicitly enable all available linters for the filetype.
|
|
|
|
let b:ale_linters = 'all'
|
|
|
|
<
|
2017-11-14 19:55:28 +00:00
|
|
|
ALE can be configured to disable all linters unless otherwise specified with
|
|
|
|
`g:ale_enabled` or `b:ale_enabled` with the option |g:ale_linters_explicit|.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_linters_explicit *g:ale_linters_explicit*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, only the linters from |g:ale_linters| and |b:ale_linters|
|
|
|
|
will be enabled. The default behavior for ALE is to enable as many linters
|
|
|
|
as possible, unless otherwise specified.
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
|
2018-06-24 20:16:45 +00:00
|
|
|
g:ale_linters_ignore *g:ale_linters_ignore*
|
|
|
|
*b:ale_linters_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:ale_linters = {'python': ['flake8', 'pylint']}
|
|
|
|
let g:ale_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:ale_linters = ['flake8', 'pylint']
|
|
|
|
let b:ale_linters_ignore = ['pylint']
|
|
|
|
<
|
|
|
|
|
2018-03-02 20:22:29 +00:00
|
|
|
g:ale_list_vertical *g:ale_list_vertical*
|
|
|
|
*b:ale_list_vertical*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, this will cause ALE to open any windows (loclist or
|
|
|
|
quickfix) vertically instead of horizontally (|vert| |lopen|) or (|vert|
|
|
|
|
|copen|)
|
|
|
|
|
|
|
|
|
2017-11-14 10:28:36 +00:00
|
|
|
g:ale_loclist_msg_format *g:ale_loclist_msg_format*
|
2017-11-19 23:44:02 +00:00
|
|
|
b:ale_loclist_msg_format *b:ale_loclist_msg_format*
|
2017-11-14 10:28:36 +00:00
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `g:ale_echo_msg_format`
|
|
|
|
|
|
|
|
This option is the same as |g:ale_echo_msg_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.
|
|
|
|
|
|
|
|
|
2017-02-16 21:33:44 +00: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-10-12 22:04:46 +00:00
|
|
|
g:ale_max_signs *g:ale_max_signs*
|
|
|
|
*b:ale_max_signs*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `-1`
|
|
|
|
|
|
|
|
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:ale_set_signs|.
|
|
|
|
|
|
|
|
|
2017-05-26 20:21:15 +00:00
|
|
|
g:ale_maximum_file_size *g:ale_maximum_file_size*
|
|
|
|
*b:ale_maximum_file_size*
|
|
|
|
Type: |Number|
|
2018-05-28 18:19:20 +00:00
|
|
|
Default: undefined
|
2017-05-26 20:21:15 +00:00
|
|
|
|
|
|
|
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 15:19:09 +00:00
|
|
|
g:ale_open_list *g:ale_open_list*
|
2017-08-07 23:46:42 +00:00
|
|
|
*b:ale_open_list*
|
|
|
|
Type: |Number| or |String|
|
2017-01-22 15:19:09 +00:00
|
|
|
Default: `0`
|
|
|
|
|
2017-08-07 23:46:42 +00:00
|
|
|
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|)
|
|
|
|
|
|
|
|
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.
|
2017-01-22 15:19:09 +00:00
|
|
|
|
|
|
|
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
|
2018-02-25 12:43:13 +00:00
|
|
|
to `1`, in which case the window will be kept open when no problems are
|
|
|
|
found.
|
2017-01-22 15:19:09 +00:00
|
|
|
|
2017-06-01 09:39:21 +00:00
|
|
|
The window size can be configured with |g:ale_list_window_size|.
|
|
|
|
|
2018-03-02 20:22:29 +00:00
|
|
|
Windows can be opened vertically with |g:ale_list_vertical|.
|
|
|
|
|
2018-02-25 12:43:13 +00:00
|
|
|
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
|
|
|
|
<
|
2017-01-22 15:19:09 +00:00
|
|
|
|
2017-05-26 14:59:43 +00:00
|
|
|
g:ale_pattern_options *g:ale_pattern_options*
|
|
|
|
|
|
|
|
Type: |Dictionary|
|
2018-07-16 23:18:20 +00:00
|
|
|
Default: undefined
|
2017-05-26 14:59:43 +00:00
|
|
|
|
|
|
|
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: >
|
|
|
|
|
2017-11-11 23:04:08 +00:00
|
|
|
" Use just ESLint for linting and fixing files which end in '.foo.js'
|
2017-05-26 14:59:43 +00:00
|
|
|
let g:ale_pattern_options = {
|
|
|
|
\ '\.foo\.js$': {
|
2017-11-11 23:55:04 +00:00
|
|
|
\ 'ale_linters': ['eslint'],
|
2018-03-26 08:19:58 +00:00
|
|
|
\ 'ale_fixers': ['eslint'],
|
2017-05-26 14:59:43 +00:00
|
|
|
\ },
|
|
|
|
\}
|
|
|
|
<
|
2017-11-11 23:04:08 +00:00
|
|
|
See |b:ale_linters| and |b:ale_fixers| for information for those options.
|
2017-05-26 14:59:43 +00:00
|
|
|
|
|
|
|
Filenames are matched with |match()|, and patterns depend on the |magic|
|
2018-02-26 17:04:54 +00:00
|
|
|
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
|
2017-05-26 14:59:43 +00:00
|
|
|
filename will be used for matching, taken from `expand('%:p')`.
|
|
|
|
|
2017-11-11 13:44:05 +00:00
|
|
|
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 filename `alpha-zebra`.
|
|
|
|
|
2017-05-26 14:59:43 +00:00
|
|
|
|
|
|
|
g:ale_pattern_options_enabled *g:ale_pattern_options_enabled*
|
|
|
|
|
|
|
|
Type: |Number|
|
2018-07-16 23:18:20 +00:00
|
|
|
Default: undefined
|
2017-05-26 14:59:43 +00:00
|
|
|
|
2018-07-16 23:18:20 +00:00
|
|
|
This option can be used for disabling pattern options. If set to `0`, ALE
|
|
|
|
will not set buffer variables per |g:ale_pattern_options|.
|
2017-05-26 14:59:43 +00:00
|
|
|
|
|
|
|
|
2017-05-31 21:04:33 +00:00
|
|
|
g:ale_set_balloons *g:ale_set_balloons*
|
2018-03-25 11:57:08 +00:00
|
|
|
*b:ale_set_balloons*
|
2017-05-31 21:04:33 +00:00
|
|
|
|
|
|
|
Type: |Number|
|
2018-07-20 15:10:25 +00:00
|
|
|
Default: `has('balloon_eval') && has('gui_running')`
|
2017-05-31 21:04:33 +00:00
|
|
|
|
|
|
|
When this option is set to `1`, balloon messages will be displayed for
|
2018-05-30 18:44:01 +00:00
|
|
|
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.
|
2018-03-25 11:57:08 +00:00
|
|
|
|
2018-07-20 15:10:25 +00:00
|
|
|
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_balloons` to `1` before ALE is loaded.
|
|
|
|
|
2018-03-25 11:57:08 +00:00
|
|
|
`b:ale_set_balloons` can be set to `0` to disable balloons for a buffer.
|
|
|
|
Balloons cannot be enabled for a specific buffer when not initially enabled
|
|
|
|
globally.
|
2017-05-31 21:04:33 +00:00
|
|
|
|
2018-05-30 18:44:01 +00:00
|
|
|
Balloons will not be shown when |g:ale_enabled| or |b:ale_enabled| is `0`.
|
|
|
|
|
2017-05-31 21:04:33 +00:00
|
|
|
|
2018-05-17 15:23:29 +00:00
|
|
|
g:ale_set_balloons_legacy_echo *g:ale_set_balloons_legacy_echo*
|
|
|
|
*b:ale_set_balloons_legacy_echo*
|
|
|
|
Type: |Number|
|
|
|
|
Default: undefined
|
|
|
|
|
|
|
|
If set to `1`, moving your mouse over documents in Vim will make ALE ask
|
|
|
|
`tsserver` or `LSP` servers 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.
|
|
|
|
|
|
|
|
|
2017-02-13 00:18:51 +00:00
|
|
|
g:ale_set_highlights *g:ale_set_highlights*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `has('syntax')`
|
|
|
|
|
2017-05-21 18:22:48 +00: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 20:49:13 +00: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-13 00:18:51 +00:00
|
|
|
|
2017-11-17 14:29:51 +00:00
|
|
|
When |g:ale_set_signs| is set to `0`, the following highlights for entire
|
|
|
|
lines will be set.
|
|
|
|
|
|
|
|
|ALEErrorLine| - All items with `'type': 'E'`
|
|
|
|
|ALEWarningLine| - All items with `'type': 'W'`
|
|
|
|
|ALEInfoLine| - All items with `'type': 'I'`
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2017-02-13 00:18:51 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
g:ale_set_loclist *g:ale_set_loclist*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-01-22 15:19:09 +00:00
|
|
|
When this option is set to `1`, the |loclist| will be populated with any
|
2016-10-09 20:20:21 +00: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 23:22:32 +00:00
|
|
|
|
|
|
|
|
2017-01-22 15:19:09 +00:00
|
|
|
g:ale_set_quickfix *g:ale_set_quickfix*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
2017-08-19 13:35:01 +00:00
|
|
|
When this option is set to `1`, the |quickfix| list will be populated with
|
|
|
|
any problems which are found by ALE, instead of the |loclist|. The loclist
|
|
|
|
will never be populated when this option is on.
|
|
|
|
|
|
|
|
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.
|
2017-01-22 15:19:09 +00:00
|
|
|
|
2018-01-25 14:54:33 +00:00
|
|
|
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 instead.
|
|
|
|
|
2017-01-22 15:19:09 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
g:ale_set_signs *g:ale_set_signs*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `has('signs')`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:20:21 +00:00
|
|
|
When this option is set to `1`, the |sign| column will be populated with
|
2017-05-20 22:32:41 +00:00
|
|
|
signs marking where problems appear in the file.
|
|
|
|
|
|
|
|
ALE will use the following highlight groups for problems:
|
|
|
|
|
2017-06-26 20:49:13 +00: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 22:32:41 +00: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 23:22:32 +00:00
|
|
|
|
2017-10-12 22:04:46 +00:00
|
|
|
To limit the number of signs ALE will set, see |g:ale_max_signs|.
|
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
|
|
|
|
g:ale_sign_column_always *g:ale_sign_column_always*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:20:21 +00: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 23:22:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_error *g:ale_sign_error*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `'>>'`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-05-20 22:32:41 +00: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 23:22:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_sign_offset *g:ale_sign_offset*
|
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1000000`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:20:21 +00: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 23:22:32 +00:00
|
|
|
|
|
|
|
|
2017-01-22 15:06:33 +00:00
|
|
|
g:ale_sign_warning *g:ale_sign_warning*
|
2016-10-10 11:53:54 +00:00
|
|
|
|
|
|
|
Type: |String|
|
2017-01-22 15:06:33 +00:00
|
|
|
Default: `'--'`
|
2016-10-10 11:53:54 +00:00
|
|
|
|
2017-05-20 22:32:41 +00:00
|
|
|
The sign for warnings in the sign gutter.
|
2016-10-10 11:53:54 +00:00
|
|
|
|
|
|
|
|
2017-06-14 16:59:13 +00:00
|
|
|
g:ale_type_map *g:ale_type_map*
|
|
|
|
*b:ale_type_map*
|
|
|
|
Type: |Dictionary|
|
|
|
|
Default: `{}`
|
|
|
|
|
2017-09-03 19:12:45 +00:00
|
|
|
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:
|
2017-06-14 16:59:13 +00:00
|
|
|
|
|
|
|
`'E'` - `{'type': 'E'}`
|
|
|
|
`'ES'` - `{'type': 'E', 'sub_type': 'style'}`
|
|
|
|
`'W'` - `{'type': 'W'}`
|
|
|
|
`'WS'` - `{'type': 'W', 'sub_type': 'style'}`
|
|
|
|
`'I'` - `{'type': 'I'}`
|
|
|
|
|
2017-09-03 19:12:45 +00:00
|
|
|
For example, if you want to turn flake8 errors into warnings, you can write
|
2017-06-14 16:59:13 +00:00
|
|
|
the following: >
|
|
|
|
|
2017-07-11 22:14:18 +00:00
|
|
|
let g:ale_type_map = {'flake8': {'ES': 'WS', 'E': 'W'}}
|
2017-06-14 16:59:13 +00:00
|
|
|
<
|
|
|
|
If you wanted to turn style errors and warnings into regular errors and
|
2017-09-03 19:12:45 +00:00
|
|
|
warnings, you can write the following: >
|
2017-06-14 16:59:13 +00:00
|
|
|
|
2017-07-11 22:14:18 +00:00
|
|
|
let g:ale_type_map = {'flake8': {'ES': 'E', 'WS': 'W'}}
|
2017-06-14 16:59:13 +00:00
|
|
|
<
|
|
|
|
Type maps can be set per-buffer with `b:ale_type_map`.
|
|
|
|
|
|
|
|
|
2018-04-09 18:11:20 +00:00
|
|
|
g:ale_use_global_executables *g:ale_use_global_executables*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: not set
|
|
|
|
|
|
|
|
This option can be set to change the default for all `_use_global` options.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
2018-11-06 06:45:40 +00:00
|
|
|
g:ale_virtualtext_cursor *g:ale_virtualtext_cursor*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When this option is set to `1`, a message will be shown 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
|
|
|
|
behavior.
|
|
|
|
|
2018-11-07 06:36:37 +00:00
|
|
|
Messages are only displayed after a short delay. See |g:ale_virtualtext_delay|.
|
2018-11-06 06:45:40 +00:00
|
|
|
|
|
|
|
Messages can be prefixed prefixed with a string. See |g:ale_virtualtext_prefix|.
|
|
|
|
|
2018-11-14 16:21:35 +00:00
|
|
|
Message appearance can be changed by modifying these highlight groups:
|
|
|
|
|ALEVirtualTextError| |ALEVirtualTextWarning|
|
|
|
|
|
|
|
|
|
2018-11-06 06:45:40 +00:00
|
|
|
|
2018-11-07 06:36:37 +00:00
|
|
|
g:ale_virtualtext_delay *g:ale_virtualtext_delay*
|
2018-11-14 16:21:35 +00:00
|
|
|
b:ale_virtualtext_delay *b:ale_virtualtext_delay*
|
2018-11-07 06:36:37 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `10`
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
2018-11-06 06:45:40 +00:00
|
|
|
g:ale_virtualtext_prefix *g:ale_virtualtext_prefix*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `'> '`
|
|
|
|
|
|
|
|
Prefix to be used with |g:ale_virtualtext_cursor|.
|
|
|
|
|
2017-07-08 13:30:12 +00:00
|
|
|
g:ale_virtualenv_dir_names *g:ale_virtualenv_dir_names*
|
|
|
|
b:ale_virtualenv_dir_names *b:ale_virtualenv_dir_names*
|
|
|
|
|
|
|
|
Type: |List|
|
2018-07-15 18:26:45 +00:00
|
|
|
Default: `['.env', '.venv', 'env', 've-py3', 've', 'virtualenv', 'venv']`
|
2017-07-08 13:30:12 +00:00
|
|
|
|
|
|
|
A list of directory names to be used when searching upwards from Python
|
|
|
|
files to discover virtulenv 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.
|
|
|
|
|
|
|
|
|
2017-11-28 10:08:34 +00:00
|
|
|
g:ale_warn_about_trailing_blank_lines *g:ale_warn_about_trailing_blank_lines*
|
|
|
|
b:ale_warn_about_trailing_blank_lines *b:ale_warn_about_trailing_blank_lines*
|
|
|
|
|
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
|
|
|
|
|
|
|
When this option is set to `1`, warnings about trailing blank lines will be
|
|
|
|
shown.
|
|
|
|
|
|
|
|
This option behaves similarly to |g:ale_warn_about_trailing_whitespace|.
|
|
|
|
|
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
g:ale_warn_about_trailing_whitespace *g:ale_warn_about_trailing_whitespace*
|
2017-05-07 16:17:00 +00:00
|
|
|
b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:23:34 +00:00
|
|
|
Type: |Number|
|
|
|
|
Default: `1`
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2016-10-09 20:20:21 +00:00
|
|
|
When this option is set to `1`, warnings relating to trailing whitespace on
|
2017-11-28 10:08:34 +00:00
|
|
|
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 to `0`.
|
2016-10-09 20:20:21 +00:00
|
|
|
|
|
|
|
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 23:22:32 +00:00
|
|
|
|
2017-05-07 16:17:00 +00:00
|
|
|
This option may be configured on a per buffer basis.
|
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-08-31 12:12:24 +00:00
|
|
|
g:ale_windows_node_executable_path *g:ale_windows_node_executable_path*
|
|
|
|
*b:ale_windows_node_executable_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 `.js` file 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.
|
|
|
|
|
|
|
|
|
2017-06-26 20:49:13 +00:00
|
|
|
-------------------------------------------------------------------------------
|
2017-08-28 21:05:12 +00:00
|
|
|
6.1. Highlights *ale-highlights*
|
2017-06-26 20:49:13 +00:00
|
|
|
|
|
|
|
ALEError *ALEError*
|
|
|
|
|
|
|
|
Default: `highlight link ALEError SpellBad`
|
|
|
|
|
|
|
|
The highlight used for highlighted errors. See |g:ale_set_highlights|.
|
|
|
|
|
|
|
|
|
|
|
|
ALEErrorLine *ALEErrorLine*
|
|
|
|
|
|
|
|
Default: Undefined
|
|
|
|
|
2017-11-17 14:29:51 +00:00
|
|
|
The highlight for an entire line where errors appear. Only the first
|
|
|
|
line for a problem will be highlighted.
|
|
|
|
|
|
|
|
See |g:ale_set_signs| and |g:ale_set_highlights|.
|
2017-06-26 20:49:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-11-17 14:29:51 +00:00
|
|
|
The highlight for entire lines where info messages appear. Only the first
|
|
|
|
line for a problem will be highlighted.
|
|
|
|
|
|
|
|
See |g:ale_set_signs| and |g:ale_set_highlights|.
|
2017-06-26 20:49:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-11-17 14:29:51 +00:00
|
|
|
The highlight for entire lines where warnings appear. Only the first line
|
|
|
|
for a problem will be highlighted.
|
|
|
|
|
|
|
|
See |g:ale_set_signs| and |g:ale_set_highlights|.
|
2017-06-26 20:49:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
ALEWarningSign *ALEWarningSign*
|
|
|
|
|
|
|
|
Default: `highlight link ALEWarningSign todo`
|
|
|
|
|
|
|
|
The highlight used for warning signs. See |g:ale_set_signs|.
|
|
|
|
|
|
|
|
|
2017-10-24 23:27:40 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
6.2. Options for write-good *ale-write-good-options*
|
|
|
|
|
|
|
|
The options for the write-good linter are global because it does not make
|
|
|
|
sense to have them specified on a per-language basis.
|
|
|
|
|
|
|
|
g:ale_writegood_executable *g:ale_writegood_executable*
|
|
|
|
*b:ale_writegood_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'writegood'`
|
|
|
|
|
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_writegood_options *g:ale_writegood_options*
|
|
|
|
*b:ale_writegood_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to writegood.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_writegood_use_global *g:ale_writegood_use_global*
|
|
|
|
*b:ale_writegood_use_global*
|
|
|
|
Type: |Number|
|
2018-04-09 18:11:20 +00:00
|
|
|
Default: `get(g:, 'ale_use_global_executables', 0)`
|
2017-10-24 23:27:40 +00:00
|
|
|
|
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
===============================================================================
|
2017-08-28 21:05:12 +00:00
|
|
|
7. Integration Documentation *ale-integrations*
|
2016-10-06 12:42:52 +00:00
|
|
|
|
2017-05-27 17:31:52 +00:00
|
|
|
Linter and fixer options are documented in individual help files. See the
|
|
|
|
table of contents at |ale-contents|.
|
2016-10-06 12:42:52 +00:00
|
|
|
|
2017-05-27 17:31:52 +00: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 22:55:55 +00:00
|
|
|
|
2017-06-18 10:03:31 +00: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
|
|
|
|
<
|
|
|
|
|
2018-04-09 18:11:20 +00:00
|
|
|
|g:ale_use_global_executables| can be set to `1` in your vimrc file to make
|
|
|
|
ALE use global executables for all linters by default.
|
|
|
|
|
2017-06-18 10:03:31 +00:00
|
|
|
The option |g:ale_virtualenv_dir_names| controls the local virtualenv paths
|
|
|
|
ALE will use to search for Python executables.
|
|
|
|
|
2017-01-12 09:33:55 +00:00
|
|
|
|
2016-10-06 12:42:52 +00:00
|
|
|
===============================================================================
|
2017-08-28 21:05:12 +00:00
|
|
|
8. Commands/Keybinds *ale-commands*
|
2017-05-20 18:01:12 +00:00
|
|
|
|
2018-04-22 18:49:24 +00:00
|
|
|
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 (`<CR>`) can be used to jump to a referencing location, or the `t`
|
|
|
|
key can be used to jump to the location in a new tab.
|
|
|
|
|
2018-04-23 20:18:58 +00:00
|
|
|
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|.
|
|
|
|
|
2018-04-22 18:49:24 +00:00
|
|
|
A plug mapping `<Plug>(ale_find_references)` is defined for this command.
|
|
|
|
|
2017-05-20 18:01:12 +00:00
|
|
|
ALEFix *ALEFix*
|
|
|
|
|
|
|
|
Fix problems with the current buffer. See |ale-fix| for more information.
|
|
|
|
|
2017-06-01 20:13:05 +00:00
|
|
|
A plug mapping `<Plug>(ale_fix)` is defined for this command.
|
|
|
|
|
2016-10-24 21:09:41 +00:00
|
|
|
|
2017-06-28 15:20:01 +00:00
|
|
|
ALEFixSuggest *ALEFixSuggest*
|
|
|
|
|
|
|
|
Suggest tools that can be used to fix problems in the current buffer.
|
|
|
|
|
|
|
|
See |ale-fix| for more information.
|
|
|
|
|
|
|
|
|
2017-11-26 23:02:51 +00:00
|
|
|
ALEGoToDefinition *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.
|
|
|
|
|
2018-04-23 20:18:58 +00:00
|
|
|
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|.
|
|
|
|
|
2017-11-26 23:02:51 +00:00
|
|
|
A plug mapping `<Plug>(ale_go_to_definition)` is defined for this command.
|
|
|
|
|
|
|
|
|
|
|
|
ALEGoToDefinitionInTab *ALEGoToDefinitionInTab*
|
|
|
|
|
|
|
|
The same as |ALEGoToDefinition|, but opens results in a new tab.
|
|
|
|
|
|
|
|
A plug mapping `<Plug>(ale_go_to_definition_in_tab)` is defined for this
|
|
|
|
command.
|
|
|
|
|
2018-04-24 20:03:06 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-10-31 16:13:22 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
*:ALELint*
|
2017-02-28 09:10:58 +00: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 13:38:27 +00: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 09:10:58 +00:00
|
|
|
A plug mapping `<Plug>(ale_lint)` is defined for this command.
|
|
|
|
|
|
|
|
|
2016-10-24 21:09:41 +00:00
|
|
|
ALEPrevious *ALEPrevious*
|
|
|
|
ALEPreviousWrap *ALEPreviousWrap*
|
|
|
|
ALENext *ALENext*
|
2017-03-03 02:55:22 +00:00
|
|
|
ALENextWrap *ALENextWrap*
|
2017-06-03 11:45:52 +00:00
|
|
|
ALEFirst *ALEFirst*
|
|
|
|
ALELast *ALELast*
|
2016-10-24 21:09:41 +00:00
|
|
|
*ale-navigation-commands*
|
|
|
|
|
2017-03-07 23:31:25 +00: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 21:09:41 +00: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 15:06:48 +00:00
|
|
|
`ALEFirst` goes to the first error or warning in the buffer, while `ALELast`
|
2017-06-03 11:45:52 +00:00
|
|
|
goes to the last one.
|
|
|
|
|
2016-10-24 21:09:41 +00: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 11:45:52 +00:00
|
|
|
<Plug>(ale_first) - ALEFirst
|
|
|
|
<Plug>(ale_last) - ALELast
|
2016-10-24 21:09:41 +00: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 19:26:18 +00:00
|
|
|
ALEToggle *ALEToggle*
|
2017-03-28 22:04:58 +00:00
|
|
|
ALEEnable *ALEEnable*
|
|
|
|
ALEDisable *ALEDisable*
|
2017-10-29 10:55:02 +00:00
|
|
|
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.
|
|
|
|
|
2017-10-29 17:03:29 +00:00
|
|
|
The following plug mappings are defined, for conveniently defining keybinds:
|
2017-10-29 10:55:02 +00:00
|
|
|
|
|
|
|
|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)`
|
2017-02-12 19:26:18 +00:00
|
|
|
|
2017-10-29 17:03:29 +00:00
|
|
|
For removing problems reported by ALE, but leaving ALE enabled, see
|
|
|
|
|ALEReset| and |ALEResetBuffer|.
|
2017-03-03 02:55:22 +00:00
|
|
|
|
2017-11-14 23:29:48 +00:00
|
|
|
*:ALEDetail*
|
2017-03-03 02:55:22 +00:00
|
|
|
ALEDetail *ALEDetail*
|
|
|
|
|
2018-06-20 22:10:01 +00:00
|
|
|
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|.
|
2017-03-03 02:55:22 +00:00
|
|
|
|
|
|
|
A plug mapping `<Plug>(ale_detail)` is defined for this command.
|
|
|
|
|
2017-06-26 21:08:55 +00:00
|
|
|
|
2017-08-28 21:05:12 +00:00
|
|
|
*:ALEInfo*
|
2017-06-26 21:08:55 +00: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.
|
|
|
|
|
2018-04-08 18:04:07 +00:00
|
|
|
`:ALEInfoToFile` will write the ALE runtime information to a given filename.
|
|
|
|
The filename works just like |:w|.
|
|
|
|
|
2017-06-26 21:08:55 +00:00
|
|
|
|
2017-10-29 17:03:29 +00:00
|
|
|
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|.
|
|
|
|
|
|
|
|
|
2018-03-06 10:23:49 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2016-10-24 21:09:41 +00:00
|
|
|
===============================================================================
|
2017-08-28 21:05:12 +00:00
|
|
|
9. API *ale-api*
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
ale#Env(variable_name, 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#Pad(string) *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.
|
|
|
|
|
|
|
|
|
2017-08-08 22:52:28 +00:00
|
|
|
ale#Queue(delay, [linting_flag, buffer_number]) *ale#Queue()*
|
2017-03-14 23:51:57 +00:00
|
|
|
|
2016-10-05 23:22:32 +00: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 13:38:27 +00: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 23:51:57 +00:00
|
|
|
|
2017-08-08 22:52:28 +00:00
|
|
|
An optional `buffer_number` argument can be given for specifying the buffer
|
|
|
|
to check. The active buffer (`bufnr('')`) will be checked by default.
|
|
|
|
|
2017-08-08 23:05:55 +00:00
|
|
|
*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.
|
|
|
|
|
2016-10-09 20:20:21 +00:00
|
|
|
|
2017-03-31 19:14:53 +00:00
|
|
|
ale#engine#CreateDirectory(buffer) *ale#engine#CreateDirectory()*
|
|
|
|
|
|
|
|
Create a new temporary directory with a unique name, and manage that
|
2018-07-15 17:24:53 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
ale#engine#CreateFile(buffer) *ale#engine#CreateFile()*
|
|
|
|
|
|
|
|
Create a new temporary file with a unique name, and manage that file with
|
|
|
|
|ale#engine#ManageFile()|, so it will be removed as soon as possible.
|
2017-03-31 19:14:53 +00:00
|
|
|
|
|
|
|
It is advised to only call this function from a callback function for
|
|
|
|
returning a linter command to run.
|
|
|
|
|
|
|
|
|
2017-02-11 18:14:18 +00: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 19:21:32 +00:00
|
|
|
ale#engine#GetLoclist(buffer) *ale#engine#GetLoclist()*
|
|
|
|
|
2017-11-15 09:16:26 +00:00
|
|
|
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()|.
|
2016-10-24 19:21:32 +00:00
|
|
|
|
|
|
|
|
2018-02-25 12:57:54 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2017-02-11 15:16:08 +00: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-11-22 15:31:39 +00:00
|
|
|
ale#fix#registry#Add(name, func, filetypes, desc, [aliases])
|
|
|
|
*ale#fix#registry#Add()*
|
2017-05-20 18:01:12 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2017-11-22 15:31:39 +00:00
|
|
|
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`.
|
|
|
|
|
2017-05-20 18:01:12 +00: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 18:51:29 +00:00
|
|
|
ale#linter#Define(filetype, linter) *ale#linter#Define()*
|
2017-03-22 08:57:29 +00:00
|
|
|
|
2016-10-05 23:22:32 +00: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.
|
|
|
|
|
2017-08-07 12:31:29 +00:00
|
|
|
This argument is required, unless the linter is an
|
|
|
|
LSP linter. In which case, this argument must not be
|
2018-07-01 15:23:42 +00:00
|
|
|
defined, as LSP linters handle diagnostics
|
2017-08-07 12:31:29 +00:00
|
|
|
automatically. See |ale-lsp-linters|.
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2018-07-13 08:47:26 +00:00
|
|
|
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.
|
|
|
|
|
2017-02-26 14:51:22 +00:00
|
|
|
The keys for each item in the List will be handled in
|
|
|
|
the following manner:
|
2017-07-15 23:40:20 +00:00
|
|
|
*ale-loclist-format*
|
2017-02-26 14:51:22 +00:00
|
|
|
`text` - This error message is required.
|
2018-06-20 22:10:01 +00:00
|
|
|
`detail` - An optional, more descriptive message.
|
|
|
|
This message can be displayed with the |ALEDetail|
|
|
|
|
command instead of the message for `text`, if set.
|
2017-02-26 14:51:22 +00:00
|
|
|
`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
|
2017-10-02 16:11:54 +00:00
|
|
|
converted to number using `str2nr()`.
|
2017-07-15 23:40:20 +00:00
|
|
|
`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.
|
2017-08-19 23:16:28 +00:00
|
|
|
`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 asssumed
|
|
|
|
to be the buffer being checked, unless the `bufnr`
|
|
|
|
key is also set with a valid number for some other
|
|
|
|
buffer.
|
2017-02-26 14:51:22 +00:00
|
|
|
`vcol` - Defaults to `0`.
|
2018-04-08 16:17:30 +00:00
|
|
|
|
|
|
|
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.
|
2017-02-26 14:51:22 +00:00
|
|
|
`type` - Defaults to `'E'`.
|
|
|
|
`nr` - Defaults to `-1`.
|
|
|
|
|
2018-08-02 16:18:43 +00:00
|
|
|
Numeric error code. If `nr` is not `-1`, `code`
|
|
|
|
likely should contain the string representation of
|
2018-07-30 22:19:59 +00:00
|
|
|
the same value.
|
2018-08-02 16:18:43 +00:00
|
|
|
`code` - No default; may be unset.
|
2018-07-30 22:19:59 +00:00
|
|
|
|
2018-08-02 16:18:43 +00:00
|
|
|
Human-readable |String| error code.
|
2018-07-30 22:19:59 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
`executable` A |String| naming the executable itself which
|
2017-03-02 00:06:09 +00:00
|
|
|
will be run. This value will be used to check if the
|
2016-10-05 23:22:32 +00: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 23:11:26 +00: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 17:06:26 +00:00
|
|
|
*ale-command-chain*
|
2017-02-09 09:42:17 +00: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 23:11:26 +00: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 09:42:17 +00: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 23:32:57 +00: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 09:42:17 +00:00
|
|
|
|
2016-10-05 23:22:32 +00: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 16:08:11 +00: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 23:22:32 +00:00
|
|
|
|
2017-02-09 23:32:57 +00: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 17:06:26 +00:00
|
|
|
*ale-lint-file*
|
2017-03-21 14:52:02 +00: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
|
2017-12-10 13:03:03 +00:00
|
|
|
manually, per |ALELintPost-autocmd|.
|
2017-03-21 14:52:02 +00:00
|
|
|
|
|
|
|
When this option is set to `1`, `read_buffer` will
|
|
|
|
be set automatically to `0`. The two options cannot
|
|
|
|
be used together.
|
|
|
|
|
2017-08-07 12:31:29 +00:00
|
|
|
*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
|
2018-07-03 00:41:46 +00:00
|
|
|
process for a language server running, and
|
2017-08-07 12:31:29 +00:00
|
|
|
communicates with it directly via a |channel|.
|
2018-07-03 00:41:46 +00:00
|
|
|
`executable` or `executable_callback` must be set,
|
|
|
|
and `command` or `command_callback` must be set.
|
|
|
|
|
|
|
|
When this argument is set to `'socket'`, then the
|
|
|
|
linter will be defined as an LSP linter via a TCP
|
|
|
|
socket connection. `address_callback` must be set
|
|
|
|
with a callback returning an address to connect to.
|
|
|
|
ALE will not start a server automatically.
|
2017-08-07 12:31:29 +00:00
|
|
|
|
2018-07-04 12:12:58 +00:00
|
|
|
When this argument is not empty
|
|
|
|
`project_root_callback` must be defined.
|
|
|
|
|
|
|
|
`language` or `language_callback` can be defined to
|
|
|
|
describe the language for a file. The filetype will
|
|
|
|
be used as the language by default.
|
2017-08-07 12:31:29 +00:00
|
|
|
|
2017-10-02 16:11:54 +00:00
|
|
|
LSP linters handle diagnostics automatically, so
|
2017-08-07 12:31:29 +00:00
|
|
|
the `callback` argument must not be defined.
|
|
|
|
|
2018-05-30 19:44:09 +00:00
|
|
|
An optional `completion_filter` callback may be
|
|
|
|
defined for filtering completion results.
|
|
|
|
|
2018-06-06 15:58:49 +00:00
|
|
|
An optional `initialization_options` or
|
|
|
|
`initialization_options_callback` may be defined to
|
|
|
|
pass initialization options to the LSP.
|
|
|
|
|
2018-10-30 15:54:40 +00:00
|
|
|
An optional `lsp_config` or `lsp_config_callback` may
|
|
|
|
be defined to pass configuration settings to the LSP.
|
|
|
|
|
2018-07-03 00:41:46 +00:00
|
|
|
`address_callback` A |String| or |Funcref| for a callback function
|
|
|
|
accepting a buffer number. A |String| should be
|
|
|
|
returned with an address to connect to.
|
|
|
|
|
|
|
|
This argument must only be set if the `lsp` argument
|
|
|
|
is set to `'socket'`.
|
|
|
|
|
2018-05-30 19:23:57 +00:00
|
|
|
`project_root_callback` A |String| or |Funcref| for a callback function
|
2017-08-07 12:31:29 +00:00
|
|
|
accepting a buffer number. A |String| should be
|
|
|
|
returned representing the path to the project for the
|
|
|
|
file being checked with the language server. 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.
|
|
|
|
|
2018-04-27 21:52:11 +00:00
|
|
|
`language` A |String| representing the name of the language
|
|
|
|
being checked. This string will be sent to the LSP to
|
|
|
|
tell it what type of language is being checked.
|
|
|
|
|
2018-07-04 12:12:58 +00:00
|
|
|
If this or `language_callback` isn't set, the
|
|
|
|
language will default to the value of the filetype
|
|
|
|
given to |ale#linter#Define|.
|
2018-04-27 21:52:11 +00:00
|
|
|
|
2017-08-07 12:31:29 +00:00
|
|
|
`language_callback` A |String| or |Funcref| for a callback function
|
|
|
|
accepting a buffer number. A |String| should be
|
|
|
|
returned representing the name of the language being
|
|
|
|
checked.
|
|
|
|
|
2018-04-27 21:52:11 +00:00
|
|
|
This option can be used instead of `language` if a
|
|
|
|
linter can check multiple languages.
|
2017-08-07 12:31:29 +00:00
|
|
|
|
2018-05-30 19:44:09 +00:00
|
|
|
`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
|
|
|
|
|
2017-05-27 20:27:42 +00:00
|
|
|
`aliases` A |List| of aliases for the linter name.
|
|
|
|
|
2017-08-07 12:31:29 +00:00
|
|
|
This argument can be set with alternative names for
|
|
|
|
selecting the linter with |g:ale_linters|. This
|
2017-05-27 20:27:42 +00:00
|
|
|
setting can make it easier to guess the linter name
|
|
|
|
by offering a few alternatives.
|
|
|
|
|
2018-06-06 15:58:49 +00:00
|
|
|
`initialization_options` A |Dictionary| of initialization options for LSPs.
|
|
|
|
This will be fed (as JSON) to the LSP in the
|
|
|
|
initialize command.
|
|
|
|
|
|
|
|
`initialization_options_callback`
|
|
|
|
A |String| or |Funcref| for a callback function
|
|
|
|
accepting a buffer number. A |Dictionary| should be
|
|
|
|
returned for initialization options to pass the LSP.
|
|
|
|
This can be used in place of `initialization_options`
|
|
|
|
when more complicated processing is needed.
|
|
|
|
|
2018-10-30 15:54:40 +00:00
|
|
|
`lsp_config` A |Dictionary| of configuration settings for LSPs.
|
|
|
|
This will be fed (as JSON) to the LSP in the
|
|
|
|
workspace/didChangeConfiguration command.
|
|
|
|
|
|
|
|
`lsp_config_callback` A |String| or |Funcref| for a callback function
|
|
|
|
accepting a buffer number. A |Dictionary| should be
|
|
|
|
returned for configuration settings to pass the LSP.
|
|
|
|
This can be used in place of `lsp_config` when more
|
|
|
|
complicated processing is needed.
|
|
|
|
|
2017-02-09 09:42:17 +00: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 15:16:08 +00: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 17:06:26 +00:00
|
|
|
*ale-command-format-strings*
|
|
|
|
|
2017-02-11 18:14:18 +00: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 23:22:32 +00:00
|
|
|
For example: >
|
2017-02-11 18:14:18 +00:00
|
|
|
'command': 'eslint -f unix --stdin --stdin-filename %s'
|
2016-10-05 23:22:32 +00:00
|
|
|
<
|
2017-02-11 18:14:18 +00: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-02 00:06:09 +00:00
|
|
|
contents of the buffer being checked. All occurrences of `%t` in command
|
2017-02-11 18:14:18 +00: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',
|
2018-07-05 19:56:31 +00:00
|
|
|
<
|
|
|
|
Any substring `%e` will be replaced with the escaped executable supplied
|
|
|
|
with `executable` or `executable_callback`. 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',
|
2017-02-11 18:14:18 +00:00
|
|
|
<
|
|
|
|
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
|
2018-07-05 19:56:31 +00:00
|
|
|
possibly contain `%%`, `%s`, `%t`, or `%e`, where the special formatting
|
|
|
|
behavior is not desired, the |ale#engine#EscapeCommandPart()| function can
|
|
|
|
be used to replace those characters to avoid formatting issues.
|
2017-02-11 18:14:18 +00:00
|
|
|
|
2018-04-24 20:56:34 +00:00
|
|
|
*ale-linter-loading-behavior*
|
2017-04-24 21:40:15 +00: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.
|
|
|
|
|
2018-04-24 20:48:33 +00:00
|
|
|
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}')},
|
|
|
|
\})
|
|
|
|
<
|
2016-10-05 23:22:32 +00: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 18:51:29 +00:00
|
|
|
ale#linter#Get(filetype) *ale#linter#Get()*
|
2017-03-22 08:57:29 +00:00
|
|
|
|
2016-10-05 23:22:32 +00: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 18:51:29 +00:00
|
|
|
|Dictionary| values in the format specified by |ale#linter#Define()|.
|
2016-10-05 23:22:32 +00:00
|
|
|
|
2017-10-02 16:11:54 +00:00
|
|
|
Filetypes may be dot-separated to invoke linters for multiple filetypes:
|
2016-10-22 13:29:30 +00:00
|
|
|
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
|
2017-10-02 16:11:54 +00:00
|
|
|
are applied after dot-separated filetypes are broken up into their
|
2016-10-22 13:29:30 +00:00
|
|
|
components.
|
|
|
|
|
2016-10-09 20:20:21 +00:00
|
|
|
|
2018-04-24 20:48:33 +00:00
|
|
|
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.
|
|
|
|
|
2018-10-29 18:28:28 +00:00
|
|
|
ale#other_source#ShowResults(buffer, linter_name, loclist)
|
|
|
|
*ale#other_source#ShowResults()*
|
|
|
|
|
|
|
|
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(buffer, linter_name)
|
|
|
|
*ale#other_source#StartChecking()*
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-04-24 20:48:33 +00:00
|
|
|
|
2017-05-25 12:32:46 +00:00
|
|
|
ale#statusline#Count(buffer) *ale#statusline#Count()*
|
2017-05-24 09:23:13 +00:00
|
|
|
|
2017-05-25 12:32:46 +00: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 08:57:29 +00:00
|
|
|
|
2017-05-24 09:23:13 +00: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 16:48:47 +00:00
|
|
|
|
2016-10-09 20:20:21 +00:00
|
|
|
|
2018-03-03 16:22:56 +00:00
|
|
|
b:ale_linted *b:ale_linted*
|
|
|
|
|
|
|
|
`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'
|
|
|
|
<
|
|
|
|
|
2018-10-29 18:28:28 +00:00
|
|
|
g:ale_want_results_buffer *g:ale_want_results_buffer*
|
|
|
|
|
|
|
|
`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.
|
|
|
|
|
|
|
|
|
2017-12-17 12:11:30 +00:00
|
|
|
ALELintPre *ALELintPre-autocmd*
|
2018-10-29 18:28:28 +00:00
|
|
|
*ALELintPre*
|
2017-12-17 12:11:30 +00:00
|
|
|
ALELintPost *ALELintPost-autocmd*
|
2018-10-29 18:28:28 +00:00
|
|
|
*ALELintPost*
|
2017-12-23 13:13:55 +00:00
|
|
|
ALEFixPre *ALEFixPre-autocmd*
|
2018-10-29 18:28:28 +00:00
|
|
|
*ALEFixPre*
|
2017-12-23 13:13:55 +00:00
|
|
|
ALEFixPost *ALEFixPost-autocmd*
|
2018-10-29 18:28:28 +00:00
|
|
|
*ALEFixPost*
|
2017-03-22 08:57:29 +00:00
|
|
|
|
2017-12-23 13:13:55 +00:00
|
|
|
These |User| autocommands are triggered before and after every lint or fix
|
|
|
|
cycle. They can be used to update statuslines, send notifications, etc.
|
2017-07-13 23:33:03 +00:00
|
|
|
The autocmd commands are run with |:silent|, so |:unsilent| is required for
|
|
|
|
echoing messges.
|
2016-10-13 13:01:48 +00:00
|
|
|
|
2017-12-10 13:03:03 +00:00
|
|
|
For example to change the color of the statusline while the linter is
|
|
|
|
running:
|
|
|
|
>
|
|
|
|
augroup ALEProgress
|
|
|
|
autocmd!
|
|
|
|
autocmd User ALELintPre hi Statusline ctermfg=darkgrey
|
2018-08-23 18:24:47 +00:00
|
|
|
autocmd User ALELintPost hi Statusline ctermfg=NONE
|
2018-10-29 18:28:28 +00:00
|
|
|
augroup END
|
2017-12-10 13:03:03 +00:00
|
|
|
<
|
|
|
|
Or to display the progress in the statusline:
|
|
|
|
>
|
|
|
|
let s:ale_running = 0
|
|
|
|
let l:stl .= '%{s:ale_running ? "[linting]" : ""}'
|
|
|
|
augroup ALEProgress
|
|
|
|
autocmd!
|
|
|
|
autocmd User ALELintPre let s:ale_running = 1 | redrawstatus
|
|
|
|
autocmd User ALELintPost let s:ale_running = 0 | redrawstatus
|
2018-10-29 18:28:28 +00:00
|
|
|
augroup END
|
2018-04-27 22:40:02 +00:00
|
|
|
|
2017-12-10 13:03:03 +00:00
|
|
|
<
|
2018-04-27 22:40:02 +00:00
|
|
|
ALEJobStarted *ALEJobStarted-autocmd*
|
2018-10-29 18:28:28 +00:00
|
|
|
*ALEJobStarted*
|
2018-04-27 22:40:02 +00:00
|
|
|
|
|
|
|
This |User| autocommand is triggered immediately after a job is successfully
|
|
|
|
run. This provides better accuracy for checking linter status with
|
2018-04-28 05:32:21 +00:00
|
|
|
|ale#engine#IsCheckingBuffer()| over |ALELintPre-autocmd|, which is actually
|
2018-04-27 22:40:02 +00:00
|
|
|
triggered before any linters are executed.
|
2017-12-17 12:11:30 +00:00
|
|
|
|
|
|
|
|
2018-10-29 18:28:28 +00:00
|
|
|
ALEWantResults *ALEWantResults-autocmd*
|
|
|
|
*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:ale_want_results_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.
|
|
|
|
|
|
|
|
|
2016-10-11 20:55:26 +00:00
|
|
|
===============================================================================
|
2017-08-28 21:05:12 +00:00
|
|
|
10. Special Thanks *ale-special-thanks*
|
2016-10-11 20:55:26 +00:00
|
|
|
|
|
|
|
Special thanks to Mark Grealish (https://www.bhalash.com/) for providing ALE's
|
|
|
|
snazzy looking ale glass logo. Cheers, Mark!
|
2016-10-09 20:20:21 +00:00
|
|
|
|
2016-10-05 23:22:32 +00:00
|
|
|
===============================================================================
|
2017-08-28 21:05:12 +00:00
|
|
|
11. Contact *ale-contact*
|
2016-10-05 23:22:32 +00: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.
|
|
|
|
|
2018-06-28 15:20:30 +00:00
|
|
|
===============================================================================
|
2016-10-05 23:22:32 +00:00
|
|
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|