Permalink
Browse files

vim: More statusline tweaks

  • Loading branch information...
1 parent 7d9eb58 commit a05b34fa3aa79a4a1a557b3c7256af9e118dba05 @artnez committed Apr 22, 2017
Showing with 17 additions and 0 deletions.
  1. +10 −0 packages/vim/dot/vim/statuscolor.py
  2. +7 −0 packages/vim/dot/vim/statusline.vim
@@ -0,0 +1,10 @@
+import vim
+
+bufnr = vim.eval('bufnr("%")')
+loclist = vim.eval('getloclist(0)')
+errors = [l for l in loclist if l["lnum"] != "0" and l["bufnr"] == bufnr]
+
+if len(errors) > 0:
+ vim.command('hi StatusLine term=bold,reverse cterm=bold,reverse ctermbg=255 ctermfg=196')
+else:
+ vim.command('hi StatusLine term=bold,reverse cterm=bold,reverse ctermbg=none ctermfg=none')
@@ -7,5 +7,12 @@ function! GetStatusline()
return g:new_statusline
endfunction
+function! UpdateStatuslineColor()
+ pyfile $HOME/.vim/statuscolor.py
+endfunction
+
+autocmd user NeomakeFinished,BufEnter,WinEnter call UpdateStatuslineColor()
+autocmd BufEnter * call UpdateStatuslineColor()
+
set statusline+=%#warningmsg#
set statusline+=%{GetStatusline()}

0 comments on commit a05b34f

Please sign in to comment.