diff options
author | Maxim Baz <github@maximbaz.com> | 2017-10-31 13:26:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-31 13:26:12 +0100 |
commit | 0ed639a11628fc7c31e3eae441d28288d84d604e (patch) | |
tree | 7398dad6630e73c78f2cf1acc5a48b69a400e802 /README.md | |
parent | 50f7ad35529e0672e4161e3c74be5cb87196a2f1 (diff) | |
download | ale-0ed639a11628fc7c31e3eae441d28288d84d604e.zip |
Put info about lightline-ale in README.md (fixes #1065)
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 56 |
1 files changed, 2 insertions, 54 deletions
@@ -418,61 +418,9 @@ See `:help ale#statusline#Count()` for more information. ### 5.v. How can I show errors or warnings in my lightline? [lightline](https://github.com/itchyny/lightline.vim) does not have built-in -support for ALE, nevertheless it's easy to do it yourself: +support for ALE, nevertheless there is a plugin that adds this functionality: [maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale). -```vim -" This is regular lightline configuration, we just added -" 'linter_warnings', 'linter_errors' and 'linter_ok' to -" the active right panel. Feel free to move it anywhere. -" `component_expand' and `component_type' are required. -" -" For more info on how this works, see lightline documentation. -let g:lightline = { - \ 'active': { - \ 'right': [ [ 'lineinfo' ], - \ [ 'percent' ], - \ [ 'linter_warnings', 'linter_errors', 'linter_ok' ], - \ [ 'fileformat', 'fileencoding', 'filetype' ] ] - \ }, - \ 'component_expand': { - \ 'linter_warnings': 'LightlineLinterWarnings', - \ 'linter_errors': 'LightlineLinterErrors', - \ 'linter_ok': 'LightlineLinterOK' - \ }, - \ 'component_type': { - \ 'linter_warnings': 'warning', - \ 'linter_errors': 'error', - \ 'linter_ok': 'ok' - \ }, - \ } - -autocmd User ALELint call lightline#update() - -" ale + lightline -function! LightlineLinterWarnings() 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 ? '' : printf('%d --', all_non_errors) -endfunction - -function! LightlineLinterErrors() 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 ? '' : printf('%d >>', all_errors) -endfunction - -function! LightlineLinterOK() 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 ? '✓' : '' -endfunction -``` - -See `:help ale#statusline#Count()` and [lightline documentation](https://github.com/itchyny/lightline.vim#advanced-configuration) -for more information. +For more information, check out the sources of that plugin, `:help ale#statusline#Count()` and [lightline documentation](https://github.com/itchyny/lightline.vim#advanced-configuration). <a name="faq-echo-format"></a> |