vimrc: wrap PlugInstall in augroup

This commit is contained in:
surtur 2022-09-11 20:09:07 +02:00
parent e1d79a8b6b
commit 31b35a8fb1
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -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()