X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=vim-ale%2Fale.vim;fp=vim-ale%2Fale.vim;h=23c2f9dd15f1e0f8eb6f8407d38ed4ebf6bf89f4;hb=7a14219d7d51d9f4cfa22b2bd7ce2ed47639be6e;hp=0000000000000000000000000000000000000000;hpb=77866561937dbc35454a02deb6e452320f5ba53d;p=webi-installers%2F.git diff --git a/vim-ale/ale.vim b/vim-ale/ale.vim new file mode 100644 index 0000000..23c2f9d --- /dev/null +++ b/vim-ale/ale.vim @@ -0,0 +1,31 @@ +" turn on the syntax checker +syntax on + +" don't check immediately on open (or quit) +let g:ale_lint_on_enter = 0 +" check on save +let g:ale_lint_on_save = 1 + +" these emojis go in the sidebar for errors and warnings +" other considerations: '💥' '☠' '●' '.' +let g:ale_sign_error = '☢️' +let g:ale_sign_warning = '⚡' + +" show error count +function! LinterStatus() abort + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:counts.total == 0 ? 'OK' : printf( + \ '%d⨉ %d⚠ ', + \ all_non_errors, + \ all_errors + \) +endfunction +set statusline+=%= +set statusline+=\ %{LinterStatus()} + +" how to show error message +let g:ale_echo_msg_error_str = 'E' +let g:ale_echo_msg_warning_str = 'W' +let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'