Mercurial > dotfiles
comparison vim/vimrc @ 444:71d7734148ed
Add support for ALE.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 07 May 2018 22:14:56 -0700 |
parents | 4ca0b1413199 |
children | 05ab0353cd6e |
comparison
equal
deleted
inserted
replaced
443:4ca0b1413199 | 444:71d7734148ed |
---|---|
325 " flake8 includes pyflakes, pep8, and mccabe | 325 " flake8 includes pyflakes, pep8, and mccabe |
326 " I could maybe replace pyflakes with frosted? | 326 " I could maybe replace pyflakes with frosted? |
327 let g:syntastic_python_checkers = ['flake8'] ", 'pylint'] | 327 let g:syntastic_python_checkers = ['flake8'] ", 'pylint'] |
328 let g:syntastic_python_python_exec = 'python3' | 328 let g:syntastic_python_python_exec = 'python3' |
329 let g:syntastic_python_flake8_args='--ignore=W191,W391' | 329 let g:syntastic_python_flake8_args='--ignore=W191,W391' |
330 | |
331 " }}} | |
332 | |
333 " ALE {{{ | |
334 | |
335 let g:ale_sign_error = '✗' | |
336 let g:ale_sign_warning = '⚠' | |
330 | 337 |
331 " }}} | 338 " }}} |
332 | 339 |
333 " Supertab {{{ | 340 " Supertab {{{ |
334 | 341 |
409 \ 'fugitive': '_LightlineFugitive', | 416 \ 'fugitive': '_LightlineFugitive', |
410 \ 'lawrencium': '_LightlineLawrencium', | 417 \ 'lawrencium': '_LightlineLawrencium', |
411 \ 'ctrlpmark': '_LightlineCtrlPMark', | 418 \ 'ctrlpmark': '_LightlineCtrlPMark', |
412 \ }, | 419 \ }, |
413 \'component_expand': { | 420 \'component_expand': { |
414 \ 'syntastic': '_LightlineSyntastic', | 421 \ 'syntastic': '_LightlineLinter', |
415 \ 'ycm_errs': '_LightlineYcmErrors', | 422 \ 'ycm_errs': '_LightlineYcmErrors', |
416 \ 'ycm_warns': '_LightlineYcmWarnings', | 423 \ 'ycm_warns': '_LightlineYcmWarnings', |
417 \ 'gutentags': '_LightlineGutentags', | 424 \ 'gutentags': '_LightlineGutentags', |
418 \ }, | 425 \ }, |
419 \'component_type': { | 426 \'component_type': { |
447 | 454 |
448 function! _LightlineGutentags() | 455 function! _LightlineGutentags() |
449 return gutentags#statusline('', '', '♨') | 456 return gutentags#statusline('', '', '♨') |
450 endfunction | 457 endfunction |
451 | 458 |
452 function! _LightlineSyntastic() | 459 if s:HasPlugin('syntastic') |
453 return SyntasticStatuslineFlag() | 460 function! _LightlineLinter() |
454 endfunction | 461 return SyntasticStatuslineFlag() |
462 endfunction | |
463 else | |
464 function! _LightlineLinter() abort | |
465 let l:counts = ale#statusline#Count(bufnr('')) | |
466 | |
467 let l:all_errors = l:counts.error + l:counts.style_error | |
468 let l:all_non_errors = l:counts.total - l:all_errors | |
469 | |
470 return l:counts.total == 0 ? 'OK' : printf( | |
471 \ '%dW %dE', | |
472 \ all_non_errors, | |
473 \ all_errors | |
474 \) | |
475 endfunction | |
476 endif | |
455 | 477 |
456 function! _LightlineYcmErrors() | 478 function! _LightlineYcmErrors() |
457 let l:cnt = youcompleteme#GetErrorCount() | 479 let l:cnt = youcompleteme#GetErrorCount() |
458 return l:cnt > 0 ? string(l:cnt) : '' | 480 return l:cnt > 0 ? string(l:cnt) : '' |
459 endfunction | 481 endfunction |