diff options
author | w0rp <w0rp@users.noreply.github.com> | 2017-10-31 13:03:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-31 13:03:02 +0000 |
commit | 3115d2025a3a9ae1492a8d85e01497a8ddd8c60a (patch) | |
tree | 370b5ddc73def05dd2df139f279078c512dd7c3a /README.md | |
parent | 9cd0d75c4f001527d34c0a108bb560ffc352eaf7 (diff) | |
parent | 0ed639a11628fc7c31e3eae441d28288d84d604e (diff) | |
download | ale-3115d2025a3a9ae1492a8d85e01497a8ddd8c60a.zip |
Merge pull request #1068 from maximbaz/patch-1
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> |