mirror of
https://github.com/junegunn/vim-plug.git
synced 2025-12-06 17:14:26 +08:00
Add dir option: managed plugins outside g:plug_home
This commit is contained in:
7
plug.vim
7
plug.vim
@@ -319,8 +319,8 @@ function! s:add(force, repo, ...)
|
||||
return
|
||||
endif
|
||||
|
||||
let spec = extend(a:0 == 1 ? s:parse_options(a:1) : copy(s:base_spec),
|
||||
\ s:infer_properties(name, repo))
|
||||
let spec = extend(s:infer_properties(name, repo),
|
||||
\ a:0 == 1 ? s:parse_options(a:1) : copy(s:base_spec))
|
||||
if !a:force
|
||||
let s:extended[name] = spec
|
||||
endif
|
||||
@@ -342,6 +342,9 @@ function! s:parse_options(arg)
|
||||
if has_key(opts, 'tag')
|
||||
let opts.branch = remove(opts, 'tag')
|
||||
endif
|
||||
if has_key(opts, 'dir')
|
||||
let opts.dir = s:dirpath(expand(opts.dir))
|
||||
endif
|
||||
else
|
||||
throw 'Invalid argument type (expected: string or dictionary)'
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user