1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

update vim-plug install logic

This commit is contained in:
jdhao 2020-09-27 19:16:55 +08:00
parent eb7df6b06c
commit 32d69040d6

View File

@ -11,18 +11,17 @@ scriptencoding utf-8
let g:vim_plug_fpath = expand(stdpath('data') . '/autoload/plug.vim')
if g:is_win || g:is_mac
if empty(glob(g:vim_plug_fpath))
if executable('curl')
echomsg 'Installing Vim-plug on your system'
let s:vim_plug_furl = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
silent execute printf('!curl -fLo %s --create-dirs %s', g:vim_plug_fpath, s:vim_plug_furl)
augroup plug_init
autocmd!
autocmd VimEnter * PlugInstall --sync | quit |source $MYVIMRC
augroup END
else
if !executable('curl')
echoerr 'Curl not available on your system, you may install vim-plug by yourself.'
finish
endif
echomsg 'Installing Vim-plug on your system'
let s:vim_plug_furl = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
silent execute printf('!curl -fLo %s --create-dirs %s', g:vim_plug_fpath, s:vim_plug_furl)
augroup plug_init
autocmd!
autocmd VimEnter * PlugInstall --sync | quit |source $MYVIMRC
augroup END
endif
endif