commit c912ad5091190c7ebeee3861ca2657e7b48a5add parent 2d788b38437b17b30f82aa9a34fa0094e10e791a Author: Alex Balgavy <alex@balgavy.eu> Date: Sun, 17 Jul 2022 14:53:57 +0200 vim: improve vimtex statusline indicator Now also shows status of compilation. Diffstat:
M | vim/autoload/statusline.vim | | | 19 | +++++++++++++++++-- |
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/vim/autoload/statusline.vim b/vim/autoload/statusline.vim @@ -111,8 +111,23 @@ function! statusline#StatuslineWordCount() endfunction function! statusline#StatuslineVimtexCompiler() - if exists('b:vimtex') && b:vimtex->has_key('compiler') && b:vimtex['compiler']['is_running']() - return '⚙︎ {'.(fnamemodify(b:vimtex['tex'], ":p:.")).'}' + " From vimtex documentation: + let VIMTEX_SUCCESS = 2 + let VIMTEX_FAIL = 3 + + if exists('b:vimtex') && b:vimtex->has_key('compiler') + let l:str = "" + if b:vimtex['compiler']['continuous'] + let l:str ..= "🔄 " + endif + + if b:vimtex['compiler']['status'] ==# VIMTEX_SUCCESS + return l:str..'✅ {'.(fnamemodify(b:vimtex['tex'], ":p:.")).'}' + elseif b:vimtex['compiler']['status'] ==# VIMTEX_FAIL + return l:str..'❌ {'.(fnamemodify(b:vimtex['tex'], ":p:.")).'}' + elseif b:vimtex['compiler']['is_running']() + return l:str..'🔨 {'.(fnamemodify(b:vimtex['tex'], ":p:.")).'}' + endif endif return '' endfunction