Run plug#end before checking g:plugs. https://github.com/junegunn/vim-plug/issues/1039

Jan Edmund Lazo 2020-12-01 18:59:46 -05:00
parent ea2ad17b06
commit 5cadf12035

@ -31,8 +31,15 @@ if empty(glob('~/.vim/autoload/plug.vim'))
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif endif
call plug#begin()
if exists('g:loaded_plug')
// Uncommment the following line to install documentation
// Plug 'junegunn/vim-plug'
call plug#end()
endif
" Run PlugInstall if there are missing plugins " Run PlugInstall if there are missing plugins
if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) if exists('g:plugs') && len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif endif
``` ```