]> git.zndr.dk Git - vimfiles.git/commitdiff
Refresh UI
authorJannik Zander <jaz@jaza.me>
Sun, 5 Aug 2018 05:03:06 +0000 (07:03 +0200)
committerJannik Zander <jaz@jaza.me>
Sun, 5 Aug 2018 05:03:06 +0000 (07:03 +0200)
vimrc

diff --git a/vimrc b/vimrc
index eeda3c9927b1e0bc311a838716145feba800f7ad..3154ddaa4ac618e274e961deeb7523bafc2b638d 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -194,6 +194,17 @@ function! s:Iar()
 endfunction
 command! -bang -nargs=0 -complete=file Iar call s:Iar(<f-args>)
 
+function! RefreshUI()
+  if exists(':AirlineRefresh')
+    AirlineRefresh
+  else
+    " Clear & redraw the screen, then redraw all statuslines.
+    redraw!
+    redrawstatus!
+  endif
+endfunction
+
+
 " Autocommands
 if has('autocmd')
   augroup expandtabs
@@ -227,15 +238,15 @@ if has('autocmd')
 
   augroup vimrc
   autocmd!
-  autocmd bufwritepost ~/.vim/gvimrc      silent source %
-  autocmd bufwritepost ~/.vim/vimrc       silent source %
-  autocmd bufwritepost ~/.vim/vimrc.local silent source %
+  autocmd BufWritePost ~/.vim/vimrc       source $MYVIMRC | :call RefreshUI()
+  autocmd BufWritePost ~/.vim/gvimrc      source $MYVIMRC | :call RefreshUI()
+  autocmd BufWritePost ~/.vim/vimrc.local source $MYVIMRC | :call RefreshUI()
   augroup end
 
   augroup quickfix
-"    autocmd QuickFixCmdPost [^l]* nested cwindow
-"    autocmd QuickFixCmdPost l*    nested lwindow 
-    autocmd QuickFixCmdPost * call asyncrun#quickfix_toggle(8, 1)
+"  autocmd QuickFixCmdPost [^l]* nested cwindow
+"  autocmd QuickFixCmdPost l*    nested lwindow 
+  autocmd QuickFixCmdPost * call asyncrun#quickfix_toggle(8, 1)
   augroup end
 endif