From 1eb8bc55757122eabe4cdd47281f6db86d6cf320 Mon Sep 17 00:00:00 2001 From: Miles Whittaker Date: Sun, 10 Aug 2014 11:50:01 -0400 Subject: [PATCH] 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) --- plug.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plug.vim b/plug.vim index e94d7f3..4f6d60c 100644 --- a/plug.vim +++ b/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.') endif - if !executable('git') - return s:err('`git` executable not found. vim-plug requires git.') - endif - let g:plug_home = home let g:plugs = {} " we want to keep track of the order plugins where registered. let g:plugs_order = [] + if !executable('git') + command! -nargs=+ -bar Plug call s:add() + 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() return 1 endfunction