mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-24 13:07:36 -07:00
Can now load plugins w/o git being installed
If git is not installed, still allow Plug to be called. Also allow the user to ignore the git warning by calling plug#begin() with 2 params. Passing a 1 for a:2 will hide the warning: plug#begin('~/.vim/plugged', 1)
This commit is contained in:
parent
f7ebba7b9e
commit
1eb8bc5575
12
plug.vim
12
plug.vim
@ -93,15 +93,19 @@ function! plug#begin(...)
|
|||||||
return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
|
return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !executable('git')
|
|
||||||
return s:err('`git` executable not found. vim-plug requires git.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
let g:plug_home = home
|
let g:plug_home = home
|
||||||
let g:plugs = {}
|
let g:plugs = {}
|
||||||
" we want to keep track of the order plugins where registered.
|
" we want to keep track of the order plugins where registered.
|
||||||
let g:plugs_order = []
|
let g:plugs_order = []
|
||||||
|
|
||||||
|
if !executable('git')
|
||||||
|
command! -nargs=+ -bar Plug call s:add(<args>)
|
||||||
|
if (a:0 <= 1) || (a:2 == 0)
|
||||||
|
return s:err('`git` executable not found. vim-plug requires git.')
|
||||||
|
endif
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
call s:define_commands()
|
call s:define_commands()
|
||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user