Finally add lint status to neovim status line
I refused for a long time but it is useful for large files and if you are editing existing files.
This commit is contained in:
parent
437f87ba7c
commit
1fd0866d00
|
@ -1,9 +1,23 @@
|
|||
function! AleLinterStatusLine() 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
|
||||
|
||||
set statusline=%h%w "Show modi, help, preview.
|
||||
set statusline+=\ %f "Show file name
|
||||
set statusline+=%= "Switch to right side.
|
||||
set statusline+=%m "Show modification of file
|
||||
set statusline+=%r "Show readonly mode of file
|
||||
set statusline+=%*
|
||||
set statusline+=%{AleLinterStatusLine()}
|
||||
set statusline+=%y "Show filetype
|
||||
set statusline+=[%{&fileencoding?&fileencoding:&encoding}] " Show encoding
|
||||
set statusline+=[%{&ff}] "Show lineendings
|
||||
|
|
Loading…
Reference in a new issue