commit 00c71f20f3dd8483118a7efaddadf0b4b858f432
parent 8d1e0543843aecf4279a50e5142966ad5fc2483e
Author: Alex Balgavy <alex@balgavy.eu>
Date: Fri, 29 Jul 2022 20:13:32 +0200
vim: add ALE to statusline
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/vim/autoload/statusline.vim b/vim/autoload/statusline.vim
@@ -132,6 +132,19 @@ function! statusline#StatuslineVimtexCompiler()
return ''
endfunction
+" Naive implementation, should improve with stuff from :h ale
+function! statusline#StatuslineAle()
+ if !exists('g:loaded_ale')
+ return ''
+ endif
+
+ if g:ale_enabled
+ return '[linting]'
+ else
+ return ''
+ endif
+endfunction
+
function! statusline#StatuslineRemoteFile()
if exists('b:netrw_lastfile')
return ' ('.b:netrw_lastfile.')'
diff --git a/vim/plugin/statusline.vim b/vim/plugin/statusline.vim
@@ -24,6 +24,7 @@ set statusline+=\ %{statusline#StatuslineBuildCwd()}\ " Current
set statusline+=%#statuslinefile# " Highlight same as filename
set statusline+=%(\ %{&spell?'📖\ ':''}%) " Show spellcheck status
set statusline+=%(\ %{statusline#StatuslineVimtexCompiler()}%) " Vimtex compiler status
+set statusline+=%(\ %{statusline#StatuslineAle()}%) " ALE status
set statusline+=%(\ %y\ \|%) " File type
set statusline+=\ %{&expandtab?'⤻':'⥅'}\ " Using spaces or tabs
set statusline+=%{statusline#StatuslineSpacesUsed()} " Spaces in a tab