diff --git a/.vim/vimrc b/.vim/vimrc index a9978b4..2b697ee 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -10,10 +10,13 @@ if empty(glob('~/.vim/autoload/plug.vim')) autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif -" Run PlugInstall if there are missing plugins -autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - \| PlugInstall --sync | source $MYVIMRC - \| endif +augroup plug_auto_install + autocmd! + " Run PlugInstall if there are missing plugins + autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | source $MYVIMRC + \| endif +augroup END " both "filetype indent on" and "syntax on" are called by Plug, keeping DRY call plug#begin()