From 0ed639a11628fc7c31e3eae441d28288d84d604e Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Tue, 31 Oct 2017 13:26:12 +0100 Subject: [PATCH] Put info about lightline-ale in README.md (fixes #1065) --- README.md | 56 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 6e5ef26e..7bdaeeb7 100644 --- a/README.md +++ b/README.md @@ -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).