From ec88c829d0f1faf0c0371664ed6b67dd914c42cc Mon Sep 17 00:00:00 2001 From: Jannik Zander Date: Sun, 5 Aug 2018 07:03:06 +0200 Subject: [PATCH] Refresh UI --- vimrc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/vimrc b/vimrc index eeda3c9..3154dda 100644 --- a/vimrc +++ b/vimrc @@ -194,6 +194,17 @@ function! s:Iar() endfunction command! -bang -nargs=0 -complete=file Iar call s:Iar() +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 -- 2.43.0