Allow custom repo-to-name modifier

Use case: remove the ':t' from the modifier, call plug#begin with '~/src/github.com' and keep the repos in a `go get` / `ghq` style workspace.
This commit is contained in:
Greg V 2015-05-04 17:09:05 +03:00
parent 18313fa43e
commit a8d309f210

View File

@ -424,7 +424,7 @@ function! s:add(repo, ...)
try
let repo = s:trim(a:repo)
let name = fnamemodify(repo, ':t:s?\.git$??')
let name = fnamemodify(repo, get(g:, 'plug_name_modifier', ':t:s?\.git$??'))
let spec = extend(s:infer_properties(name, repo),
\ a:0 == 1 ? s:parse_options(a:1) : s:base_spec)
if !has_key(g:plugs, name)