From 2bd0f083ca5a1d2ef6e595fe175d3e36031376b6 Mon Sep 17 00:00:00 2001 From: Samer Atiani Date: Thu, 11 Oct 2018 07:04:03 +0000 Subject: [PATCH] Implement ability to override git clone options for a particular plugin --- doc/plug.txt | 1 + plug.vim | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/plug.txt b/doc/plug.txt index 6a5c602..70a07ec 100644 --- a/doc/plug.txt +++ b/doc/plug.txt @@ -216,6 +216,7 @@ Reload .vimrc and `:PlugInstall` to install plugins. `on` | On-demand loading: Commands or -mappings `for` | On-demand loading: File types `frozen` | Do not update unless explicitly specified + `clone_opt` | Override git cloning options for the plugin ------------------------+----------------------------------------------- diff --git a/plug.vim b/plug.vim index db1f615..55f4625 100644 --- a/plug.vim +++ b/plug.vim @@ -1337,6 +1337,8 @@ while 1 " Without TCO, Vim stack is bound to explode redraw let has_tag = has_key(spec, 'tag') + let has_clone_opt = has_key(spec, 'clone_opt') + let clone_opt = has_clone_opt ? spec.clone_opt : s:clone_opt if !new let [error, _] = s:git_validate(spec, 0) if empty(error) @@ -1352,7 +1354,7 @@ while 1 " Without TCO, Vim stack is bound to explode else call s:spawn(name, \ printf('git clone %s %s %s %s 2>&1', - \ has_tag ? '' : s:clone_opt, + \ has_tag ? '' : clone_opt, \ prog, \ s:shellesc(spec.uri), \ s:shellesc(s:trim(spec.dir))), { 'new': 1 })