You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2570 lines
110 KiB

  1. *ale.txt* For Vim version 8.0.
  2. *ale*
  3. ALE - Asynchronous Lint Engine
  4. ===============================================================================
  5. CONTENTS *ale-contents*
  6. 1. Introduction.........................|ale-introduction|
  7. 2. Supported Languages & Tools..........|ale-support|
  8. 3. Linting..............................|ale-lint|
  9. 4. Fixing Problems......................|ale-fix|
  10. 5. Language Server Protocol Support.....|ale-lsp|
  11. 5.1 Completion........................|ale-completion|
  12. 5.2 Go To Definition..................|ale-go-to-definition|
  13. 5.3 Find References...................|ale-find-references|
  14. 6. Global Options.......................|ale-options|
  15. 6.1 Highlights........................|ale-highlights|
  16. 6.2 Options for write-good Linter.....|ale-write-good-options|
  17. 7. Integration Documentation............|ale-integrations|
  18. asciidoc..............................|ale-asciidoc-options|
  19. write-good..........................|ale-asciidoc-write-good|
  20. asm...................................|ale-asm-options|
  21. gcc.................................|ale-asm-gcc|
  22. awk...................................|ale-awk-options|
  23. gawk................................|ale-awk-gawk|
  24. c.....................................|ale-c-options|
  25. clang...............................|ale-c-clang|
  26. clang-format........................|ale-c-clangformat|
  27. clangtidy...........................|ale-c-clangtidy|
  28. cppcheck............................|ale-c-cppcheck|
  29. flawfinder..........................|ale-c-flawfinder|
  30. gcc.................................|ale-c-gcc|
  31. chef..................................|ale-chef-options|
  32. foodcritic..........................|ale-chef-foodcritic|
  33. clojure...............................|ale-clojure-options|
  34. joker...............................|ale-clojure-joker|
  35. cmake.................................|ale-cmake-options|
  36. cmakelint...........................|ale-cmake-cmakelint|
  37. cpp...................................|ale-cpp-options|
  38. clang...............................|ale-cpp-clang|
  39. clangcheck..........................|ale-cpp-clangcheck|
  40. clang-format........................|ale-cpp-clangformat|
  41. clangtidy...........................|ale-cpp-clangtidy|
  42. cppcheck............................|ale-cpp-cppcheck|
  43. cpplint.............................|ale-cpp-cpplint|
  44. cquery..............................|ale-cpp-cquery|
  45. flawfinder..........................|ale-cpp-flawfinder|
  46. gcc.................................|ale-cpp-gcc|
  47. c#....................................|ale-cs-options|
  48. mcs.................................|ale-cs-mcs|
  49. mcsc................................|ale-cs-mcsc|
  50. css...................................|ale-css-options|
  51. prettier............................|ale-css-prettier|
  52. stylelint...........................|ale-css-stylelint|
  53. cuda..................................|ale-cuda-options|
  54. nvcc................................|ale-cuda-nvcc|
  55. dart..................................|ale-dart-options|
  56. dartanalyzer........................|ale-dart-dartanalyzer|
  57. dockerfile............................|ale-dockerfile-options|
  58. hadolint............................|ale-dockerfile-hadolint|
  59. elixir................................|ale-elixir-options|
  60. mix.................................|ale-elixir-mix|
  61. mix_format..........................|ale-elixir-mix-format|
  62. dialyxir............................|ale-elixir-dialyxir|
  63. elm...................................|ale-elm-options|
  64. elm-format..........................|ale-elm-elm-format|
  65. elm-make............................|ale-elm-elm-make|
  66. erlang................................|ale-erlang-options|
  67. erlc................................|ale-erlang-erlc|
  68. syntaxerl...........................|ale-erlang-syntaxerl|
  69. eruby.................................|ale-eruby-options|
  70. fish..................................|ale-fish-options|
  71. fortran...............................|ale-fortran-options|
  72. gcc.................................|ale-fortran-gcc|
  73. fountain..............................|ale-fountain-options|
  74. fusionscript..........................|ale-fuse-options|
  75. fusion-lint.........................|ale-fuse-fusionlint|
  76. git commit............................|ale-gitcommit-options|
  77. gitlint.............................|ale-gitcommit-gitlint|
  78. glsl..................................|ale-glsl-options|
  79. glslang.............................|ale-glsl-glslang|
  80. glslls..............................|ale-glsl-glslls|
  81. go....................................|ale-go-options|
  82. gobuild.............................|ale-go-gobuild|
  83. gofmt...............................|ale-go-gofmt|
  84. gometalinter........................|ale-go-gometalinter|
  85. staticcheck.........................|ale-go-staticcheck|
  86. graphql...............................|ale-graphql-options|
  87. eslint..............................|ale-graphql-eslint|
  88. gqlint..............................|ale-graphql-gqlint|
  89. prettier............................|ale-graphql-prettier|
  90. handlebars............................|ale-handlebars-options|
  91. ember-template-lint.................|ale-handlebars-embertemplatelint|
  92. haskell...............................|ale-haskell-options|
  93. argon...............................|ale-haskell-argon|
  94. brittany............................|ale-haskell-brittany|
  95. ghc.................................|ale-haskell-ghc|
  96. hdevtools...........................|ale-haskell-hdevtools|
  97. hfmt................................|ale-haskell-hfmt|
  98. stack-build.........................|ale-haskell-stack-build|
  99. html..................................|ale-html-options|
  100. htmlhint............................|ale-html-htmlhint|
  101. tidy................................|ale-html-tidy|
  102. write-good..........................|ale-html-write-good|
  103. idris.................................|ale-idris-options|
  104. idris...............................|ale-idris-idris|
  105. java..................................|ale-java-options|
  106. checkstyle..........................|ale-java-checkstyle|
  107. javac...............................|ale-java-javac|
  108. google-java-format..................|ale-java-google-java-format|
  109. pmd.................................|ale-java-pmd|
  110. javascript............................|ale-javascript-options|
  111. eslint..............................|ale-javascript-eslint|
  112. flow................................|ale-javascript-flow|
  113. importjs............................|ale-javascript-importjs|
  114. jscs................................|ale-javascript-jscs|
  115. jshint..............................|ale-javascript-jshint|
  116. prettier............................|ale-javascript-prettier|
  117. prettier-eslint.....................|ale-javascript-prettier-eslint|
  118. prettier-standard...................|ale-javascript-prettier-standard|
  119. standard............................|ale-javascript-standard|
  120. xo..................................|ale-javascript-xo|
  121. json..................................|ale-json-options|
  122. fixjson.............................|ale-json-fixjson|
  123. jsonlint............................|ale-json-jsonlint|
  124. jq..................................|ale-json-jq|
  125. prettier............................|ale-json-prettier|
  126. kotlin................................|ale-kotlin-options|
  127. kotlinc.............................|ale-kotlin-kotlinc|
  128. ktlint..............................|ale-kotlin-ktlint|
  129. latex.................................|ale-latex-options|
  130. write-good..........................|ale-latex-write-good|
  131. less..................................|ale-less-options|
  132. lessc...............................|ale-less-lessc|
  133. prettier............................|ale-less-prettier|
  134. stylelint...........................|ale-less-stylelint|
  135. llvm..................................|ale-llvm-options|
  136. llc.................................|ale-llvm-llc|
  137. lua...................................|ale-lua-options|
  138. luac................................|ale-lua-luac|
  139. luacheck............................|ale-lua-luacheck|
  140. markdown..............................|ale-markdown-options|
  141. mdl.................................|ale-markdown-mdl|
  142. prettier............................|ale-markdown-prettier|
  143. textlint............................|ale-markdown-textlint|
  144. write-good..........................|ale-markdown-write-good|
  145. mercury...............................|ale-mercury-options|
  146. mmc.................................|ale-mercury-mmc|
  147. nasm..................................|ale-nasm-options|
  148. nasm................................|ale-nasm-nasm|
  149. nroff.................................|ale-nroff-options|
  150. write-good..........................|ale-nroff-write-good|
  151. objc..................................|ale-objc-options|
  152. clang...............................|ale-objc-clang|
  153. objcpp................................|ale-objcpp-options|
  154. clang...............................|ale-objcpp-clang|
  155. ocaml.................................|ale-ocaml-options|
  156. merlin..............................|ale-ocaml-merlin|
  157. ols.................................|ale-ocaml-ols|
  158. perl..................................|ale-perl-options|
  159. perl................................|ale-perl-perl|
  160. perlcritic..........................|ale-perl-perlcritic|
  161. perltidy............................|ale-perl-perltidy|
  162. php...................................|ale-php-options|
  163. hack................................|ale-php-hack|
  164. hackfmt.............................|ale-php-hackfmt|
  165. langserver..........................|ale-php-langserver|
  166. phan................................|ale-php-phan|
  167. phpcbf..............................|ale-php-phpcbf|
  168. phpcs...............................|ale-php-phpcs|
  169. phpmd...............................|ale-php-phpmd|
  170. phpstan.............................|ale-php-phpstan|
  171. php-cs-fixer........................|ale-php-php-cs-fixer|
  172. po....................................|ale-po-options|
  173. write-good..........................|ale-po-write-good|
  174. pod...................................|ale-pod-options|
  175. write-good..........................|ale-pod-write-good|
  176. pony..................................|ale-pony-options|
  177. ponyc...............................|ale-pony-ponyc|
  178. proto.................................|ale-proto-options|
  179. protoc-gen-lint.....................|ale-proto-protoc-gen-lint|
  180. pug...................................|ale-pug-options|
  181. puglint.............................|ale-pug-puglint|
  182. puppet................................|ale-puppet-options|
  183. puppetlint..........................|ale-puppet-puppetlint|
  184. python................................|ale-python-options|
  185. autopep8............................|ale-python-autopep8|
  186. black...............................|ale-python-black|
  187. flake8..............................|ale-python-flake8|
  188. isort...............................|ale-python-isort|
  189. mypy................................|ale-python-mypy|
  190. prospector..........................|ale-python-prospector|
  191. pycodestyle.........................|ale-python-pycodestyle|
  192. pyflakes............................|ale-python-pyflakes|
  193. pylint..............................|ale-python-pylint|
  194. pyls................................|ale-python-pyls|
  195. yapf................................|ale-python-yapf|
  196. qml...................................|ale-qml-options|
  197. qmlfmt..............................|ale-qml-qmlfmt|
  198. r.....................................|ale-r-options|
  199. lintr...............................|ale-r-lintr|
  200. reasonml..............................|ale-reasonml-options|
  201. merlin..............................|ale-reasonml-merlin|
  202. ols.................................|ale-reasonml-ols|
  203. refmt...............................|ale-reasonml-refmt|
  204. restructuredtext......................|ale-restructuredtext-options|
  205. write-good..........................|ale-restructuredtext-write-good|
  206. ruby..................................|ale-ruby-options|
  207. brakeman............................|ale-ruby-brakeman|
  208. rails_best_practices................|ale-ruby-rails_best_practices|
  209. reek................................|ale-ruby-reek|
  210. rubocop.............................|ale-ruby-rubocop|
  211. ruby................................|ale-ruby-ruby|
  212. rufo................................|ale-ruby-rufo|
  213. rust..................................|ale-rust-options|
  214. cargo...............................|ale-rust-cargo|
  215. rls.................................|ale-rust-rls|
  216. rustc...............................|ale-rust-rustc|
  217. rustfmt.............................|ale-rust-rustfmt|
  218. sass..................................|ale-sass-options|
  219. stylelint...........................|ale-sass-stylelint|
  220. scala.................................|ale-scala-options|
  221. scalafmt............................|ale-scala-scalafmt|
  222. scalastyle..........................|ale-scala-scalastyle|
  223. scss..................................|ale-scss-options|
  224. prettier............................|ale-scss-prettier|
  225. stylelint...........................|ale-scss-stylelint|
  226. sh....................................|ale-sh-options|
  227. shell...............................|ale-sh-shell|
  228. shellcheck..........................|ale-sh-shellcheck|
  229. shfmt...............................|ale-sh-shfmt|
  230. sml...................................|ale-sml-options|
  231. smlnj...............................|ale-sml-smlnj|
  232. solidity..............................|ale-solidity-options|
  233. solhint.............................|ale-solidity-solhint|
  234. solium..............................|ale-solidity-solium|
  235. spec..................................|ale-spec-options|
  236. rpmlint.............................|ale-spec-rpmlint|
  237. stylus................................|ale-stylus-options|
  238. stylelint...........................|ale-stylus-stylelint|
  239. tcl...................................|ale-tcl-options|
  240. nagelfar............................|ale-tcl-nagelfar|
  241. terraform.............................|ale-terraform-options|
  242. tflint..............................|ale-terraform-tflint|
  243. tex...................................|ale-tex-options|
  244. chktex..............................|ale-tex-chktex|
  245. lacheck.............................|ale-tex-lacheck|
  246. texinfo...............................|ale-texinfo-options|
  247. write-good..........................|ale-texinfo-write-good|
  248. text..................................|ale-text-options|
  249. textlint............................|ale-text-textlint|
  250. write-good..........................|ale-text-write-good|
  251. thrift................................|ale-thrift-options|
  252. thrift..............................|ale-thrift-thrift|
  253. typescript............................|ale-typescript-options|
  254. eslint..............................|ale-typescript-eslint|
  255. prettier............................|ale-typescript-prettier|
  256. tslint..............................|ale-typescript-tslint|
  257. tsserver............................|ale-typescript-tsserver|
  258. verilog/systemverilog.................|ale-verilog-options|
  259. iverilog............................|ale-verilog-iverilog|
  260. verilator...........................|ale-verilog-verilator|
  261. vim...................................|ale-vim-options|
  262. vint................................|ale-vim-vint|
  263. vim help..............................|ale-vim-help-options|
  264. write-good..........................|ale-vim-help-write-good|
  265. vue...................................|ale-vue-options|
  266. prettier............................|ale-vue-prettier|
  267. xhtml.................................|ale-xhtml-options|
  268. write-good..........................|ale-xhtml-write-good|
  269. xml...................................|ale-xml-options|
  270. xmllint.............................|ale-xml-xmllint|
  271. yaml..................................|ale-yaml-options|
  272. swaglint............................|ale-yaml-swaglint|
  273. yamllint............................|ale-yaml-yamllint|
  274. 8. Commands/Keybinds....................|ale-commands|
  275. 9. API..................................|ale-api|
  276. 10. Special Thanks......................|ale-special-thanks|
  277. 11. Contact.............................|ale-contact|
  278. ===============================================================================
  279. 1. Introduction *ale-introduction*
  280. ALE provides the means to run linters asynchronously in Vim in a variety of
  281. languages and tools. ALE sends the contents of buffers to linter programs
  282. using the |job-control| features available in Vim 8 and NeoVim. For Vim 8,
  283. Vim must be compiled with the |job| and |channel| and |timers| features
  284. as a minimum.
  285. ALE supports the following key features for linting:
  286. 1. Running linters when text is changed.
  287. 2. Running linters when files are opened.
  288. 3. Running linters when files are saved. (When a global flag is set.)
  289. 4. Populating the |loclist| with warning and errors.
  290. 5. Setting |signs| with warnings and errors for error markers.
  291. 6. Using |echo| to show error messages when the cursor moves.
  292. 7. Setting syntax highlights for errors.
  293. ALE can fix problems with files with the |ALEFix| command, using the same job
  294. control functionality used for checking for problems. Try using the
  295. |ALEFixSuggest| command for browsing tools that can be used to fix problems
  296. for the current buffer.
  297. ===============================================================================
  298. 2. Supported Languages & Tools *ale-support*
  299. The following languages and tools are supported.
  300. Notes:
  301. `^` No linters for text or Vim help filetypes are enabled by default.
  302. `!!` These linters check only files on disk. See |ale-lint-file-linters|
  303. * ASM: `gcc`
  304. * Ansible: `ansible-lint`
  305. * API Blueprint: `drafter`
  306. * AsciiDoc: `alex`!!, `proselint`, `redpen`, `write-good`
  307. * Awk: `gawk`
  308. * Bash: `shell` (-n flag), `shellcheck`, `shfmt`
  309. * Bourne Shell: `shell` (-n flag), `shellcheck`, `shfmt`
  310. * C: `cppcheck`, `cpplint`!!, `clang`, `clangtidy`!!, `clang-format`, `flawfinder`, `gcc`
  311. * C++ (filetype cpp): `clang`, `clangcheck`!!, `clangtidy`!!, `clang-format`, `cppcheck`, `cpplint`!!, `cquery`, `flawfinder`, `gcc`
  312. * CUDA: `nvcc`!!
  313. * C#: `mcs`, `mcsc`!!
  314. * Chef: `foodcritic`
  315. * Clojure: `joker`
  316. * CMake: `cmakelint`
  317. * CoffeeScript: `coffee`, `coffeelint`
  318. * Crystal: `crystal`!!
  319. * CSS: `csslint`, `prettier`, `stylelint`
  320. * Cucumber: `cucumber`
  321. * Cython (pyrex filetype): `cython`
  322. * D: `dmd`
  323. * Dafny: `dafny`!!
  324. * Dart: `dartanalyzer`!!, `language_server`
  325. * Dockerfile: `hadolint`
  326. * Elixir: `credo`, `dialyxir`, `dogma`!!
  327. * Elm: `elm-format, elm-make`
  328. * Erb: `erb`, `erubi`, `erubis`
  329. * Erlang: `erlc`, `SyntaxErl`
  330. * Fish: `fish` (-n flag)
  331. * Fortran: `gcc`
  332. * Fountain: `proselint`
  333. * FusionScript: `fusion-lint`
  334. * Git Commit Messages: `gitlint`
  335. * GLSL: glslang, `glslls`
  336. * Go: `gofmt`, `goimports`, `go vet`!!, `golint`, `gotype`!!, `gometalinter`!!, `go build`!!, `gosimple`!!, `staticcheck`!!
  337. * GraphQL: `eslint`, `gqlint`, `prettier`
  338. * Haml: `haml-lint`
  339. * Handlebars: `ember-template-lint`
  340. * Haskell: `brittany`, `ghc`, `stack-ghc`, `stack-build`!!, `ghc-mod`, `stack-ghc-mod`, `hlint`, `hdevtools`, `hfmt`
  341. * HTML: `alex`!!, `HTMLHint`, `proselint`, `tidy`, `write-good`
  342. * Idris: `idris`
  343. * Java: `checkstyle`, `javac`, `google-java-format`, `PMD`
  344. * JavaScript: `eslint`, `flow`, `jscs`, `jshint`, `prettier`, `prettier-eslint`, `prettier-standard`, `standard`, `xo`
  345. * JSON: `fixjson`, `jsonlint`, `jq`, `prettier`
  346. * Kotlin: `kotlinc`, `ktlint`
  347. * LaTeX (tex): `alex`!!, `chktex`, `lacheck`, `proselint`, `redpen`, `vale`, `write-good`
  348. * Less: `lessc`, `prettier`, `stylelint`
  349. * LLVM: `llc`
  350. * Lua: `luac`, `luacheck`
  351. * Mail: `alex`!!, `proselint`, `vale`
  352. * Make: `checkmake`
  353. * Markdown: `alex`!!, `markdownlint`!!, `mdl`, `prettier`, `proselint`, `redpen`, `remark-lint`, `textlint`, `vale`, `write-good`
  354. * MATLAB: `mlint`
  355. * Mercury: `mmc`!!
  356. * NASM: `nasm`!!
  357. * Nim: `nim check`!!
  358. * nix: `nix-instantiate`
  359. * nroff: `alex`!!, `proselint`, `write-good`
  360. * Objective-C: `clang`
  361. * Objective-C++: `clang`
  362. * OCaml: `merlin` (see |ale-ocaml-merlin|), `ols`
  363. * Perl: `perl -c`, `perl-critic`, `perltidy`
  364. * PHP: `hack`, `hackfmt`, `langserver`, `phan`, `php -l`, `phpcs`, `phpmd`, `phpstan`, `phpcbf`, `php-cs-fixer`
  365. * PO: `alex`!!, `msgfmt`, `proselint`, `write-good`
  366. * Pod: `alex`!!, `proselint`, `write-good`
  367. * Pony: `ponyc`
  368. * proto: `protoc-gen-lint`
  369. * Pug: `pug-lint`
  370. * Puppet: `puppet`, `puppet-lint`
  371. * Python: `autopep8`, `black`, `flake8`, `isort`, `mypy`, `prospector`, `pycodestyle`, `pyls`, `pylint`!!, `yapf`
  372. * QML: `qmlfmt`, `qmllint`
  373. * R: `lintr`
  374. * ReasonML: `merlin`, `ols`, `refmt`
  375. * reStructuredText: `alex`!!, `proselint`, `redpen`, `rstcheck`, `vale`, `write-good`
  376. * Re:VIEW: `redpen`
  377. * RPM spec: `rpmlint`
  378. * Ruby: `brakeman`, `rails_best_practices`!!, `reek`, `rubocop`, `ruby`, `rufo`
  379. * Rust: `cargo`!!, `rls`, `rustc` (see |ale-integration-rust|), `rustfmt`
  380. * SASS: `sass-lint`, `stylelint`
  381. * SCSS: `prettier`, `sass-lint`, `scss-lint`, `stylelint`
  382. * Scala: `fsc`, `scalac`, `scalafmt`, `scalastyle`
  383. * Slim: `slim-lint`
  384. * SML: `smlnj`
  385. * Solidity: `solhint`, `solium`
  386. * Stylus: `stylelint`
  387. * SQL: `sqlint`
  388. * Swift: `swiftlint`, `swiftformat`
  389. * Tcl: `nagelfar`!!
  390. * Terraform: `tflint`
  391. * Texinfo: `alex`!!, `proselint`, `write-good`
  392. * Text^: `alex`!!, `proselint`, `redpen`, `textlint`, `vale`, `write-good`
  393. * Thrift: `thrift`
  394. * TypeScript: `eslint`, `prettier`, `tslint`, `tsserver`, `typecheck`
  395. * Verilog: `iverilog`, `verilator`
  396. * Vim: `vint`
  397. * Vim help^: `alex`!!, `proselint`, `write-good`
  398. * Vue: `prettier`
  399. * XHTML: `alex`!!, `proselint`, `write-good`
  400. * XML: `xmllint`
  401. * YAML: `swaglint`, `yamllint`
  402. ===============================================================================
  403. 3. Linting *ale-lint*
  404. ALE's primary focus is on checking for problems with your code with various
  405. programs via some Vim code for integrating with those programs, referred to
  406. as 'linters.' ALE supports a wide array of programs for linting by default,
  407. but additional programs can be added easily by defining files in |runtimepath|
  408. with the filename pattern `ale_linters/<filetype>/<filename>.vim`. For more
  409. information on defining new linters, see the extensive documentation
  410. for |ale#linter#Define()|.
  411. Without any configuration, ALE will attempt to check all of the code for every
  412. file you open in Vim with all available tools by default. To see what ALE
  413. is doing, and what options have been set, try using the |:ALEInfo| command.
  414. Most of the linters ALE runs will check the Vim buffer you are editing instead
  415. of the file on disk. This allows you to check your code for errors before you
  416. have even saved your changes. ALE will check your code in the following
  417. circumstances, which can be configured with the associated options.
  418. * When you modify a buffer. - |g:ale_lint_on_text_changed|
  419. * When you open a new or modified buffer. - |g:ale_lint_on_enter|
  420. * When you save a buffer. - |g:ale_lint_on_save|
  421. * When the filetype changes for a buffer. - |g:ale_lint_on_filetype_changed|
  422. * If ALE is used to check code manually. - |:ALELint|
  423. In addition to the above options, ALE can also check buffers for errors when
  424. you leave insert mode with |g:ale_lint_on_insert_leave|, which is off by
  425. default. It is worth reading the documentation for every option.
  426. *ale-lint-file-linters*
  427. Some programs must be run against files which have been saved to disk, and
  428. simply do not support reading temporary files or stdin, either of which are
  429. required for ALE to be able to check for errors as you type. The programs
  430. which behave this way are documented in the lists and tables of supported
  431. programs. ALE will only lint files with these programs in the following
  432. circumstances.
  433. * When you open a new or modified buffer. - |g:ale_lint_on_enter|
  434. * When you save a buffer. - |g:ale_lint_on_save|
  435. * When the filetype changes for a buffer. - |g:ale_lint_on_filetype_changed|
  436. * If ALE is used to check code manually. - |:ALELint|
  437. ALE will report problems with your code in the following ways, listed with
  438. their relevant options.
  439. * By updating loclist. (On by default) - |g:ale_set_loclist|
  440. * By updating quickfix. (Off by default) - |g:ale_set_quickfix|
  441. * By setting error highlights. - |g:ale_set_highlights|
  442. * By creating signs in the sign column. - |g:ale_set_signs|
  443. * By echoing messages based on your cursor. - |g:ale_echo_cursor|
  444. * By showing balloons for your mouse cursor - |g:ale_set_balloons|
  445. Please consult the documentation for each option, which can reveal some other
  446. ways of tweaking the behaviour of each way of displaying problems. You can
  447. disable or enable whichever options you prefer.
  448. Most settings can be configured for each buffer. (|b:| instead of |g:|),
  449. including disabling ALE for certain buffers with |b:ale_enabled|. The
  450. |g:ale_pattern_options| setting can be used to configure files differently
  451. based on regular expressions for filenames. For configuring entire projects,
  452. the buffer-local options can be used with external plugins for reading Vim
  453. project configuration files. Buffer-local settings can also be used in
  454. ftplugin files for different filetypes.
  455. ALE offers several options for controlling which linters are run.
  456. * Selecting linters to run. - |g:ale_linters|
  457. * Aliasing filetypes for linters - |g:ale_linter_aliases|
  458. * Only running linters you asked for. - |g:ale_linters_explicit|
  459. ===============================================================================
  460. 4. Fixing Problems *ale-fix*
  461. ALE can fix problems with files with the |ALEFix| command. |ALEFix|
  462. accepts names of fixers to be applied as arguments. Alternatively,
  463. when no arguments are provided, the variable |g:ale_fixers| will be
  464. read for getting a |List| of commands for filetypes, split on `.`, and
  465. the functions named in |g:ale_fixers| will be executed for fixing the
  466. errors.
  467. The |ALEFixSuggest| command can be used to suggest tools that be used to
  468. fix problems for the current buffer.
  469. The values for `g:ale_fixers` can be a list of |String|, |Funcref|, or
  470. |lambda| values. String values must either name a function, or a short name
  471. for a function set in the ALE fixer registry.
  472. Each function for fixing errors must accept either one argument `(buffer)` or
  473. two arguments `(buffer, lines)`, representing the buffer being fixed and the
  474. lines to fix. The functions must return either `0`, for changing nothing, a
  475. |List| for new lines to set, or a |Dictionary| for describing a command to be
  476. run in the background.
  477. Functions receiving a variable number of arguments will not receive the second
  478. argument `lines`. Functions should name two arguments if the `lines` argument
  479. is desired. This is required to avoid unnecessary copying of the lines of
  480. the buffers being checked.
  481. When a |Dictionary| is returned for an |ALEFix| callback, the following keys
  482. are supported for running the commands.
  483. `command` A |String| for the command to run. This key is required.
  484. When `%t` is included in a command string, a temporary
  485. file will be created, containing the lines from the file
  486. after previous adjustment have been done.
  487. `read_temporary_file` When set to `1`, ALE will read the contents of the
  488. temporary file created for `%t`. This option can be used
  489. for commands which need to modify some file on disk in
  490. order to fix files.
  491. `process_with` An optional callback for post-processing.
  492. The callback must accept two arguments,
  493. `(buffer, output)`, which can be used for converting
  494. the output from a command into lines to replace the
  495. buffer's contents with.
  496. A |List| of |String|s must be returned.
  497. `chain_with` An optional key for defining a callback to call next.
  498. The callback must accept two or three arguments,
  499. `(buffer, output)` or `(buffer, output, input)` .
  500. Functions receiving a variable number of arguments will
  501. only receive the first two values. The `output` argument
  502. will contain the lines of output from the command run.
  503. The `input` argument is the List of lines for the
  504. buffer, after applying any previous fixers.
  505. The callback must return the same values returned for
  506. any fixer function. This allows fixer functions to be
  507. chained recursively.
  508. When the command string returned for a fixer is an empty
  509. string, the next command in the chain will still be run.
  510. This allows commands to be skipped, like version checks
  511. that are cached. An empty List will be passed to the
  512. next callback in the chain for the `output`.
  513. `read_buffer` An optional key for disabling reading the buffer.
  514. When set to `0`, ALE will not pipe the buffer's data
  515. into the command via stdin. This option is ignored and
  516. the buffer is not read when `read_temporary_file` is
  517. `1`.
  518. This option defaults to `0` when `chain_with` is defined
  519. as anything other than `v:null`, and defaults to `1`
  520. otherwise. This is so earlier commands in a chain
  521. do not receive the buffer's data by default.
  522. *ale-fix-configuration*
  523. Synchronous functions and asynchronous jobs will be run in a sequence for
  524. fixing files, and can be combined. For example:
  525. >
  526. let g:ale_fixers = {
  527. \ 'javascript': [
  528. \ 'DoSomething',
  529. \ 'eslint',
  530. \ {buffer, lines -> filter(lines, 'v:val !=~ ''^\s*//''')},
  531. \ ],
  532. \}
  533. ALEFix
  534. <
  535. The above example will call a function called `DoSomething` which could act
  536. upon some lines immediately, then run `eslint` from the ALE registry, and
  537. then call a lambda function which will remove every single line comment
  538. from the file.
  539. For buffer-local settings, such as in |g:ale_pattern_options| or in ftplugin
  540. files, a |List| may be used for configuring the fixers instead.
  541. >
  542. " Same as the above, only a List can be used instead of a Dictionary.
  543. let b:ale_fixers = [
  544. \ 'DoSomething',
  545. \ 'eslint',
  546. \ {buffer, lines -> filter(lines, 'v:val !=~ ''^\s*//''')},
  547. \]
  548. ALEFix
  549. <
  550. For convenience, a plug mapping is defined for |ALEFix|, so you can set up a
  551. keybind easily for fixing files. >
  552. " Bind F8 to fixing problems with ALE
  553. nmap <F8> <Plug>(ale_fix)
  554. <
  555. Files can be fixed automatically with the following options, which are all off
  556. by default.
  557. |g:ale_fix_on_save| - Fix files when they are saved.
  558. ===============================================================================
  559. 5. Language Server Protocol Support *ale-lsp*
  560. ALE offers some support for integrating with Language Server Protocol (LSP)
  561. servers. LSP linters can be used in combination with any other linter, and
  562. will automatically connect to LSP servers when needed. ALE also supports
  563. `tsserver` for TypeScript, which uses a different but very similar protocol.
  564. ALE supports the following LSP/tsserver features.
  565. 1. Diagnostics/linting - Enabled via selecting linters as usual.
  566. 2. Completion (Only for tsserver)
  567. 3. Go to definition
  568. -------------------------------------------------------------------------------
  569. 5.1 Completion *ale-completion*
  570. NOTE: At the moment, only `tsserver` for TypeScript code is supported for
  571. completion.
  572. ALE offers limited support for automatic completion of code while you type.
  573. Completion is only supported while a least one LSP linter is enabled. ALE
  574. will only suggest symbols provided by the LSP servers.
  575. Suggestions will be made while you type after completion is enabled.
  576. Completion can be enabled by setting |g:ale_completion_enabled| to `1`. The
  577. delay for completion can be configured with |g:ale_completion_delay|. ALE will
  578. only suggest so many possible matches for completion. The maximum number of
  579. items can be controlled with |g:ale_completion_max_suggestions|.
  580. If you don't like some of the suggestions you see, you can filter them out
  581. with |g:ale_completion_excluded_words| or |b:ale_completion_excluded_words|.
  582. -------------------------------------------------------------------------------
  583. 5.2 Go To Definition *ale-go-to-definition*
  584. ALE supports jumping to the files and locations where symbols are defined
  585. through any enabled LSP linters. The locations ALE will jump to depend on the
  586. information returned by LSP servers. The following commands are supported:
  587. |ALEGoToDefinition| - Open the definition of the symbol under the cursor.
  588. |ALEGoToDefinitionInTab| - The same, but for opening the file in a new tab.
  589. -------------------------------------------------------------------------------
  590. 5.3 Find References *ale-find-references*
  591. ALE supports finding references for symbols though any enabled LSP linters.
  592. ALE will display a preview window showing the places where a symbol is
  593. referenced in a codebase when a command is run. The following commands are
  594. supported:
  595. |ALEFindReferences| - Find references for the word under the cursor.
  596. -------------------------------------------------------------------------------
  597. 5.4 Hovering *ale-hover*
  598. ALE supports "hover" information for printing brief information about symbols
  599. at the cursor taken from LSP linters. The following commands are supported:
  600. |ALEHover| - Print information about the symbol at the cursor.
  601. If |b:ale_set_balloons| is set to `1` and your version of Vim supports the
  602. |balloon_show()| function, then "hover" information also show up when you move
  603. the mouse over a symbol in a buffer. Diagnostic information will take priority
  604. over hover information for balloons. If a line contains a problem, that
  605. problem will be displayed in a balloon instead of hover information.
  606. ===============================================================================
  607. 6. Global Options *ale-options*
  608. g:airline#extensions#ale#enabled *g:airline#extensions#ale#enabled*
  609. Type: |Number|
  610. Default: `1`
  611. Enables or disables the |airline|'s native extension for ale, which displays
  612. warnings and errors in the status line, prefixed by
  613. |airline#extensions#ale#error_symbol| and
  614. |airline#extensions#ale#warning_symbol|.
  615. g:ale_cache_executable_check_failures *g:ale_cache_executable_check_failures*
  616. Type: |Number|
  617. Default: undefined
  618. When set to `1`, ALE will cache failing executable checks for linters. By
  619. default, only executable checks which succeed will be cached.
  620. When this option is set to `1`, Vim will have to be restarted after new
  621. executables are installed for ALE to be able to run linters for those
  622. executables.
  623. g:ale_change_sign_column_color *g:ale_change_sign_column_color*
  624. Type: |Number|
  625. Default: `0`
  626. When set to `1`, this option will set different highlights for the sign
  627. column itself when ALE reports problems with a file. This option can be
  628. combined with |g:ale_sign_column_always|.
  629. ALE uses the following highlight groups for highlighting the sign column:
  630. `ALESignColumnWithErrors` - Links to `error` by default.
  631. `ALESignColumnWithoutErrors` - Uses the value for `SignColumn` by default.
  632. The sign column color can only be changed globally in Vim. The sign column
  633. might produce unexpected results if editing different files in split
  634. windows.
  635. g:ale_command_wrapper *g:ale_command_wrapper*
  636. *b:ale_command_wrapper*
  637. Type: |String|
  638. Default: `''`
  639. An option for wrapping all commands that ALE runs, for linters, fixers,
  640. and LSP commands. This option can be set globally, or for specific buffers.
  641. This option can be used to apply nice to all commands. For example: >
  642. " Prefix all commands with nice.
  643. let g:ale_command_wrapper = 'nice -n5'
  644. <
  645. Use the |ALEInfo| command to view the commands that are run. All of the
  646. arguments for commands will be put on the end of the wrapped command by
  647. default. A `%*` marker can be used to spread the arguments in the wrapped
  648. command. >
  649. " Has the same effect as the above.
  650. let g:ale_command_wrapper = 'nice -n5 %*'
  651. <
  652. For passing all of the arguments for a command as one argument to a wrapper,
  653. `%@` can be used instead. >
  654. " Will result in say: /bin/bash -c 'other-wrapper -c "some command" -x'
  655. let g:ale_command_wrapper = 'other-wrapper -c %@ -x'
  656. <
  657. For commands including `&&` or `;`, only the last command in the list will
  658. be passed to the wrapper. `&&` is most commonly used in ALE to change the
  659. working directory before running a command.
  660. g:ale_completion_delay *g:ale_completion_delay*
  661. Type: |Number|
  662. Default: `100`
  663. The number of milliseconds before ALE will send a request to a language
  664. server for completions after you have finished typing.
  665. See |ale-completion|
  666. g:ale_completion_enabled *g:ale_completion_enabled*
  667. Type: |Number|
  668. Default: `0`
  669. When this option is set to `1`, completion support will be enabled.
  670. See |ale-completion|
  671. g:ale_completion_excluded_words *g:ale_completion_excluded_words*
  672. *b:ale_completion_excluded_words*
  673. Type: |List|
  674. Default: `[]`
  675. This option can be set to a list of |String| values for "words" to exclude
  676. from completion results, as in the words for |complete-items|. The strings
  677. will be matched exactly in a case-sensitive manner. (|==#|)
  678. This setting can be configured in ftplugin files with buffer variables, so
  679. that different lists can be used for different filetypes. For example: >
  680. " In ~/.vim/ftplugin/typescript.vim
  681. " Don't suggest `it` or `describe` so we can use snippets for those words.
  682. let b:ale_completion_excluded_words = ['it', 'describe']
  683. <
  684. g:ale_completion_max_suggestions *g:ale_completion_max_suggestions*
  685. Type: |Number|
  686. Default: `50`
  687. The maximum number of items ALE will suggest in completion menus for
  688. automatic completion.
  689. Setting this number higher will require more processing time, and may
  690. suggest too much noise. Setting this number lower will require less
  691. processing time, but some suggestions will not be included, so you might not
  692. be able to see the suggestions you want.
  693. Adjust this option as needed, depending on the complexity of your codebase
  694. and your available processing power.
  695. g:ale_echo_cursor *g:ale_echo_cursor*
  696. Type: |Number|
  697. Default: `1`
  698. When this option is set to `1`, a truncated message will be echoed when a
  699. cursor is near a warning or error. ALE will attempt to find the warning or
  700. error at a column nearest to the cursor when the cursor is resting on a line
  701. which contains a warning or error. This option can be set to `0` to disable
  702. this behaviour.
  703. The format of the message can be customizable in |g:ale_echo_msg_format|.
  704. g:ale_echo_delay *g:ale_echo_delay*
  705. *b:ale_echo_delay*
  706. Type: |Number|
  707. Default: `10`
  708. Given any integer, this option controls the number of milliseconds before
  709. ALE will echo a message for a problem near the cursor.
  710. The value can be increased to decrease the amount of processing ALE will do
  711. for files displaying a large number of problems.
  712. g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
  713. Type: |String|
  714. Default: `'Error'`
  715. The string used for `%severity%` for errors. See |g:ale_echo_msg_format|
  716. g:ale_echo_msg_format *g:ale_echo_msg_format*
  717. b:ale_echo_msg_format *b:ale_echo_msg_format*
  718. Type: |String|
  719. Default: `'%code: %%s'`
  720. This variable defines a message format for echoed messages. The following
  721. sequences of characters will be replaced.
  722. `%s` - replaced with the text for the problem
  723. `%...code...% `- replaced with the error code
  724. `%linter%` - replaced with the name of the linter
  725. `%severity%` - replaced withe severity of the problem
  726. The strings for `%severity%` can be configured with the following options.
  727. |g:ale_echo_msg_error_str| - Defaults to `'Error'`
  728. |g:ale_echo_msg_info_str| - Defaults to `'Info'`
  729. |g:ale_echo_msg_warning_str| - Defaults to `'Warning'`
  730. `%code%` is replaced with the error code, and replaced with an empty string
  731. when there is no error code. Any extra characters between the percent signs
  732. will be printed when an error code is present. For example, a message like
  733. `(error code): message` will be printed for `'%(code): %%s'` and simply the
  734. message will be printed when there is no code.
  735. |g:ale_echo_cursor| needs to be set to 1 for messages to be displayed.
  736. The echo message format can also be configured separately for each buffer,
  737. so different formats can be used for differnt languages. (Say in ftplugin
  738. files.)
  739. g:ale_echo_msg_info_str *g:ale_echo_msg_info_str*
  740. Type: |String|
  741. Default: `'Info'`
  742. The string used for `%severity%` for info. See |g:ale_echo_msg_format|
  743. g:ale_echo_msg_warning_str *g:ale_echo_msg_warning_str*
  744. Type: |String|
  745. Default: `'Warning'`
  746. The string used for `%severity%` for warnings. See |g:ale_echo_msg_format|
  747. g:ale_enabled *g:ale_enabled*
  748. *b:ale_enabled*
  749. Type: |Number|
  750. Default: `1`
  751. When set to `0`, this option will completely disable ALE, such that no
  752. error checking will be performed, etc. ALE can be toggled on and off with
  753. the |ALEToggle| command, which changes this option.
  754. ALE can be disabled in each buffer by setting `let b:ale_enabled = 0`
  755. Disabling ALE based on filename patterns can be accomplished by setting
  756. a regular expression for |g:ale_pattern_options|. For example: >
  757. " Disable linting for all minified JS files.
  758. let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}}
  759. <
  760. See |g:ale_pattern_options| for more information on that option.
  761. g:ale_fixers *g:ale_fixers*
  762. *b:ale_fixers*
  763. Type: |Dictionary|
  764. Default: `{}`
  765. A mapping from filetypes to |List| values for functions for fixing errors.
  766. See |ale-fix| for more information.
  767. This variable can be overridden with variables in each buffer.
  768. `b:ale_fixers` can be set to a |List| of callbacks instead, which can be
  769. more convenient.
  770. g:ale_fix_on_save *g:ale_fix_on_save*
  771. b:ale_fix_on_save *b:ale_fix_on_save*
  772. Type: |Number|
  773. Default: `0`
  774. When set to 1, ALE will fix files when they are saved.
  775. If |g:ale_lint_on_save| is set to 1, files will be checked with linters
  776. after files are fixed, only when the buffer is open, or re-opened. Changes
  777. to the file will be saved to the file on disk.
  778. Fixing files can be disabled or enabled for individual buffers by setting
  779. `b:ale_fix_on_save` to `0` or `1`.
  780. g:ale_history_enabled *g:ale_history_enabled*
  781. Type: |Number|
  782. Default: `1`
  783. When set to `1`, ALE will remember the last few commands which were run
  784. for every buffer which is open. This information can be viewed with the
  785. |ALEInfo| command. The size of the buffer can be controlled with the
  786. |g:ale_max_buffer_history_size| option.
  787. This option can be disabled if storing a command history is not desired.
  788. g:ale_history_log_output *g:ale_history_log_output*
  789. Type: |Number|
  790. Default: `1`
  791. When set to `1`, ALE will store the output of commands which have completed
  792. successfully in the command history, and the output will be displayed when
  793. using |ALEInfo|.
  794. |g:ale_history_enabled| must be set to `1` for this output to be stored or
  795. printed.
  796. Some memory will be consumed by this option. It is very useful for figuring
  797. out what went wrong with linters, and for bug reports. Turn this option off
  798. if you want to save on some memory usage.
  799. g:ale_keep_list_window_open *g:ale_keep_list_window_open*
  800. *b:ale_keep_list_window_open*
  801. Type: |Number|
  802. Default: `0`
  803. When set to `1`, this option will keep the loclist or quickfix windows event
  804. after all warnings/errors have been removed for files. By default the
  805. loclist or quickfix windows will be closed automatically when there are no
  806. warnings or errors.
  807. See |g:ale_open_list|
  808. g:ale_list_window_size *g:ale_list_window_size*
  809. *b:ale_list_window_size*
  810. Type: |Number|
  811. Default: `10`
  812. This number configures the number of lines to set for the height of windows
  813. opened automatically for ALE problems. The default of `10` matches the Vim
  814. default height.
  815. See |g:ale_open_list| for information on automatically opening windows
  816. for quickfix or the loclist.
  817. g:ale_lint_delay *g:ale_lint_delay*
  818. Type: |Number|
  819. Default: `200`
  820. This variable controls the milliseconds delay after which the linters will
  821. be run after text is changed. This option is only meaningful with the
  822. |g:ale_lint_on_text_changed| variable set to `always`, `insert`, or `normal`.
  823. g:ale_lint_on_enter *g:ale_lint_on_enter*
  824. Type: |Number|
  825. Default: `1`
  826. When this option is set to `1`, the |BufWinEnter| and |BufRead| events will
  827. be used to apply linters when buffers are first opened. If this is not
  828. desired, this variable can be set to `0` in your vimrc file to disable this
  829. behaviour.
  830. The |FileChangedShellPost| and |BufEnter| events will be used to check if
  831. files have been changed outside of Vim. If a file is changed outside of
  832. Vim, it will be checked when it is next opened.
  833. A |BufWinLeave| event will be used to look for the |E924|, |E925|, or |E926|
  834. errors after moving from a loclist or quickfix window to a new buffer. If
  835. prompts for these errors are opened after moving to new buffers, then ALE
  836. will automatically send the `<CR>` key needed to close the prompt.
  837. g:ale_lint_on_filetype_changed *g:ale_lint_on_filetype_changed*
  838. Type: |Number|
  839. Default: `1`
  840. This option will cause ALE to run whenever the filetype is changed. A short
  841. delay will be used before linting will be done, so the filetype can be
  842. changed quickly several times in a row, but resulting in only one lint
  843. cycle.
  844. If |g:ale_lint_on_enter| is set to `0`, then ALE will not lint a file when
  845. the filetype is initially set. Otherwise ALE would still lint files when
  846. buffers are opened, and the option for doing so is turned off.
  847. g:ale_lint_on_save *g:ale_lint_on_save*
  848. Type: |Number|
  849. Default: `1`
  850. This option will make ALE run the linters whenever a file is saved when it
  851. it set to `1` in your vimrc file. This option can be used in combination
  852. with the |g:ale_lint_on_enter| and |g:ale_lint_on_text_changed| options to
  853. make ALE only check files after that have been saved, if that is what is
  854. desired.
  855. g:ale_lint_on_text_changed *g:ale_lint_on_text_changed*
  856. Type: |String|
  857. Default: `always`
  858. By default, ALE will check files with the various supported programs when
  859. text is changed by using the |TextChanged| event. If this behaviour is not
  860. desired, then this option can be disabled by setting it to `never`. The
  861. |g:ale_lint_delay| variable will be used to set a |timer_start()| on a
  862. delay, and each change to a file will continue to call |timer_stop()| and
  863. |timer_start()| repeatedly until the timer ticks by, and the linters will be
  864. run. The checking of files will run in the background, so it should not
  865. inhibit editing files. This option can also be set to `insert` or `normal`
  866. to lint when text is changed only in insert or normal mode respectively.
  867. g:ale_lint_on_insert_leave *g:ale_lint_on_insert_leave*
  868. Type: |Number|
  869. Default: `0`
  870. When set to `1` in your vimrc file, this option will cause ALE to run
  871. linters when you leave insert mode.
  872. ALE will not lint files when you escape insert mode with |CTRL-C| by
  873. default. You can make ALE lint files with this option when you use |CTRL-C|
  874. with the following keybind. >
  875. " Make using Ctrl+C do the same as Escape, to trigger autocmd commands
  876. inoremap <C-c> <Esc>
  877. <
  878. g:ale_linter_aliases *g:ale_linter_aliases*
  879. *b:ale_linter_aliases*
  880. Type: |Dictionary|
  881. Default: `{}`
  882. The |g:ale_linter_aliases| option can be used to set aliases from one
  883. filetype to another. A given filetype can be mapped to use the linters
  884. run for another given filetype.
  885. This |Dictionary| will be merged with a default dictionary containing the
  886. following values: >
  887. {
  888. \ 'Dockerfile': 'dockerfile',
  889. \ 'csh': 'sh',
  890. \ 'plaintex': 'tex',
  891. \ 'systemverilog': 'verilog',
  892. \ 'vimwiki': 'markdown',
  893. \ 'zsh': 'sh',
  894. \}
  895. <
  896. For example, if you wish to map a new filetype `'foobar'` to run the `'php'`
  897. linters, you could set the following: >
  898. let g:ale_linter_aliases = {'foobar': 'php'}
  899. <
  900. When combined with the |g:ale_linters| option, the original filetype
  901. (`'foobar'`) will be used for determining which linters to run,
  902. not the aliased type (`'php'`). This allows an aliased type to run a
  903. different set of linters from the type it is being mapped to.
  904. Passing a list of filetypes is also supported. Say you want to lint
  905. javascript and css embedded in HTML (using linters that support that).
  906. You could alias `html` like so:
  907. `let g:ale_linter_aliases = {'html': ['html', 'javascript', 'css']}`
  908. Note that `html` itself was included as an alias. That is because aliases
  909. will override the original linters for the aliased filetype.
  910. Linter aliases can be configured in each buffer with buffer-local variables.
  911. ALE will first look for aliases for filetypes in the `b:ale_linter_aliases`
  912. variable, then `g:ale_linter_aliases`, and then a default Dictionary.
  913. `b:ale_linter_aliases` can be set to a |List|, to tell ALE to load the
  914. linters for specific filetypes for a given buffer. >
  915. let b:ale_linter_aliases = ['html', 'javascript', 'css']
  916. <
  917. No linters will be loaded when the buffer's filetype is empty.
  918. g:ale_linters *g:ale_linters*
  919. *b:ale_linters*
  920. Type: |Dictionary|
  921. Default: `{}`
  922. The |g:ale_linters| option sets a |Dictionary| mapping a filetype to a
  923. |List| of linter programs to be run when checking particular filetypes.
  924. This |Dictionary| will be merged with a default dictionary containing the
  925. following values: >
  926. {
  927. \ 'csh': ['shell'],
  928. \ 'go': ['gofmt', 'golint', 'go vet'],
  929. \ 'help': [],
  930. \ 'perl': ['perlcritic'],
  931. \ 'python': ['flake8', 'mypy', 'pylint'],
  932. \ 'rust': ['cargo'],
  933. \ 'spec': [],
  934. \ 'text': [],
  935. \ 'zsh': ['shell'],
  936. \}
  937. <
  938. This option can be used to enable only a particular set of linters for a
  939. file. For example, you can enable only `eslint` for JavaScript files: >
  940. let g:ale_linters = {'javascript': ['eslint']}
  941. <
  942. If you want to disable all linters for a particular filetype, you can pass
  943. an empty list of linters as the value: >
  944. let g:ale_linters = {'javascript': []}
  945. <
  946. All linters will be run for unspecified filetypes. All available linters can
  947. be enabled explicitly for a given filetype by passing the string `'all'`,
  948. instead of a List. >
  949. let g:ale_linters = {'c': 'all'}
  950. <
  951. Linters can be configured in each buffer with buffer-local variables. ALE
  952. will first look for linters for filetypes in the `b:ale_linters` variable,
  953. then `g:ale_linters`, and then the default Dictionary mentioned above.
  954. `b:ale_linters` can be set to a List, or the string `'all'`. When linters
  955. for two different filetypes share the same name, the first linter loaded
  956. will be used. Any ambiguity can be resolved by using a Dictionary specifying
  957. which linter to run for which filetype instead. >
  958. " Use ESLint for the buffer if the filetype includes 'javascript'.
  959. let b:ale_linters = {'javascript': ['eslint'], 'html': ['tidy']}
  960. " Use a List for the same setting. This will work in most cases.
  961. let b:ale_linters = ['eslint', 'tidy']
  962. " Disable all linters for the buffer.
  963. let b:ale_linters = []
  964. " Explicitly enable all available linters for the filetype.
  965. let b:ale_linters = 'all'
  966. <
  967. ALE can be configured to disable all linters unless otherwise specified with
  968. `g:ale_enabled` or `b:ale_enabled` with the option |g:ale_linters_explicit|.
  969. g:ale_linters_explicit *g:ale_linters_explicit*
  970. Type: |Number|
  971. Default: `0`
  972. When set to `1`, only the linters from |g:ale_linters| and |b:ale_linters|
  973. will be enabled. The default behavior for ALE is to enable as many linters
  974. as possible, unless otherwise specified.
  975. g:ale_list_vertical *g:ale_list_vertical*
  976. *b:ale_list_vertical*
  977. Type: |Number|
  978. Default: `0`
  979. When set to `1`, this will cause ALE to open any windows (loclist or
  980. quickfix) vertically instead of horizontally (|vert| |lopen|) or (|vert|
  981. |copen|)
  982. g:ale_loclist_msg_format *g:ale_loclist_msg_format*
  983. b:ale_loclist_msg_format *b:ale_loclist_msg_format*
  984. Type: |String|
  985. Default: `g:ale_echo_msg_format`
  986. This option is the same as |g:ale_echo_msg_format|, but for formatting the
  987. message used for the loclist and the quickfix list.
  988. The strings for configuring `%severity%` are also used for this option.
  989. g:ale_max_buffer_history_size *g:ale_max_buffer_history_size*
  990. Type: |Number|
  991. Default: `20`
  992. This setting controls the maximum number of commands which will be stored in
  993. the command history used for |ALEInfo|. Command history will be rotated in
  994. a FIFO manner. If set to a number <= 0, then the history will be
  995. continuously set to an empty |List|.
  996. History can be disabled completely with |g:ale_history_enabled|.
  997. g:ale_max_signs *g:ale_max_signs*
  998. *b:ale_max_signs*
  999. Type: |Number|
  1000. Default: `-1`
  1001. When set to any positive integer, ALE will not render any more than the
  1002. given number of signs for any one buffer.
  1003. When set to `0`, no signs will be set, but sign processing will still be
  1004. done, so existing signs can be removed.
  1005. When set to any other value, no limit will be imposed on the number of signs
  1006. set.
  1007. For disabling sign processing, see |g:ale_set_signs|.
  1008. g:ale_maximum_file_size *g:ale_maximum_file_size*
  1009. *b:ale_maximum_file_size*
  1010. Type: |Number|
  1011. Default: undefined
  1012. A maximum file size in bytes for ALE to check. If set to any positive
  1013. number, ALE will skip checking files larger than the given size.
  1014. g:ale_open_list *g:ale_open_list*
  1015. *b:ale_open_list*
  1016. Type: |Number| or |String|
  1017. Default: `0`
  1018. When set to `1`, this will cause ALE to automatically open a window for the
  1019. loclist (|lopen|) or for the quickfix list instead if |g:ale_set_quickfix|
  1020. is `1`. (|copen|)
  1021. When set to `'on_save'`, ALE will only open the loclist after buffers have
  1022. been saved. The list will be opened some time after buffers are saved and
  1023. any linter for a buffer returns results.
  1024. The window will be kept open until all warnings or errors are cleared,
  1025. including those not set by ALE, unless |g:ale_keep_list_window_open| is set
  1026. to `1`, in which case the window will be kept open when no problems are
  1027. found.
  1028. The window size can be configured with |g:ale_list_window_size|.
  1029. Windows can be opened vertically with |g:ale_list_vertical|.
  1030. If you want to close the loclist window automatically when the buffer is
  1031. closed, you can set up the following |autocmd| command: >
  1032. augroup CloseLoclistWindowGroup
  1033. autocmd!
  1034. autocmd QuitPre * if empty(&buftype) | lclose | endif
  1035. augroup END
  1036. <
  1037. g:ale_pattern_options *g:ale_pattern_options*
  1038. Type: |Dictionary|
  1039. Default: `{}`
  1040. This option maps regular expression patterns to |Dictionary| values for
  1041. buffer variables. This option can be set to automatically configure
  1042. different settings for different files. For example: >
  1043. " Use just ESLint for linting and fixing files which end in '.foo.js'
  1044. let g:ale_pattern_options = {
  1045. \ '\.foo\.js$': {
  1046. \ 'ale_linters': ['eslint'],
  1047. \ 'ale_fixers': ['eslint'],
  1048. \ },
  1049. \}
  1050. <
  1051. See |b:ale_linters| and |b:ale_fixers| for information for those options.
  1052. Filenames are matched with |match()|, and patterns depend on the |magic|
  1053. setting, unless prefixed with the special escape sequences like `'\v'`, etc.
  1054. The patterns can match any part of a filename. The absolute path of the
  1055. filename will be used for matching, taken from `expand('%:p')`.
  1056. The options for every match for the filename will be applied, with the
  1057. pattern keys sorted in alphabetical order. Options for `'zebra'` will
  1058. override the options for `'alpha'` for a filename `alpha-zebra`.
  1059. g:ale_pattern_options_enabled *g:ale_pattern_options_enabled*
  1060. Type: |Number|
  1061. Default: `!empty(g:ale_pattern_options)`
  1062. This option can be used for turning the behaviour of setting
  1063. |g:ale_pattern_options| on or off. By default, setting a single key for
  1064. |g:ale_pattern_options| will turn this option on, as long as the setting is
  1065. configured before ALE is loaded.
  1066. g:ale_set_balloons *g:ale_set_balloons*
  1067. *b:ale_set_balloons*
  1068. Type: |Number|
  1069. Default: `(has('balloon_eval') && has('gui_running'))`
  1070. `|| (has('balloon_eval_term') && !has('gui_running'))`
  1071. When this option is set to `1`, balloon messages will be displayed for
  1072. problems or hover information if available.
  1073. Problems nearest to the line the mouse cursor is over will be displayed. If
  1074. there are no problems to show, and one of the linters is an LSP linter
  1075. supporting "Hover" information, per |ale-hover|, then brief information
  1076. about the symbol under the cursor will be displayed in a balloon.
  1077. `b:ale_set_balloons` can be set to `0` to disable balloons for a buffer.
  1078. Balloons cannot be enabled for a specific buffer when not initially enabled
  1079. globally.
  1080. Balloons will not be shown when |g:ale_enabled| or |b:ale_enabled| is `0`.
  1081. g:ale_set_balloons_legacy_echo *g:ale_set_balloons_legacy_echo*
  1082. *b:ale_set_balloons_legacy_echo*
  1083. Type: |Number|
  1084. Default: undefined
  1085. If set to `1`, moving your mouse over documents in Vim will make ALE ask
  1086. `tsserver` or `LSP` servers for information about the symbol where the mouse
  1087. cursor is, and print that information into Vim's echo line. This is an
  1088. option for supporting older versions of Vim which do not properly support
  1089. balloons in an asynchronous manner.
  1090. If your version of Vim supports the |balloon_show| function, then this
  1091. option does nothing meaningful.
  1092. g:ale_set_highlights *g:ale_set_highlights*
  1093. Type: |Number|
  1094. Default: `has('syntax')`
  1095. When this option is set to `1`, highlights will be set for problems.
  1096. ALE will use the following highlight groups for problems:
  1097. |ALEError| - Items with `'type': 'E'`
  1098. |ALEWarning| - Items with `'type': 'W'`
  1099. |ALEInfo.| - Items with `'type': 'I'`
  1100. |ALEStyleError| - Items with `'type': 'E'` and `'sub_type': 'style'`
  1101. |ALEStyleWarning| - Items with `'type': 'W'` and `'sub_type': 'style'`
  1102. When |g:ale_set_signs| is set to `0`, the following highlights for entire
  1103. lines will be set.
  1104. |ALEErrorLine| - All items with `'type': 'E'`
  1105. |ALEWarningLine| - All items with `'type': 'W'`
  1106. |ALEInfoLine| - All items with `'type': 'I'`
  1107. Vim can only highlight the characters up to the last column in a buffer for
  1108. match highlights, whereas the line highlights when signs are enabled will
  1109. run to the edge of the screen.
  1110. g:ale_set_loclist *g:ale_set_loclist*
  1111. Type: |Number|
  1112. Default: `1`
  1113. When this option is set to `1`, the |loclist| will be populated with any
  1114. warnings and errors which are found by ALE. This feature can be used to
  1115. implement jumping between errors through typical use of |lnext| and |lprev|.
  1116. g:ale_set_quickfix *g:ale_set_quickfix*
  1117. Type: |Number|
  1118. Default: `0`
  1119. When this option is set to `1`, the |quickfix| list will be populated with
  1120. any problems which are found by ALE, instead of the |loclist|. The loclist
  1121. will never be populated when this option is on.
  1122. Problems from every buffer ALE has checked will be included in the quickfix
  1123. list, which can be checked with |:copen|. Problems will be de-duplicated.
  1124. This feature should not be used in combination with tools for searching for
  1125. matches and commands like |:cfdo|, as ALE will replace the quickfix list
  1126. pretty frequently. If you wish to use such tools, you should populate the
  1127. loclist instead.
  1128. g:ale_set_signs *g:ale_set_signs*
  1129. Type: |Number|
  1130. Default: `has('signs')`
  1131. When this option is set to `1`, the |sign| column will be populated with
  1132. signs marking where problems appear in the file.
  1133. ALE will use the following highlight groups for problems:
  1134. |ALEErrorSign| - Items with `'type': 'E'`
  1135. |ALEWarningSign| - Items with `'type': 'W'`
  1136. |ALEInfoSign| - Items with `'type': 'I'`
  1137. |ALEStyleErrorSign| - Items with `'type': 'E'` and `'sub_type': 'style'`
  1138. |ALEStyleWarningSign| - Items with `'type': 'W'` and `'sub_type': 'style'`
  1139. In addition to the style of the signs, the style of lines where signs appear
  1140. can be configured with the following highlights:
  1141. |ALEErrorLine| - All items with `'type': 'E'`
  1142. |ALEWarningLine| - All items with `'type': 'W'`
  1143. |ALEInfoLine| - All items with `'type': 'I'`
  1144. The markers for the highlights can be customized with the following options:
  1145. |g:ale_sign_error|
  1146. |g:ale_sign_warning|
  1147. |g:ale_sign_info|
  1148. |g:ale_sign_style_error|
  1149. |g:ale_sign_style_warning|
  1150. When multiple problems exist on the same line, the signs will take
  1151. precedence in the order above, from highest to lowest.
  1152. To limit the number of signs ALE will set, see |g:ale_max_signs|.
  1153. g:ale_sign_column_always *g:ale_sign_column_always*
  1154. Type: |Number|
  1155. Default: `0`
  1156. By default, the sign gutter will disappear when all warnings and errors have
  1157. been fixed for a file. When this option is set to `1`, the sign column will
  1158. remain open. This can be preferable if you don't want the text in your file
  1159. to move around as you edit a file.
  1160. g:ale_sign_error *g:ale_sign_error*
  1161. Type: |String|
  1162. Default: `'>>'`
  1163. The sign for errors in the sign gutter.
  1164. g:ale_sign_info *g:ale_sign_info*
  1165. Type: |String|
  1166. Default: `g:ale_sign_warning`
  1167. The sign for "info" markers in the sign gutter.
  1168. g:ale_sign_style_error *g:ale_sign_style_error*
  1169. Type: |String|
  1170. Default: `g:ale_sign_error`
  1171. The sign for style errors in the sign gutter.
  1172. g:ale_sign_style_warning *g:ale_sign_style_warning*
  1173. Type: |String|
  1174. Default: `g:ale_sign_warning`
  1175. The sign for style warnings in the sign gutter.
  1176. g:ale_sign_offset *g:ale_sign_offset*
  1177. Type: |Number|
  1178. Default: `1000000`
  1179. This variable controls offset from which numeric IDs will be generated for
  1180. new signs. Signs cannot share the same ID values, so when two Vim plugins
  1181. set signs at the same time, the IDs have to be configured such that they do
  1182. not conflict with one another. If the IDs used by ALE are found to conflict
  1183. with some other plugin, this offset value can be changed, and hopefully both
  1184. plugins will work together. See |sign-place| for more information on how
  1185. signs are set.
  1186. g:ale_sign_warning *g:ale_sign_warning*
  1187. Type: |String|
  1188. Default: `'--'`
  1189. The sign for warnings in the sign gutter.
  1190. g:ale_type_map *g:ale_type_map*
  1191. *b:ale_type_map*
  1192. Type: |Dictionary|
  1193. Default: `{}`
  1194. This option can be set re-map problem types for linters. Each key in the
  1195. |Dictionary| should be the name of a linter, and each value must be a
  1196. |Dictionary| mapping problem types from one type to another. The following
  1197. types are supported:
  1198. `'E'` - `{'type': 'E'}`
  1199. `'ES'` - `{'type': 'E', 'sub_type': 'style'}`
  1200. `'W'` - `{'type': 'W'}`
  1201. `'WS'` - `{'type': 'W', 'sub_type': 'style'}`
  1202. `'I'` - `{'type': 'I'}`
  1203. For example, if you want to turn flake8 errors into warnings, you can write
  1204. the following: >
  1205. let g:ale_type_map = {'flake8': {'ES': 'WS', 'E': 'W'}}
  1206. <
  1207. If you wanted to turn style errors and warnings into regular errors and
  1208. warnings, you can write the following: >
  1209. let g:ale_type_map = {'flake8': {'ES': 'E', 'WS': 'W'}}
  1210. <
  1211. Type maps can be set per-buffer with `b:ale_type_map`.
  1212. g:ale_use_global_executables *g:ale_use_global_executables*
  1213. Type: |Number|
  1214. Default: not set
  1215. This option can be set to change the default for all `_use_global` options.
  1216. This option must be set before ALE is loaded, preferably in a vimrc file.
  1217. See |ale-integrations-local-executables| for more information on those
  1218. options.
  1219. g:ale_virtualenv_dir_names *g:ale_virtualenv_dir_names*
  1220. b:ale_virtualenv_dir_names *b:ale_virtualenv_dir_names*
  1221. Type: |List|
  1222. Default: `['.env', 'env', 've-py3', 've', 'virtualenv', 'venv']`
  1223. A list of directory names to be used when searching upwards from Python
  1224. files to discover virtulenv directories with.
  1225. For directory named `'foo'`, ALE will search for `'foo/bin/activate'`
  1226. (`foo\Scripts\activate\` on Windows) in all directories on and above the
  1227. directory containing the Python file to find virtualenv paths.
  1228. g:ale_warn_about_trailing_blank_lines *g:ale_warn_about_trailing_blank_lines*
  1229. b:ale_warn_about_trailing_blank_lines *b:ale_warn_about_trailing_blank_lines*
  1230. Type: |Number|
  1231. Default: `1`
  1232. When this option is set to `1`, warnings about trailing blank lines will be
  1233. shown.
  1234. This option behaves similarly to |g:ale_warn_about_trailing_whitespace|.
  1235. g:ale_warn_about_trailing_whitespace *g:ale_warn_about_trailing_whitespace*
  1236. b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*
  1237. Type: |Number|
  1238. Default: `1`
  1239. When this option is set to `1`, warnings relating to trailing whitespace on
  1240. lines will be shown. If warnings are too irritating while editing buffers,
  1241. and you have configured Vim to automatically remove trailing whitespace,
  1242. you can disable these warnings by setting this option to `0`.
  1243. Not all linters may respect this option. If a linter does not, please file a
  1244. bug report, and it may be possible to add such support.
  1245. This option may be configured on a per buffer basis.
  1246. g:ale_windows_node_executable_path *g:ale_windows_node_executable_path*
  1247. *b:ale_windows_node_executable_path*
  1248. Type: |String|
  1249. Default: `'node.exe'`
  1250. This variable is used as the path to the executable to use for executing
  1251. scripts with Node.js on Windows.
  1252. For Windows, any file with a `.js` file extension needs to be executed with
  1253. the node executable explicitly. Otherwise, Windows could try and open the
  1254. scripts with other applications, like a text editor. Therefore, these
  1255. scripts are executed with whatever executable is configured with this
  1256. setting.
  1257. -------------------------------------------------------------------------------
  1258. 6.1. Highlights *ale-highlights*
  1259. ALEError *ALEError*
  1260. Default: `highlight link ALEError SpellBad`
  1261. The highlight used for highlighted errors. See |g:ale_set_highlights|.
  1262. ALEErrorLine *ALEErrorLine*
  1263. Default: Undefined
  1264. The highlight for an entire line where errors appear. Only the first
  1265. line for a problem will be highlighted.
  1266. See |g:ale_set_signs| and |g:ale_set_highlights|.
  1267. ALEErrorSign *ALEErrorSign*
  1268. Default: `highlight link ALEErrorSign error`
  1269. The highlight used for error signs. See |g:ale_set_signs|.
  1270. ALEInfo *ALEInfo.*
  1271. *ALEInfo-highlight*
  1272. Default: `highlight link ALEInfo ALEWarning`
  1273. The highlight used for highlighted info messages. See |g:ale_set_highlights|.
  1274. ALEInfoSign *ALEInfoSign*
  1275. Default: `highlight link ALEInfoSign ALEWarningSign`
  1276. The highlight used for info message signs. See |g:ale_set_signs|.
  1277. ALEInfoLine *ALEInfoLine*
  1278. Default: Undefined
  1279. The highlight for entire lines where info messages appear. Only the first
  1280. line for a problem will be highlighted.
  1281. See |g:ale_set_signs| and |g:ale_set_highlights|.
  1282. ALEStyleError *ALEStyleError*
  1283. Default: `highlight link ALEStyleError ALEError`
  1284. The highlight used for highlighted style errors. See |g:ale_set_highlights|.
  1285. ALEStyleErrorSign *ALEStyleErrorSign*
  1286. Default: `highlight link ALEStyleErrorSign ALEErrorSign`
  1287. The highlight used for style error signs. See |g:ale_set_signs|.
  1288. ALEStyleWarning *ALEStyleWarning*
  1289. Default: `highlight link ALEStyleWarning ALEError`
  1290. The highlight used for highlighted style warnings. See |g:ale_set_highlights|.
  1291. ALEStyleWarningSign *ALEStyleWarningSign*
  1292. Default: `highlight link ALEStyleWarningSign ALEWarningSign`
  1293. The highlight used for style warning signs. See |g:ale_set_signs|.
  1294. ALEWarning *ALEWarning*
  1295. Default: `highlight link ALEWarning SpellCap`
  1296. The highlight used for highlighted warnings. See |g:ale_set_highlights|.
  1297. ALEWarningLine *ALEWarningLine*
  1298. Default: Undefined
  1299. The highlight for entire lines where warnings appear. Only the first line
  1300. for a problem will be highlighted.
  1301. See |g:ale_set_signs| and |g:ale_set_highlights|.
  1302. ALEWarningSign *ALEWarningSign*
  1303. Default: `highlight link ALEWarningSign todo`
  1304. The highlight used for warning signs. See |g:ale_set_signs|.
  1305. -------------------------------------------------------------------------------
  1306. 6.2. Options for write-good *ale-write-good-options*
  1307. The options for the write-good linter are global because it does not make
  1308. sense to have them specified on a per-language basis.
  1309. g:ale_writegood_executable *g:ale_writegood_executable*
  1310. *b:ale_writegood_executable*
  1311. Type: |String|
  1312. Default: `'writegood'`
  1313. See |ale-integrations-local-executables|
  1314. g:ale_writegood_options *g:ale_writegood_options*
  1315. *b:ale_writegood_options*
  1316. Type: |String|
  1317. Default: `''`
  1318. This variable can be set to pass additional options to writegood.
  1319. g:ale_writegood_use_global *g:ale_writegood_use_global*
  1320. *b:ale_writegood_use_global*
  1321. Type: |Number|
  1322. Default: `get(g:, 'ale_use_global_executables', 0)`
  1323. See |ale-integrations-local-executables|
  1324. ===============================================================================
  1325. 7. Integration Documentation *ale-integrations*
  1326. Linter and fixer options are documented in individual help files. See the
  1327. table of contents at |ale-contents|.
  1328. Every option for programs can be set globally, or individually for each
  1329. buffer. For example, `b:ale_python_flake8_executable` will override any
  1330. values set for `g:ale_python_flake8_executable`.
  1331. *ale-integrations-local-executables*
  1332. Some tools will prefer to search for locally-installed executables, unless
  1333. configured otherwise. For example, the `eslint` linter will search for
  1334. various executable paths in `node_modules`. The `flake8` linter will search
  1335. for virtualenv directories.
  1336. If you prefer to use global executables for those tools, set the relevant
  1337. `_use_global` and `_executable` options for those linters. >
  1338. " Use the global executable with a special name for eslint.
  1339. let g:ale_javascript_eslint_executable = 'special-eslint'
  1340. let g:ale_javascript_eslint_use_global = 1
  1341. " Use the global executable with a special name for flake8.
  1342. let g:ale_python_flake8_executable = '/foo/bar/flake8'
  1343. let g:ale_python_flake8_use_global = 1
  1344. <
  1345. |g:ale_use_global_executables| can be set to `1` in your vimrc file to make
  1346. ALE use global executables for all linters by default.
  1347. The option |g:ale_virtualenv_dir_names| controls the local virtualenv paths
  1348. ALE will use to search for Python executables.
  1349. ===============================================================================
  1350. 8. Commands/Keybinds *ale-commands*
  1351. ALEFindReferences *ALEFindReferences*
  1352. Find references in the codebase for the symbol under the cursor using the
  1353. enabled LSP linters for the buffer. ALE will display a preview window
  1354. containing the results if some references are found.
  1355. The window can be navigated using the usual Vim navigation commands. The
  1356. Enter key (`<CR>`) can be used to jump to a referencing location, or the `t`
  1357. key can be used to jump to the location in a new tab.
  1358. You can jump back to the position you were at before going to a reference of
  1359. something with jump motions like CTRL-O. See |jump-motions|.
  1360. A plug mapping `<Plug>(ale_find_references)` is defined for this command.
  1361. ALEFix *ALEFix*
  1362. Fix problems with the current buffer. See |ale-fix| for more information.
  1363. A plug mapping `<Plug>(ale_fix)` is defined for this command.
  1364. ALEFixSuggest *ALEFixSuggest*
  1365. Suggest tools that can be used to fix problems in the current buffer.
  1366. See |ale-fix| for more information.
  1367. ALEGoToDefinition *ALEGoToDefinition*
  1368. Jump to the definition of a symbol under the cursor using the enabled LSP
  1369. linters for the buffer. ALE will jump to a definition if an LSP server
  1370. provides a location to jump to. Otherwise, ALE will do nothing.
  1371. You can jump back to the position you were at before going to the definition
  1372. of something with jump motions like CTRL-O. See |jump-motions|.
  1373. A plug mapping `<Plug>(ale_go_to_definition)` is defined for this command.
  1374. ALEGoToDefinitionInTab *ALEGoToDefinitionInTab*
  1375. The same as |ALEGoToDefinition|, but opens results in a new tab.
  1376. A plug mapping `<Plug>(ale_go_to_definition_in_tab)` is defined for this
  1377. command.
  1378. ALEHover *ALEHover*
  1379. Print brief information about the symbol under the cursor, taken from any
  1380. available LSP linters. There may be a small non-blocking delay before
  1381. information is printed.
  1382. NOTE: In Vim 8, long messages will be shown in a preview window, as Vim 8
  1383. does not support showing a prompt to press enter to continue for long
  1384. messages from asynchronous callbacks.
  1385. A plug mapping `<Plug>(ale_hover)` is defined for this command.
  1386. *:ALELint*
  1387. ALELint *ALELint*
  1388. Run ALE once for the current buffer. This command can be used to run ALE
  1389. manually, instead of automatically, if desired.
  1390. This command will also run linters where `lint_file` is set to `1`, or in
  1391. other words linters which check the file instead of the Vim buffer.
  1392. A plug mapping `<Plug>(ale_lint)` is defined for this command.
  1393. ALEPrevious *ALEPrevious*
  1394. ALEPreviousWrap *ALEPreviousWrap*
  1395. ALENext *ALENext*
  1396. ALENextWrap *ALENextWrap*
  1397. ALEFirst *ALEFirst*
  1398. ALELast *ALELast*
  1399. *ale-navigation-commands*
  1400. Move between warnings or errors in a buffer. ALE will only navigate between
  1401. the errors or warnings it generated, even if both |g:ale_set_quickfix|
  1402. and |g:ale_set_loclist| are set to `0`.
  1403. `ALEPrevious` and `ALENext` will stop at the top and bottom of a file, while
  1404. `ALEPreviousWrap` and `ALENextWrap` will wrap around the file to find
  1405. the last or first warning or error in the file, respectively.
  1406. `ALEFirst` goes to the first error or warning in the buffer, while `ALELast`
  1407. goes to the last one.
  1408. The following |<Plug>| mappings are defined for the commands: >
  1409. <Plug>(ale_previous) - ALEPrevious
  1410. <Plug>(ale_previous_wrap) - ALEPreviousWrap
  1411. <Plug>(ale_next) - ALENext
  1412. <Plug>(ale_next_wrap) - ALENextWrap
  1413. <Plug>(ale_first) - ALEFirst
  1414. <Plug>(ale_last) - ALELast
  1415. <
  1416. For example, these commands could be bound to the keys Ctrl + j
  1417. and Ctrl + k: >
  1418. " Map movement through errors without wrapping.
  1419. nmap <silent> <C-k> <Plug>(ale_previous)
  1420. nmap <silent> <C-j> <Plug>(ale_next)
  1421. " OR map keys to use wrapping.
  1422. nmap <silent> <C-k> <Plug>(ale_previous_wrap)
  1423. nmap <silent> <C-j> <Plug>(ale_next_wrap)
  1424. <
  1425. ALEToggle *ALEToggle*
  1426. ALEEnable *ALEEnable*
  1427. ALEDisable *ALEDisable*
  1428. ALEToggleBuffer *ALEToggleBuffer*
  1429. ALEEnableBuffer *ALEEnableBuffer*
  1430. ALEDisableBuffer *ALEDisableBuffer*
  1431. `ALEToggle`, `ALEEnable`, and `ALEDisable` enable or disable ALE linting,
  1432. including all of its autocmd events, loclist items, quickfix items, signs,
  1433. current jobs, etc., globally. Executing any of these commands will change
  1434. the |g:ale_enabled| variable.
  1435. ALE can be disabled or enabled for only a single buffer with
  1436. `ALEToggleBuffer`, `ALEEnableBuffer`, and `ALEDisableBuffer`. Disabling ALE
  1437. for a buffer will not remove autocmd events, but will prevent ALE from
  1438. checking for problems and reporting problems for whatever buffer the
  1439. `ALEDisableBuffer` or `ALEToggleBuffer` command is executed from. These
  1440. commands can be used for temporarily disabling ALE for a buffer. These
  1441. commands will modify the |b:ale_enabled| variable.
  1442. ALE linting cannot be enabled for a single buffer when it is disabled
  1443. globally, as disabling ALE globally removes the autocmd events needed to
  1444. perform linting with.
  1445. The following plug mappings are defined, for conveniently defining keybinds:
  1446. |ALEToggle| - `<Plug>(ale_toggle)`
  1447. |ALEEnable| - `<Plug>(ale_enable)`
  1448. |ALEDisable| - `<Plug>(ale_disable)`
  1449. |ALEToggleBuffer| - `<Plug>(ale_toggle_buffer)`
  1450. |ALEEnableBuffer| - `<Plug>(ale_enable_buffer)`
  1451. |ALEDisableBuffer| - `<Plug>(ale_disable_buffer)`
  1452. For removing problems reported by ALE, but leaving ALE enabled, see
  1453. |ALEReset| and |ALEResetBuffer|.
  1454. *:ALEDetail*
  1455. ALEDetail *ALEDetail*
  1456. Show the full linter message for the current line in the preview window.
  1457. This will only have an effect on lines that contain a linter message. The
  1458. preview window can be easily closed with the `q` key.
  1459. A plug mapping `<Plug>(ale_detail)` is defined for this command.
  1460. *:ALEInfo*
  1461. ALEInfo *ALEInfo*
  1462. ALEInfoToClipboard *ALEInfoToClipboard*
  1463. Print runtime information about ALE, including the values of global and
  1464. buffer-local settings for ALE, the linters that are enabled, the commands
  1465. that have been run, and the output of commands.
  1466. ALE will log the commands that are run by default. If you wish to disable
  1467. this, set |g:ale_history_enabled| to `0`. Because it could be expensive, ALE
  1468. does not remember the output of recent commands by default. Set
  1469. |g:ale_history_log_output| to `1` to enable logging of output for commands.
  1470. ALE will only log the output captured for parsing problems, etc.
  1471. The command `:ALEInfoToClipboard` can be used to output ALEInfo directly to
  1472. your clipboard. This might not work on every machine.
  1473. `:ALEInfoToFile` will write the ALE runtime information to a given filename.
  1474. The filename works just like |:w|.
  1475. ALEReset *ALEReset*
  1476. ALEResetBuffer *ALEResetBuffer*
  1477. `ALEReset` will remove all problems reported by ALE for all buffers.
  1478. `ALEResetBuffer` will remove all problems reported for a single buffer.
  1479. Either command will leave ALE linting enabled, so ALE will report problems
  1480. when linting is performed again. See |ale-lint| for more information.
  1481. The following plug mappings are defined, for conveniently defining keybinds:
  1482. |ALEReset| - `<Plug>(ale_reset)`
  1483. |ALEResetBuffer| - `<Plug>(ale_reset_buffer)`
  1484. ALE can be disabled globally or for a buffer with |ALEDisable| or
  1485. |ALEDisableBuffer|.
  1486. ALEStopAllLSPs *ALEStopAllLSPs*
  1487. `ALEStopAllLSPs` will close and stop all channels and jobs for all LSP-like
  1488. clients, including tsserver, remove all of the data stored for them, and
  1489. delete all of the problems found for them, updating every linted buffer.
  1490. This command can be used when LSP clients mess up and need to be restarted.
  1491. ===============================================================================
  1492. 9. API *ale-api*
  1493. ale#Queue(delay, [linting_flag, buffer_number]) *ale#Queue()*
  1494. Run linters for the current buffer, based on the filetype of the buffer,
  1495. with a given `delay`. A `delay` of `0` will run the linters immediately.
  1496. The linters will always be run in the background. Calling this function
  1497. again from the same buffer
  1498. An optional `linting_flag` argument can be given. If `linting_flag`
  1499. is `'lint_file'`, then linters where the `lint_file` option is set to `1` will be
  1500. run. Linters with `lint_file` set to `1` are not run by default.
  1501. An optional `buffer_number` argument can be given for specifying the buffer
  1502. to check. The active buffer (`bufnr('')`) will be checked by default.
  1503. *ale-cool-down*
  1504. If an exception is thrown when queuing/running ALE linters, ALE will enter
  1505. a cool down period where it will stop checking anything for a short period
  1506. of time. This is to prevent ALE from seriously annoying users if a linter
  1507. is broken, or when developing ALE itself.
  1508. ale#engine#CreateDirectory(buffer) *ale#engine#CreateDirectory()*
  1509. Create a new temporary directory with a unique name, and manage that
  1510. directory with |ale#engine#ManageDirectory()|, so it will be removed as
  1511. soon as possible.
  1512. It is advised to only call this function from a callback function for
  1513. returning a linter command to run.
  1514. ale#engine#EscapeCommandPart(command_part) *ale#engine#EscapeCommandPart()*
  1515. Given a |String|, return a |String| with all `%` characters replaced with
  1516. `%%` instead. This function can be used to escape strings which are
  1517. dynamically generated for commands before handing them over to ALE,
  1518. so that ALE doesn't treat any strings with `%` formatting sequences
  1519. specially.
  1520. ale#engine#GetLoclist(buffer) *ale#engine#GetLoclist()*
  1521. Given a buffer number, this function will return the list of problems
  1522. reported by ALE for a given buffer in the format accepted by |setqflist()|.
  1523. A reference to the buffer's list of problems will be returned. The list must
  1524. be copied before applying |map()| or |filter()|.
  1525. ale#engine#IsCheckingBuffer(buffer) *ale#engine#IsCheckingBuffer()*
  1526. Given a buffer number, returns `1` when ALE is busy checking that buffer.
  1527. This function can be used for status lines, tab names, etc.
  1528. ale#engine#ManageFile(buffer, filename) *ale#engine#ManageFile()*
  1529. Given a buffer number for a buffer currently running some linting tasks
  1530. and a filename, register a filename with ALE for automatic deletion after
  1531. linting is complete, or when Vim exits.
  1532. If Vim exits suddenly, ALE will try its best to remove temporary files, but
  1533. ALE cannot guarantee with absolute certainty that the files will be removed.
  1534. It is advised to create temporary files in the operating system's managed
  1535. temporary file directory, such as with |tempname()|.
  1536. Directory names should not be given to this function. ALE will only delete
  1537. files and symlinks given to this function. This is to prevent entire
  1538. directories from being accidentally deleted, say in cases of writing
  1539. `dir . '/' . filename` where `filename` is actually `''`, etc. ALE instead
  1540. manages directories separetly with the |ale#engine#ManageDirectory| function.
  1541. ale#engine#ManageDirectory(buffer, directory) *ale#engine#ManageDirectory()*
  1542. Like |ale#engine#ManageFile()|, but directories and all of their contents
  1543. will be deleted, akin to `rm -rf directory`, which could lead to loss of
  1544. data if mistakes are made. This command will also delete any temporary
  1545. filenames given to it.
  1546. It is advised to use |ale#engine#ManageFile()| instead for deleting single
  1547. files.
  1548. ale#fix#registry#Add(name, func, filetypes, desc, [aliases])
  1549. *ale#fix#registry#Add()*
  1550. Given a |String| `name` for a name to add to the registry, a |String| `func`
  1551. for a function name, a |List| `filetypes` for a list of filetypes to
  1552. set for suggestions, and a |String| `desc` for a short description of
  1553. the fixer, register a fixer in the registry.
  1554. The `name` can then be used for |g:ale_fixers| in place of the function
  1555. name, and suggested for fixing files.
  1556. An optional |List| of |String|s for aliases can be passed as the `aliases`
  1557. argument. These aliases can also be used for looking up a fixer function.
  1558. ALE will search for fixers in the registry first by `name`, then by their
  1559. `aliases`.
  1560. ale#linter#Define(filetype, linter) *ale#linter#Define()*
  1561. Given a |String| for a filetype and a |Dictionary| Describing a linter
  1562. configuration, add a linter for the given filetype. The dictionaries each
  1563. offer the following options:
  1564. `name` The name of the linter. These names will be used by
  1565. |g:ale_linters| option for enabling/disabling
  1566. particular linters.
  1567. This argument is required.
  1568. `callback` A |String| or |Funcref| for a callback function
  1569. accepting two arguments (buffer, lines), for a
  1570. buffer number the output is for, and the lines of
  1571. output from a linter.
  1572. This callback function should return a |List| of
  1573. |Dictionary| objects in the format accepted by
  1574. |setqflist()|. The |List| will be sorted by line and
  1575. then column order so it can be searched with a binary
  1576. search by in future before being passed on to the
  1577. |loclist|, etc.
  1578. This argument is required, unless the linter is an
  1579. LSP linter. In which case, this argument must not be
  1580. defined, as LSP linters handle diangostics
  1581. automatically. See |ale-lsp-linters|.
  1582. The keys for each item in the List will be handled in
  1583. the following manner:
  1584. *ale-loclist-format*
  1585. `text` - This error message is required.
  1586. `lnum` - The line number is required. Any strings
  1587. will be automatically converted to numbers by
  1588. using `str2nr()`.
  1589. Line 0 will be moved to line 1, and lines beyond
  1590. the end of the file will be moved to the end.
  1591. `col` - The column number is optional and will
  1592. default to `0`. Any strings will be automatically
  1593. converted to number using `str2nr()`.
  1594. `end_col` - An optional end column number.
  1595. This key can be set to specify the column problems
  1596. end on, for improved highlighting.
  1597. `end_lnum` - An optional end line number.
  1598. This key can set along with `end_col` for
  1599. highlighting multi-line problems.
  1600. `bufnr` - This key represents the buffer number the
  1601. problems are for. This value will default to
  1602. the buffer number being checked.
  1603. The `filename` key can be set instead of this key,
  1604. and then the eventual `bufnr` value in the final
  1605. list will either represent the number for an open
  1606. buffer or `-1` for a file not open in any buffer.
  1607. `filename` - An optional filename for the file the
  1608. problems are for. This should be an absolute path to
  1609. a file.
  1610. Problems for files which have not yet been opened
  1611. will be set in those files after they are opened
  1612. and have been checked at least once.
  1613. Temporary files in directories used for Vim
  1614. temporary files with `tempname()` will be asssumed
  1615. to be the buffer being checked, unless the `bufnr`
  1616. key is also set with a valid number for some other
  1617. buffer.
  1618. `vcol` - Defaults to `0`.
  1619. If set to `1`, ALE will convert virtual column
  1620. positions for `col` and `end_col` to byte column
  1621. positions. If the buffer is changed in-between
  1622. checking it and displaying the results, the
  1623. calculated byte column positions will probably be
  1624. wrong.
  1625. `type` - Defaults to `'E'`.
  1626. `nr` - Defaults to `-1`.
  1627. `executable` A |String| naming the executable itself which
  1628. will be run. This value will be used to check if the
  1629. program requested is installed or not.
  1630. Either this or the `executable_callback` argument
  1631. must be provided.
  1632. `executable_callback ` A |String| or |Funcref| for a callback function
  1633. accepting a buffer number. A |String| should be
  1634. returned for the executable to check. This can be
  1635. used in place of `executable` when more complicated
  1636. processing is needed.
  1637. `command` A |String| for an executable to run asynchronously.
  1638. This command will be fed the lines from the buffer to
  1639. check, and will produce the lines of output given to
  1640. the `callback`.
  1641. `command_callback` A |String| or |Funcref| for a callback function
  1642. accepting a buffer number. A |String| should be
  1643. returned for a command to run. This can be used in
  1644. place of `command` when more complicated processing
  1645. is needed.
  1646. If an empty string is returned from the callback,
  1647. no jobs for linting will be run for that linter.
  1648. This can be used for skipping a linter call,
  1649. say if no configuration file was found.
  1650. *ale-command-chain*
  1651. `command_chain` A |List| of |Dictionary| items defining a series
  1652. of commands to be run. At least one |Dictionary|
  1653. should be provided. Each Dictionary must contain the
  1654. key `callback`, defining a |String| or |Funcref| for
  1655. a function returning a |String| for a command to run.
  1656. The callback functions for each command after the
  1657. first command in in the chain should accept two
  1658. arguments `(buffer, output)`, a buffer number and a
  1659. |List| of lines of output from the previous command
  1660. in the chain.
  1661. The first callback function in a chain accepts only
  1662. a `(buffer)` argument, as there are no previous
  1663. commands to run which return `output`.
  1664. If an empty string is returned for a command in a
  1665. chain, that command in the chain will be skipped,
  1666. and the next function in the chain will be called
  1667. immediately instead. If the last command in a chain
  1668. returns an empty string, then no linting will be
  1669. performed.
  1670. Commands in the chain will all use the
  1671. `output_stream` value provided in the root
  1672. |Dictionary|. Each command in the chain can also
  1673. provide an `output_stream` key to override this value.
  1674. See the `output_stream` description for more
  1675. information.
  1676. Commands in the chain all behave as if `read_buffer`
  1677. is set to `0` by default, except for the last command
  1678. in the chain, which uses the value set for
  1679. `read_buffer` in the root |Dictionary|. Each command
  1680. in the chain can also provide a `read_buffer` key
  1681. to override these values.
  1682. See the `read_buffer` description for more
  1683. information.
  1684. `output_stream` A |String| for the output stream the lines of output
  1685. should be read from for the command which is run. The
  1686. accepted values are `'stdout'`, `'stderr'`, and
  1687. `'both'`. This argument defaults to `'stdout'`. This
  1688. argument can be set for linter programs which output
  1689. their errors and warnings to the stderr stream
  1690. instead of stdout. The option `'both'` will read
  1691. from both stder and stdout at the same time.
  1692. `read_buffer` A |Number| (`0` or `1`) indicating whether a command
  1693. should read the Vim buffer as input via stdin. This
  1694. option is set to `1` by default, and can be disabled
  1695. if a command manually reads from a temporary file
  1696. instead, etc.
  1697. *ale-lint-file*
  1698. `lint_file` A |Number| (`0` or `1`) indicating whether a command
  1699. should read the file instead of the Vim buffer. This
  1700. option can be used for linters which must check the
  1701. file on disk, and which cannot check a Vim buffer
  1702. instead.
  1703. Linters set with this option will not be run as a
  1704. user types, per |g:ale_lint_on_text_changed|. Linters
  1705. will instead be run only when events occur against
  1706. the file on disk, including |g:ale_lint_on_enter|
  1707. and |g:ale_lint_on_save|. Linters with this option
  1708. set to `1` will also be run when linters are run
  1709. manually, per |ALELintPost-autocmd|.
  1710. When this option is set to `1`, `read_buffer` will
  1711. be set automatically to `0`. The two options cannot
  1712. be used together.
  1713. *ale-lsp-linters*
  1714. `lsp` A |String| for defining LSP (Language Server Protocol)
  1715. linters.
  1716. This argument may be omitted or `''` when a linter
  1717. does not represent an LSP linter.
  1718. When this argument is set to `'stdio'`, then the
  1719. linter will be defined as an LSP linter which keeps a
  1720. process for a language server runnning, and
  1721. communicates with it directly via a |channel|.
  1722. When this argument is not empty, only one of either
  1723. `language` or `language_callback` must be defined,
  1724. and `project_root_callback` must be defined.
  1725. LSP linters handle diagnostics automatically, so
  1726. the `callback` argument must not be defined.
  1727. An optional `completion_filter` callback may be
  1728. defined for filtering completion results.
  1729. An optional `initialization_options` or
  1730. `initialization_options_callback` may be defined to
  1731. pass initialization options to the LSP.
  1732. `project_root_callback` A |String| or |Funcref| for a callback function
  1733. accepting a buffer number. A |String| should be
  1734. returned representing the path to the project for the
  1735. file being checked with the language server. If an
  1736. empty string is returned, the file will not be
  1737. checked at all.
  1738. This argument must only be set if the `lsp` argument
  1739. is also set to a non-empty string.
  1740. `language` A |String| representing the name of the language
  1741. being checked. This string will be sent to the LSP to
  1742. tell it what type of language is being checked.
  1743. This argument must only be set if the `lsp` argument
  1744. is also set to a non-empty string.
  1745. `language_callback` A |String| or |Funcref| for a callback function
  1746. accepting a buffer number. A |String| should be
  1747. returned representing the name of the language being
  1748. checked.
  1749. This option can be used instead of `language` if a
  1750. linter can check multiple languages.
  1751. `completion_filter` A |String| or |Funcref| for a callback function
  1752. accepting a buffer number and a completion item.
  1753. The completion item will be a |Dictionary| following
  1754. the Language Server Protocol `CompletionItem`
  1755. interface as described in the specification,
  1756. available online here:
  1757. https://microsoft.github.io/language-server-protocol
  1758. `aliases` A |List| of aliases for the linter name.
  1759. This argument can be set with alternative names for
  1760. selecting the linter with |g:ale_linters|. This
  1761. setting can make it easier to guess the linter name
  1762. by offering a few alternatives.
  1763. `initialization_options` A |Dictionary| of initialization options for LSPs.
  1764. This will be fed (as JSON) to the LSP in the
  1765. initialize command.
  1766. `initialization_options_callback`
  1767. A |String| or |Funcref| for a callback function
  1768. accepting a buffer number. A |Dictionary| should be
  1769. returned for initialization options to pass the LSP.
  1770. This can be used in place of `initialization_options`
  1771. when more complicated processing is needed.
  1772. Only one of `command`, `command_callback`, or `command_chain` should be
  1773. specified. `command_callback` is generally recommended when a command string
  1774. needs to be generated dynamically, or any global options are used.
  1775. `command_chain` is recommended where any system calls need to be made to
  1776. retrieve some kind of information before running the final command.
  1777. If temporary files or directories are created for commands run with
  1778. `command_callback` or `command_chain`, then these tempoary files or
  1779. directories can be managed by ALE, for automatic deletion.
  1780. See |ale#engine#ManageFile()| and |ale#engine#ManageDirectory| for more
  1781. information.
  1782. *ale-command-format-strings*
  1783. All command strings will be formatted for special character sequences.
  1784. Any substring `%s` will be replaced with the full path to the current file
  1785. being edited. This format option can be used to pass the exact filename
  1786. being edited to a program.
  1787. For example: >
  1788. 'command': 'eslint -f unix --stdin --stdin-filename %s'
  1789. <
  1790. Any substring `%t` will be replaced with a path to a temporary file. Merely
  1791. adding `%t` will cause ALE to create a temporary file containing the
  1792. contents of the buffer being checked. All occurrences of `%t` in command
  1793. strings will reference the one temporary file. The temporary file will be
  1794. created inside a temporary directory, and the entire temporary directory
  1795. will be automatically deleted, following the behaviour of
  1796. |ale#engine#ManageDirectory|. This option can be used for some linters which
  1797. do not support reading from stdin.
  1798. For example: >
  1799. 'command': 'ghc -fno-code -v0 %t',
  1800. <
  1801. The character sequence `%%` can be used to emit a literal `%` into a
  1802. command, so literal character sequences `%s` and `%t` can be escaped by
  1803. using `%%s` and `%%t` instead, etc.
  1804. If a callback for a command generates part of a command string which might
  1805. possibly contain `%%`, `%s`, or `%t` where the special formatting behaviour
  1806. is not desired, the |ale#engine#EscapeCommandPart()| function can be used to
  1807. replace those characters to avoid formatting issues.
  1808. *ale-linter-loading-behavior*
  1809. *ale-linter-loading-behaviour*
  1810. Linters for ALE will be loaded by searching |runtimepath| in the following
  1811. format: >
  1812. ale_linters/<filetype>/<linter_name>.vim
  1813. <
  1814. Any linters which exist anywhere in |runtimepath| with that directory
  1815. structure will be automatically loaded for the matching |filetype|. Filetypes
  1816. containing `.` characters will be split into individual parts, and files
  1817. will be loaded for each filetype between the `.` characters.
  1818. Linters can be defined from vimrc and other files as long as this function
  1819. is loaded first. For example, the following code will define a Hello World
  1820. linter in vimrc in Vim 8: >
  1821. " Plugins have to be loaded first.
  1822. " If you are using a plugin manager, run that first.
  1823. packloadall
  1824. call ale#linter#Define('vim', {
  1825. \ 'name': 'echo-test',
  1826. \ 'executable': 'echo',
  1827. \ 'command': 'echo hello world',
  1828. \ 'callback': {buffer, lines -> map(lines, '{"text": v:val, "lnum": 1}')},
  1829. \})
  1830. <
  1831. ale#linter#Get(filetype) *ale#linter#Get()*
  1832. Return all of linters configured for a given filetype as a |List| of
  1833. |Dictionary| values in the format specified by |ale#linter#Define()|.
  1834. Filetypes may be dot-separated to invoke linters for multiple filetypes:
  1835. for instance, the filetype `javascript.jsx` will return linters for both the
  1836. `javascript` and `jsx` filetype.
  1837. Aliases may be defined in as described in |g:ale_linter_aliases|. Aliases
  1838. are applied after dot-separated filetypes are broken up into their
  1839. components.
  1840. ale#linter#PreventLoading(filetype) *ale#linter#PreventLoading()*
  1841. Given a `filetype`, prevent any more linters from being loaded from
  1842. |runtimepath| for that filetype. This function can be called from vimrc or
  1843. similar to prevent ALE from loading linters.
  1844. ale#statusline#Count(buffer) *ale#statusline#Count()*
  1845. Given the number of a buffer which may have problems, return a |Dictionary|
  1846. containing information about the number of problems detected by ALE. The
  1847. following keys are supported:
  1848. `error` -> The number of problems with type `E` and `sub_type != 'style'`
  1849. `warning` -> The number of problems with type `W` and `sub_type != 'style'`
  1850. `info` -> The number of problems with type `I`
  1851. `style_error` -> The number of problems with type `E` and `sub_type == 'style'`
  1852. `style_warning` -> The number of problems with type `W` and `sub_type == 'style'`
  1853. `total` -> The total number of problems.
  1854. b:ale_linted *b:ale_linted*
  1855. `b:ale_linted` is set to the number of times a buffer has been checked by
  1856. ALE after all linters for one lint cycle have finished checking a buffer.
  1857. This variable may not be defined until ALE first checks a buffer, so it
  1858. should be accessed with |get()| or |getbufvar()|. For example: >
  1859. " Print a message indicating how many times ALE has checked this buffer.
  1860. echo 'ALE has checked this buffer ' . get(b:, 'ale_linted') . ' time(s).'
  1861. " Print 'checked' using getbufvar() if a buffer has been checked.
  1862. echo getbufvar(bufnr(''), 'ale_linted', 0) > 0 ? 'checked' : 'not checked'
  1863. <
  1864. ALELintPre *ALELintPre-autocmd*
  1865. ALELintPost *ALELintPost-autocmd*
  1866. ALEFixPre *ALEFixPre-autocmd*
  1867. ALEFixPost *ALEFixPost-autocmd*
  1868. These |User| autocommands are triggered before and after every lint or fix
  1869. cycle. They can be used to update statuslines, send notifications, etc.
  1870. The autocmd commands are run with |:silent|, so |:unsilent| is required for
  1871. echoing messges.
  1872. For example to change the color of the statusline while the linter is
  1873. running:
  1874. >
  1875. augroup ALEProgress
  1876. autocmd!
  1877. autocmd User ALELintPre hi Statusline ctermfg=darkgrey
  1878. autocmd User ALELintPOST hi Statusline ctermfg=NONE
  1879. augroup end
  1880. <
  1881. Or to display the progress in the statusline:
  1882. >
  1883. let s:ale_running = 0
  1884. let l:stl .= '%{s:ale_running ? "[linting]" : ""}'
  1885. augroup ALEProgress
  1886. autocmd!
  1887. autocmd User ALELintPre let s:ale_running = 1 | redrawstatus
  1888. autocmd User ALELintPost let s:ale_running = 0 | redrawstatus
  1889. augroup end
  1890. <
  1891. ALEJobStarted *ALEJobStarted-autocmd*
  1892. This |User| autocommand is triggered immediately after a job is successfully
  1893. run. This provides better accuracy for checking linter status with
  1894. |ale#engine#IsCheckingBuffer()| over |ALELintPre-autocmd|, which is actually
  1895. triggered before any linters are executed.
  1896. ===============================================================================
  1897. 10. Special Thanks *ale-special-thanks*
  1898. Special thanks to Mark Grealish (https://www.bhalash.com/) for providing ALE's
  1899. snazzy looking ale glass logo. Cheers, Mark!
  1900. ===============================================================================
  1901. 11. Contact *ale-contact*
  1902. If you like this plugin, and wish to get in touch, check out the GitHub
  1903. page for issues and more at https://github.com/w0rp/ale
  1904. If you wish to contact the author of this plugin directly, please feel
  1905. free to send an email to devw0rp@gmail.com.
  1906. Please drink responsibly, or not at all, which is ironically the preference
  1907. of w0rp, who is teetotal.
  1908. vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: