refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / vim-ale / README.md
1 ---
2 title: vim-ale
3 homepage: https://github.com/dense-analysis/ale
4 tagline: |
5   ALE: allows you to lint while you type.
6 ---
7
8 To update (replacing the current version) run `webi vim-ale`.
9
10 ## Cheat Sheet
11
12 > ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
13 > and semantic errors) in NeoVim 0.2.0+ and Vim 8 while you edit your text
14 > files, and acts as a Vim Language Server Protocol client.
15
16 ALE is the spiritual successor to Syntastic.
17
18 This installer includes a few reasonable defaults.
19
20 ### How to install and configure manually
21
22 ```bash
23 mkdir -p ~/.vim/pack/plugins/start/
24 git clone --depth=1 https://github.com/dense-analysis/ale.git ~/.vim/pack/plugins/start/ale
25 ```
26
27 `.vimrc`:
28
29 ```vim
30 " ALE: reasonable defaults from webinstall.dev/vim-ale
31 source ~/.vim/plugins/ale.vim
32 ```
33
34 `.vim/plugins/ale.vim`:
35
36 ```txt
37 " turn on the syntax checker
38 syntax on
39
40 " don't check syntax immediately on open or on quit
41 let g:ale_lint_on_enter = 0
42 let g:ale_lint_on_save = 1
43
44 " error symbol to use in sidebar
45 let g:ale_sign_error = '☢️'
46 let g:ale_sign_warning = '⚡'
47
48 " show number of errors
49 function! LinterStatus() abort
50     let l:counts = ale#statusline#Count(bufnr(''))
51     let l:all_errors = l:counts.error + l:counts.style_error
52     let l:all_non_errors = l:counts.total - l:all_errors
53     return l:counts.total == 0 ? 'OK' : printf(
54         \   '%d⨉ %d⚠ ',
55         \   all_non_errors,
56         \   all_errors
57         \)
58 endfunction
59 set statusline+=%=
60 set statusline+=\ %{LinterStatus()}
61
62 " format error strings
63 let g:ale_echo_msg_error_str = 'E'
64 let g:ale_echo_msg_warning_str = 'W'
65 let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
66 ```