vimvim-pluginredrawvim-airline

Why :redraw! not take effect in augroup?


I use Vim-Airline plug in Vim, but statuline incomplete display after source .vimrc, so I want use :redraw! in augroup but it not take effect.

augroup Vim
autocmd!
autocmd BufWritePost $MYVIMRC ++nested source $MYVIMRC ":redraw!"
augroup End

I can only exec :redraw! in command line. How to improve my code?


Solution

  • I am not sure where those quotes around :redraw! come from or what you expect them to do since " introduces a comment.

    In Vim, you use a "bar", |, to separate Ex commands like :source and :redraw:

    augroup Vim
        autocmd!
        autocmd BufWritePost $MYVIMRC ++nested source $MYVIMRC | redraw!
    augroup END
    

    See :help :bar.