Implement g:plug_url_format (#62)
This commit is contained in:
parent
3572ffde79
commit
ab3bd3b17c
|
@ -85,11 +85,12 @@ Reload .vimrc and `:PlugInstall` to install plugins.
|
||||||
### Global options
|
### Global options
|
||||||
|
|
||||||
| Flag | Default | Description |
|
| Flag | Default | Description |
|
||||||
| ---------------- | ---------------------- | ------------------------------------ |
|
| ------------------- | --------------------------------- | ------------------------------------ |
|
||||||
| `g:plug_window` | `vertical topleft new` | Command to open plug window |
|
|
||||||
| `g:plug_threads` | 16 | Default number of threads to use |
|
| `g:plug_threads` | 16 | Default number of threads to use |
|
||||||
| `g:plug_timeout` | 60 | Time limit of each task in seconds |
|
| `g:plug_timeout` | 60 | Time limit of each task in seconds |
|
||||||
| `g:plug_retries` | 2 | Number of retries in case of timeout |
|
| `g:plug_retries` | 2 | Number of retries in case of timeout |
|
||||||
|
| `g:plug_window` | `vertical topleft new` | Command to open plug window |
|
||||||
|
| `g:plug_url_format` | 'https://git::@github.com/%s.git' | `printf` format to build repo URL |
|
||||||
|
|
||||||
### Keybindings
|
### Keybindings
|
||||||
|
|
||||||
|
|
3
plug.vim
3
plug.vim
|
@ -379,7 +379,8 @@ function! s:infer_properties(name, repo)
|
||||||
if repo !~ '/'
|
if repo !~ '/'
|
||||||
let repo = 'vim-scripts/'. repo
|
let repo = 'vim-scripts/'. repo
|
||||||
endif
|
endif
|
||||||
let uri = 'https://git::@github.com/' . repo . '.git'
|
let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')
|
||||||
|
let uri = printf(fmt, repo)
|
||||||
endif
|
endif
|
||||||
let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )
|
let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )
|
||||||
return { 'dir': dir, 'uri': uri }
|
return { 'dir': dir, 'uri': uri }
|
||||||
|
|
|
@ -874,11 +874,24 @@ Execute (Open plug window in a new tab):
|
||||||
AssertEqual tabnr, tabpagenr()
|
AssertEqual tabnr, tabpagenr()
|
||||||
q
|
q
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
~ g:plug_url_format
|
||||||
|
**********************************************************************
|
||||||
|
Execute (Using g:plug_url_format):
|
||||||
|
call plug#begin()
|
||||||
|
let g:plug_url_format = 'git@bitbucket.org:%s.git'
|
||||||
|
Plug 'junegunn/seoul256.vim'
|
||||||
|
let g:plug_url_format = 'git@bitsocket.org:%s.git'
|
||||||
|
Plug 'beauty256'
|
||||||
|
AssertEqual 'git@bitbucket.org:junegunn/seoul256.vim.git', g:plugs['seoul256.vim'].uri
|
||||||
|
AssertEqual 'git@bitsocket.org:vim-scripts/beauty256.git', g:plugs['beauty256'].uri
|
||||||
|
|
||||||
Execute (Cleanup):
|
Execute (Cleanup):
|
||||||
silent! call system('rm -rf '.temp_plugged)
|
silent! call system('rm -rf '.temp_plugged)
|
||||||
silent! call rename('fzf', 'fzf-staged')
|
silent! call rename('fzf', 'fzf-staged')
|
||||||
silent! unlet g:plugs
|
silent! unlet g:plugs
|
||||||
silent! unlet g:plug_home
|
silent! unlet g:plug_home
|
||||||
|
silent! unlet g:plug_url_format
|
||||||
silent! unlet temp_plugged vader plug basertp save_rtp repo lnum fzf out tabnr
|
silent! unlet temp_plugged vader plug basertp save_rtp repo lnum fzf out tabnr
|
||||||
silent! delf PlugStatusSorted
|
silent! delf PlugStatusSorted
|
||||||
silent! delf AssertExpect
|
silent! delf AssertExpect
|
||||||
|
|
Loading…
Reference in New Issue
Block a user