# HG changeset patch # User Ludovic Chabant # Date 1525756496 25200 # Node ID 71d7734148ed8ca1d3dc11ef15628fb044a663a1 # Parent 4ca0b1413199eee0643f80ec591eff005bc6dfbe Add support for ALE. diff -r 4ca0b1413199 -r 71d7734148ed vim/vimrc --- a/vim/vimrc Sun May 06 21:56:43 2018 -0700 +++ b/vim/vimrc Mon May 07 22:14:56 2018 -0700 @@ -330,6 +330,13 @@ " }}} +" ALE {{{ + +let g:ale_sign_error = '✗' +let g:ale_sign_warning = '⚠' + +" }}} + " Supertab {{{ let g:SuperTabDefaultCompletionType = "context" @@ -411,7 +418,7 @@ \ 'ctrlpmark': '_LightlineCtrlPMark', \ }, \'component_expand': { - \ 'syntastic': '_LightlineSyntastic', + \ 'syntastic': '_LightlineLinter', \ 'ycm_errs': '_LightlineYcmErrors', \ 'ycm_warns': '_LightlineYcmWarnings', \ 'gutentags': '_LightlineGutentags', @@ -449,9 +456,24 @@ return gutentags#statusline('', '', '♨') endfunction -function! _LightlineSyntastic() - return SyntasticStatuslineFlag() -endfunction +if s:HasPlugin('syntastic') + function! _LightlineLinter() + return SyntasticStatuslineFlag() + endfunction +else + function! _LightlineLinter() 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( + \ '%dW %dE', + \ all_non_errors, + \ all_errors + \) + endfunction +endif function! _LightlineYcmErrors() let l:cnt = youcompleteme#GetErrorCount()