Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ceb9caa09 | ||
|
|
42a42e7e71 | ||
|
|
8885b1086f | ||
|
|
90c07f269c | ||
|
|
f1c5157e35 | ||
|
|
7f1ec7b12b | ||
|
|
f90afc9081 | ||
|
|
612b9b3afd | ||
|
|
58891e05be | ||
|
|
baf7b18f73 | ||
|
|
cc37ed48be | ||
|
|
afe7dc6f8f | ||
|
|
8863a3a53c | ||
|
|
ee04a646d3 |
12
.travis.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
language: vim
|
||||||
|
|
||||||
|
before_script: |
|
||||||
|
hg clone https://code.google.com/p/vim/
|
||||||
|
cd vim
|
||||||
|
./configure --with-features=huge --enable-rubyinterp
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
cd -
|
||||||
|
|
||||||
|
script: |
|
||||||
|
test/run !
|
||||||
@@ -1,11 +1,12 @@
|
|||||||

|

|
||||||
|

|
||||||
|
|
||||||
A single-file Vim plugin manager.
|
A single-file Vim plugin manager.
|
||||||
|
|
||||||
Somewhere between [Pathogen](https://github.com/tpope/vim-pathogen) and
|
Somewhere between [Pathogen](https://github.com/tpope/vim-pathogen) and
|
||||||
[Vundle](https://github.com/gmarik/vundle), but with faster parallel installer.
|
[Vundle](https://github.com/gmarik/vundle), but with faster parallel installer.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Pros.
|
### Pros.
|
||||||
|
|
||||||
|
|||||||
BIN
gif/Plugfile.gif
|
Before Width: | Height: | Size: 528 KiB |
BIN
gif/parallel.gif
|
Before Width: | Height: | Size: 306 KiB |
BIN
gif/pi.gif
|
Before Width: | Height: | Size: 922 KiB |
BIN
gif/pu.gif
|
Before Width: | Height: | Size: 247 KiB |
BIN
gif/serial.gif
|
Before Width: | Height: | Size: 650 KiB |
BIN
gif/si.gif
|
Before Width: | Height: | Size: 1.1 MiB |
BIN
gif/su.gif
|
Before Width: | Height: | Size: 521 KiB |
BIN
gif/vim-plug.gif
|
Before Width: | Height: | Size: 2.3 MiB |
102
plug.vim
@@ -141,16 +141,17 @@ function! plug#end()
|
|||||||
for cmd in commands
|
for cmd in commands
|
||||||
if cmd =~ '^<Plug>.\+'
|
if cmd =~ '^<Plug>.\+'
|
||||||
if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i'))
|
if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i'))
|
||||||
for [mode, prefix] in [['i', "<C-O>"], ['', '']]
|
for [mode, map_prefix, key_prefix] in
|
||||||
|
\ [['i', "<C-O>", ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
||||||
execute printf(
|
execute printf(
|
||||||
\ "%snoremap <silent> %s %s:call <SID>lod_map(%s, %s)<CR>",
|
\ "%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, '%s')<CR>",
|
||||||
\ mode, cmd, prefix, string(cmd), string(plug))
|
\ mode, cmd, map_prefix, string(cmd), string(name), key_prefix)
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
elseif !exists(':'.cmd)
|
elseif !exists(':'.cmd)
|
||||||
execute printf(
|
execute printf(
|
||||||
\ "command! -nargs=* -range -bang %s call s:lod_cmd(%s, '<bang>', <line1>, <line2>, <q-args>, %s)",
|
\ "command! -nargs=* -range -bang %s call s:lod_cmd(%s, '<bang>', <line1>, <line2>, <q-args>, %s)",
|
||||||
\ cmd, string(cmd), string(plug))
|
\ cmd, string(cmd), string(name))
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
@@ -178,13 +179,32 @@ function! plug#end()
|
|||||||
syntax on
|
syntax on
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:rtp(spec)
|
if s:is_win
|
||||||
let rtp = s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
|
function! s:rtp(spec)
|
||||||
if s:is_win
|
let rtp = s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
|
||||||
let rtp = substitute(rtp, '\\*$', '', '')
|
return substitute(rtp, '\\*$', '', '')
|
||||||
endif
|
endfunction
|
||||||
return rtp
|
|
||||||
endfunction
|
function! s:path(path)
|
||||||
|
return substitute(substitute(a:path, '/', '\', 'g'), '[/\\]*$', '', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:dirpath(path)
|
||||||
|
return s:path(a:path) . '\'
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! s:rtp(spec)
|
||||||
|
return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:path(path)
|
||||||
|
return substitute(a:path, '[/\\]*$', '', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:dirpath(path)
|
||||||
|
return s:path(a:path) . '/'
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
function! s:esc(path)
|
function! s:esc(path)
|
||||||
return substitute(a:path, ' ', '\\ ', 'g')
|
return substitute(a:path, ' ', '\\ ', 'g')
|
||||||
@@ -192,8 +212,9 @@ endfunction
|
|||||||
|
|
||||||
function! s:add_rtp(rtp)
|
function! s:add_rtp(rtp)
|
||||||
execute "set rtp^=".s:esc(a:rtp)
|
execute "set rtp^=".s:esc(a:rtp)
|
||||||
if isdirectory(a:rtp.'after')
|
let after = globpath(a:rtp, 'after')
|
||||||
execute "set rtp+=".s:esc(a:rtp.'after')
|
if isdirectory(after)
|
||||||
|
execute "set rtp+=".s:esc(after)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -212,19 +233,19 @@ function! s:lod_ft(pat, names)
|
|||||||
call s:lod(g:plugs[name], ['plugin', 'after'])
|
call s:lod(g:plugs[name], ['plugin', 'after'])
|
||||||
endfor
|
endfor
|
||||||
execute 'autocmd! PlugLOD FileType ' . a:pat
|
execute 'autocmd! PlugLOD FileType ' . a:pat
|
||||||
let &l:filetype = &l:filetype
|
silent! doautocmd filetypeplugin FileType
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:lod_cmd(cmd, bang, l1, l2, args, plug)
|
function! s:lod_cmd(cmd, bang, l1, l2, args, name)
|
||||||
execute 'delc '.a:cmd
|
execute 'delc '.a:cmd
|
||||||
call s:lod(a:plug, ['plugin', 'ftdetect', 'after'])
|
call s:lod(g:plugs[a:name], ['plugin', 'ftdetect', 'after'])
|
||||||
execute printf("%s%s%s %s", (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
execute printf("%s%s%s %s", (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:lod_map(map, plug)
|
function! s:lod_map(map, name, prefix)
|
||||||
execute 'unmap '.a:map
|
execute 'unmap '.a:map
|
||||||
execute 'iunmap '.a:map
|
execute 'iunmap '.a:map
|
||||||
call s:lod(a:plug, ['plugin', 'ftdetect', 'after'])
|
call s:lod(g:plugs[a:name], ['plugin', 'ftdetect', 'after'])
|
||||||
let extra = ''
|
let extra = ''
|
||||||
while 1
|
while 1
|
||||||
let c = getchar(0)
|
let c = getchar(0)
|
||||||
@@ -233,7 +254,7 @@ function! s:lod_map(map, plug)
|
|||||||
endif
|
endif
|
||||||
let extra .= nr2char(c)
|
let extra .= nr2char(c)
|
||||||
endwhile
|
endwhile
|
||||||
call feedkeys(substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
|
call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:add(...)
|
function! s:add(...)
|
||||||
@@ -256,6 +277,9 @@ function! s:add(...)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let name = substitute(split(plugin, '/')[-1], '\.git$', '', '')
|
||||||
|
if !force && has_key(g:plugs, name) | return | endif
|
||||||
|
|
||||||
if plugin =~ ':'
|
if plugin =~ ':'
|
||||||
let uri = plugin
|
let uri = plugin
|
||||||
else
|
else
|
||||||
@@ -265,9 +289,6 @@ function! s:add(...)
|
|||||||
let uri = 'https://git:@github.com/' . plugin . '.git'
|
let uri = 'https://git:@github.com/' . plugin . '.git'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let name = substitute(split(plugin, '/')[-1], '\.git$', '', '')
|
|
||||||
if !force && has_key(g:plugs, name) | return | endif
|
|
||||||
|
|
||||||
let dir = s:dirpath( fnamemodify(join([g:plug_home, name], '/'), ':p') )
|
let dir = s:dirpath( fnamemodify(join([g:plug_home, name], '/'), ':p') )
|
||||||
let spec = extend(opts, { 'dir': dir, 'uri': uri })
|
let spec = extend(opts, { 'dir': dir, 'uri': uri })
|
||||||
let g:plugs[name] = spec
|
let g:plugs[name] = spec
|
||||||
@@ -406,11 +427,15 @@ function! s:update_impl(pull, args) abort
|
|||||||
normal! 2G
|
normal! 2G
|
||||||
redraw
|
redraw
|
||||||
|
|
||||||
|
let len = len(g:plugs)
|
||||||
if has('ruby') && threads > 1
|
if has('ruby') && threads > 1
|
||||||
call s:update_parallel(a:pull, todo, threads)
|
call s:update_parallel(a:pull, todo, threads)
|
||||||
else
|
else
|
||||||
call s:update_serial(a:pull, todo)
|
call s:update_serial(a:pull, todo)
|
||||||
endif
|
endif
|
||||||
|
if len(g:plugs) > len
|
||||||
|
call plug#end()
|
||||||
|
endif
|
||||||
call s:finish(a:pull)
|
call s:finish(a:pull)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -419,7 +444,7 @@ function! s:extend(names)
|
|||||||
try
|
try
|
||||||
command! -nargs=+ Plug call s:add(0, <args>)
|
command! -nargs=+ Plug call s:add(0, <args>)
|
||||||
for name in a:names
|
for name in a:names
|
||||||
let plugfile = s:rtp(g:plugs[name]) . s:plug_file
|
let plugfile = globpath(s:rtp(g:plugs[name]), s:plug_file)
|
||||||
if filereadable(plugfile)
|
if filereadable(plugfile)
|
||||||
execute "source ". s:esc(plugfile)
|
execute "source ". s:esc(plugfile)
|
||||||
endif
|
endif
|
||||||
@@ -642,20 +667,6 @@ function! s:update_parallel(pull, todo, threads)
|
|||||||
EOF
|
EOF
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:path(path)
|
|
||||||
return substitute(s:is_win ? substitute(a:path, '/', '\', 'g') : a:path,
|
|
||||||
\ '[/\\]*$', '', '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:dirpath(path)
|
|
||||||
let path = s:path(a:path)
|
|
||||||
if s:is_win
|
|
||||||
return path !~ '\\$' ? path.'\' : path
|
|
||||||
else
|
|
||||||
return path !~ '/$' ? path.'/' : path
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:shellesc(arg)
|
function! s:shellesc(arg)
|
||||||
return '"'.substitute(a:arg, '"', '\\"', 'g').'"'
|
return '"'.substitute(a:arg, '"', '\\"', 'g').'"'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -687,6 +698,11 @@ function! s:system(cmd)
|
|||||||
return system(s:is_win ? '('.a:cmd.')' : a:cmd)
|
return system(s:is_win ? '('.a:cmd.')' : a:cmd)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:system_chomp(str)
|
||||||
|
let ret = s:system(a:str)
|
||||||
|
return v:shell_error ? '' : substitute(ret, '\n$', '', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:git_valid(spec, check_branch, cd)
|
function! s:git_valid(spec, check_branch, cd)
|
||||||
let ret = 1
|
let ret = 1
|
||||||
let msg = 'OK'
|
let msg = 'OK'
|
||||||
@@ -694,7 +710,7 @@ function! s:git_valid(spec, check_branch, cd)
|
|||||||
if a:cd | execute "cd " . s:esc(a:spec.dir) | endif
|
if a:cd | execute "cd " . s:esc(a:spec.dir) | endif
|
||||||
let result = split(s:system("git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url"), '\n')
|
let result = split(s:system("git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url"), '\n')
|
||||||
let remote = result[-1]
|
let remote = result[-1]
|
||||||
if v:shell_error != 0
|
if v:shell_error
|
||||||
let msg = join([remote, "PlugClean required."], "\n")
|
let msg = join([remote, "PlugClean required."], "\n")
|
||||||
let ret = 0
|
let ret = 0
|
||||||
elseif !s:compare_git_uri(remote, a:spec.uri)
|
elseif !s:compare_git_uri(remote, a:spec.uri)
|
||||||
@@ -704,9 +720,13 @@ function! s:git_valid(spec, check_branch, cd)
|
|||||||
let ret = 0
|
let ret = 0
|
||||||
elseif a:check_branch
|
elseif a:check_branch
|
||||||
let branch = result[0]
|
let branch = result[0]
|
||||||
if a:spec.branch != branch
|
if a:spec.branch !=# branch
|
||||||
let msg = 'Invalid branch: '.branch.'. Try PlugUpdate.'
|
let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1')
|
||||||
let ret = 0
|
if a:spec.branch !=# tag
|
||||||
|
let msg = printf('Invalid branch/tag: %s (expected: %s). Try PlugUpdate.',
|
||||||
|
\ (empty(tag) ? branch : tag), a:spec.branch)
|
||||||
|
let ret = 0
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if a:cd | cd - | endif
|
if a:cd | cd - | endif
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ Test cases for vim-plug
|
|||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
|
||||||
```vim
|
```
|
||||||
:e workflow.vader | Vader
|
./run
|
||||||
|
|
||||||
|
./run !
|
||||||
```
|
```
|
||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
@@ -18,7 +20,6 @@ Test cases for the following features are currently missing:
|
|||||||
- Output formatting
|
- Output formatting
|
||||||
- Timeout or interrupt cleaning up git processes
|
- Timeout or interrupt cleaning up git processes
|
||||||
- User prompt in PlugClean command
|
- User prompt in PlugClean command
|
||||||
- Automatic dependency resolution using Plugfile
|
|
||||||
- Single-threaded installer
|
- Single-threaded installer
|
||||||
- Windows support
|
- Windows support
|
||||||
|
|
||||||
|
|||||||
21
test/run
@@ -5,15 +5,18 @@ cd ..
|
|||||||
PLUG_SRC=$(pwd)/plug.vim
|
PLUG_SRC=$(pwd)/plug.vim
|
||||||
cd - > /dev/null
|
cd - > /dev/null
|
||||||
|
|
||||||
export VADER_RTP=$TMPDIR/vader-rtp
|
if [ ! -d vader.vim ]; then
|
||||||
vim -e +Vader -c ':call writefile([fnamemodify(globpath(&rtp, "autoload/vader.vim"), ":h:h")], $VADER_RTP)' +q
|
git clone https://github.com/junegunn/vader.vim.git
|
||||||
|
fi
|
||||||
|
|
||||||
MINI_VIMRC=$TMPDIR/mini-vimrc
|
cat > /tmp/mini-vimrc << VIMRC
|
||||||
cat > $MINI_VIMRC << EOF
|
set rtp+=vader.vim
|
||||||
let \$MYVIMRC = '$MINI_VIMRC'
|
|
||||||
set nocompatible
|
|
||||||
set rtp=$(cat $VADER_RTP)
|
|
||||||
source $PLUG_SRC
|
source $PLUG_SRC
|
||||||
EOF
|
VIMRC
|
||||||
|
|
||||||
|
if [ "$1" = '!' ]; then
|
||||||
|
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'Vader! workflow.vader' > /dev/null
|
||||||
|
else
|
||||||
|
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'Vader workflow.vader'
|
||||||
|
fi
|
||||||
|
|
||||||
vim -u $MINI_VIMRC +Vader*
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Execute (Initialize test environment):
|
Execute (Initialize test environment):
|
||||||
Save &rtp, g:plug_home, $MYVIMRC
|
Save &rtp, g:plugs, g:plug_home, $MYVIMRC
|
||||||
|
|
||||||
let vader = fnamemodify(globpath(&rtp, 'autoload/vader.vim'), ':h:h')
|
let vader = fnamemodify(globpath(&rtp, 'autoload/vader.vim'), ':h:h')
|
||||||
let plug = fnamemodify(globpath(&rtp, 'autoload/plug.vim'), ':h:h')
|
let plug = fnamemodify(globpath(&rtp, 'autoload/plug.vim'), ':h:h')
|
||||||
@@ -15,6 +15,15 @@ Execute (Initialize test environment):
|
|||||||
colo default
|
colo default
|
||||||
pclose
|
pclose
|
||||||
|
|
||||||
|
function! PlugStatusSorted()
|
||||||
|
PlugStatus
|
||||||
|
%y
|
||||||
|
q
|
||||||
|
normal! P
|
||||||
|
%sort
|
||||||
|
g/^$/d
|
||||||
|
endfunction
|
||||||
|
|
||||||
let g:vimrc_reloaded = 0
|
let g:vimrc_reloaded = 0
|
||||||
let vimrc = tempname()
|
let vimrc = tempname()
|
||||||
call writefile(['let g:vimrc_reloaded += 1'], vimrc)
|
call writefile(['let g:vimrc_reloaded += 1'], vimrc)
|
||||||
@@ -64,9 +73,15 @@ Execute (Test Plug command):
|
|||||||
AssertEqual join([temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
|
AssertEqual join([temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
|
||||||
AssertEqual 'no-t_co', g:plugs['seoul256.vim'].branch
|
AssertEqual 'no-t_co', g:plugs['seoul256.vim'].branch
|
||||||
|
|
||||||
|
" Git repo with tag
|
||||||
|
Plug 'junegunn/goyo.vim', '1.5.3'
|
||||||
|
AssertEqual 'https://git:@github.com/junegunn/goyo.vim.git', g:plugs['goyo.vim'].uri
|
||||||
|
AssertEqual join([temp_plugged, 'goyo.vim/'], '/'), g:plugs['goyo.vim'].dir
|
||||||
|
AssertEqual '1.5.3', g:plugs['goyo.vim'].branch
|
||||||
|
|
||||||
" Git URI
|
" Git URI
|
||||||
Plug 'git@github.com:junegunn/vim-emoji.git'
|
Plug 'https://bitbucket.org/junegunn/vim-emoji.git'
|
||||||
AssertEqual 'git@github.com:junegunn/vim-emoji.git', g:plugs['vim-emoji'].uri
|
AssertEqual 'https://bitbucket.org/junegunn/vim-emoji.git', g:plugs['vim-emoji'].uri
|
||||||
AssertEqual 'master', g:plugs['vim-emoji'].branch
|
AssertEqual 'master', g:plugs['vim-emoji'].branch
|
||||||
AssertEqual join([temp_plugged, 'vim-emoji/'], '/'), g:plugs['vim-emoji'].dir
|
AssertEqual join([temp_plugged, 'vim-emoji/'], '/'), g:plugs['vim-emoji'].dir
|
||||||
|
|
||||||
@@ -75,18 +90,20 @@ Execute (Test Plug command):
|
|||||||
AssertEqual 'https://git:@github.com/vim-scripts/beauty256.git', g:plugs.beauty256.uri
|
AssertEqual 'https://git:@github.com/vim-scripts/beauty256.git', g:plugs.beauty256.uri
|
||||||
AssertEqual 'master', g:plugs.beauty256.branch
|
AssertEqual 'master', g:plugs.beauty256.branch
|
||||||
|
|
||||||
AssertEqual 3, len(g:plugs)
|
AssertEqual 4, len(g:plugs)
|
||||||
|
|
||||||
Execute (Plug command with dictionary option):
|
Execute (Plug command with dictionary option):
|
||||||
|
Log string(g:plugs)
|
||||||
Plug 'junegunn/seoul256.vim', { 'branch': 'no-t_co', 'rtp': '././' }
|
Plug 'junegunn/seoul256.vim', { 'branch': 'no-t_co', 'rtp': '././' }
|
||||||
AssertEqual join([temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
|
AssertEqual join([temp_plugged, 'seoul256.vim/'], '/'), g:plugs['seoul256.vim'].dir
|
||||||
AssertEqual '././', g:plugs['seoul256.vim'].rtp
|
AssertEqual '././', g:plugs['seoul256.vim'].rtp
|
||||||
|
|
||||||
AssertEqual 3, len(g:plugs)
|
Log string(g:plugs)
|
||||||
|
AssertEqual 4, len(g:plugs)
|
||||||
|
|
||||||
Execute (PlugStatus before installation):
|
Execute (PlugStatus before installation):
|
||||||
PlugStatus
|
PlugStatus
|
||||||
AssertEqual 3, len(filter(getline(1, line('$')), 'v:val =~ "Not found"'))
|
AssertEqual 4, len(filter(getline(1, line('$')), 'v:val =~ "Not found"'))
|
||||||
q
|
q
|
||||||
|
|
||||||
Execute (PlugClean before installation):
|
Execute (PlugClean before installation):
|
||||||
@@ -116,25 +133,44 @@ Execute (PlugClean after installation):
|
|||||||
|
|
||||||
Execute (PlugStatus after installation):
|
Execute (PlugStatus after installation):
|
||||||
PlugStatus
|
PlugStatus
|
||||||
AssertEqual 3, len(filter(getline(1, line('$')), 'v:val =~ "OK"'))
|
AssertEqual 4, len(filter(getline(1, line('$')), 'v:val =~ "OK"'))
|
||||||
q
|
q
|
||||||
|
|
||||||
|
Execute (Change tag of goyo.vim):
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'junegunn/goyo.vim'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
Execute (PlugStatus):
|
||||||
|
call PlugStatusSorted()
|
||||||
|
|
||||||
|
Expect:
|
||||||
|
Invalid branch/tag: 1.5.3 (expected: master). Try PlugUpdate.
|
||||||
|
Finished. 1 error(s).
|
||||||
|
[=]
|
||||||
|
x goyo.vim:
|
||||||
|
|
||||||
|
Execute (PlugUpdate to set the right branch):
|
||||||
|
PlugUpdate
|
||||||
|
call PlugStatusSorted()
|
||||||
|
AssertEqual 2, g:vimrc_reloaded
|
||||||
|
|
||||||
|
Expect:
|
||||||
|
- goyo.vim: OK
|
||||||
|
Finished. 0 error(s).
|
||||||
|
[=]
|
||||||
|
|
||||||
Execute (Change branch of seoul256.vim):
|
Execute (Change branch of seoul256.vim):
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn/seoul256.vim'
|
Plug 'junegunn/seoul256.vim'
|
||||||
Plug 'git@github.com:junegunn/vim-emoji.git'
|
Plug 'https://bitbucket.org/junegunn/vim-emoji.git'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
Execute (PlugStatus):
|
Execute (PlugStatus):
|
||||||
PlugStatus
|
call PlugStatusSorted()
|
||||||
%y
|
|
||||||
q
|
|
||||||
normal! P
|
|
||||||
%sort
|
|
||||||
g/^$/d
|
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
Invalid branch: no-t_co. Try PlugUpdate.
|
Invalid branch/tag: no-t_co (expected: master). Try PlugUpdate.
|
||||||
- vim-emoji: OK
|
- vim-emoji: OK
|
||||||
Finished. 1 error(s).
|
Finished. 1 error(s).
|
||||||
[==]
|
[==]
|
||||||
@@ -143,16 +179,11 @@ Expect:
|
|||||||
Execute (Change URI of seoul256.vim):
|
Execute (Change URI of seoul256.vim):
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn.choi/seoul256.vim'
|
Plug 'junegunn.choi/seoul256.vim'
|
||||||
Plug 'git@github.com:junegunn/vim-emoji.git'
|
Plug 'https://bitbucket.org/junegunn/vim-emoji.git'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
Execute (PlugStatus):
|
Execute (PlugStatus):
|
||||||
PlugStatus
|
call PlugStatusSorted()
|
||||||
%y
|
|
||||||
q
|
|
||||||
normal! P
|
|
||||||
%sort
|
|
||||||
g/^$/d
|
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
Expected: https://git:@github.com/junegunn.choi/seoul256.vim.git
|
Expected: https://git:@github.com/junegunn.choi/seoul256.vim.git
|
||||||
@@ -172,6 +203,8 @@ Expect:
|
|||||||
|
|
||||||
Execute (PlugClean! to remove seoul256.vim):
|
Execute (PlugClean! to remove seoul256.vim):
|
||||||
PlugClean!
|
PlugClean!
|
||||||
|
" Three removed, emoji left
|
||||||
|
AssertEqual 3, len(filter(getline(1, line('$')), 'v:val =~ "^- "'))
|
||||||
AssertEqual 1, len(filter(getline(1, line('$')), 'v:val =~ "Removed"'))
|
AssertEqual 1, len(filter(getline(1, line('$')), 'v:val =~ "Removed"'))
|
||||||
Assert empty(globpath(&rtp, 'colors/seoul256.vim'))
|
Assert empty(globpath(&rtp, 'colors/seoul256.vim'))
|
||||||
Assert !empty(globpath(&rtp, 'autoload/emoji.vim'))
|
Assert !empty(globpath(&rtp, 'autoload/emoji.vim'))
|
||||||
@@ -184,16 +217,11 @@ Execute (Change GIT URI of vim-emoji):
|
|||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
Execute (PlugStatus):
|
Execute (PlugStatus):
|
||||||
PlugStatus
|
call PlugStatusSorted()
|
||||||
%y
|
|
||||||
q
|
|
||||||
normal! P
|
|
||||||
%sort
|
|
||||||
g/^$/d
|
|
||||||
|
|
||||||
Expect:
|
Expect:
|
||||||
Expected: https://git:@github.com/junegunn/vim-emoji.git
|
Expected: https://git:@github.com/junegunn/vim-emoji.git
|
||||||
Invalid URI: git@github.com:junegunn/vim-emoji.git
|
Invalid URI: https://bitbucket.org/junegunn/vim-emoji.git
|
||||||
Not found. Try PlugInstall.
|
Not found. Try PlugInstall.
|
||||||
PlugClean required.
|
PlugClean required.
|
||||||
Finished. 2 error(s).
|
Finished. 2 error(s).
|
||||||
@@ -203,6 +231,7 @@ Expect:
|
|||||||
|
|
||||||
Execute (PlugClean! to remove vim-emoji):
|
Execute (PlugClean! to remove vim-emoji):
|
||||||
PlugClean!
|
PlugClean!
|
||||||
|
AssertEqual 1, len(filter(getline(1, line('$')), 'v:val =~ "^- "'))
|
||||||
AssertEqual 1, len(filter(getline(1, line('$')), 'v:val =~ "Removed"'))
|
AssertEqual 1, len(filter(getline(1, line('$')), 'v:val =~ "Removed"'))
|
||||||
Assert empty(globpath(&rtp, 'colors/seoul256.vim'))
|
Assert empty(globpath(&rtp, 'colors/seoul256.vim'))
|
||||||
Assert empty(globpath(&rtp, 'autoload/emoji.vim'))
|
Assert empty(globpath(&rtp, 'autoload/emoji.vim'))
|
||||||
@@ -211,7 +240,7 @@ Execute (PlugClean! to remove vim-emoji):
|
|||||||
Execute (PlugUpdate to install both again):
|
Execute (PlugUpdate to install both again):
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
AssertEqual 2, len(filter(getline(1, line('$')), 'v:val =~ "Cloning into"'))
|
AssertEqual 2, len(filter(getline(1, line('$')), 'v:val =~ "Cloning into"'))
|
||||||
AssertEqual 2, g:vimrc_reloaded
|
AssertEqual 3, g:vimrc_reloaded
|
||||||
Assert !empty(globpath(&rtp, 'colors/seoul256.vim')), 'seoul256.vim should be found'
|
Assert !empty(globpath(&rtp, 'colors/seoul256.vim')), 'seoul256.vim should be found'
|
||||||
Assert !empty(globpath(&rtp, 'autoload/emoji.vim')), 'vim-emoji should be found'
|
Assert !empty(globpath(&rtp, 'autoload/emoji.vim')), 'vim-emoji should be found'
|
||||||
q
|
q
|
||||||
@@ -219,7 +248,7 @@ Execute (PlugUpdate to install both again):
|
|||||||
Execute (PlugUpdate only to find out plugins are up-to-date, D key to check):
|
Execute (PlugUpdate only to find out plugins are up-to-date, D key to check):
|
||||||
PlugUpdate
|
PlugUpdate
|
||||||
AssertEqual 2, len(filter(getline(1, line('$')), 'v:val =~ "Already up-to-date"'))
|
AssertEqual 2, len(filter(getline(1, line('$')), 'v:val =~ "Already up-to-date"'))
|
||||||
AssertEqual 3, g:vimrc_reloaded
|
AssertEqual 4, g:vimrc_reloaded
|
||||||
normal D
|
normal D
|
||||||
AssertEqual 'No updates.', getline(1)
|
AssertEqual 'No updates.', getline(1)
|
||||||
q
|
q
|
||||||
@@ -328,11 +357,7 @@ Execute (Partial PlugInstall):
|
|||||||
PlugInstall vim-fnr vim-easy-align 1
|
PlugInstall vim-fnr vim-easy-align 1
|
||||||
q
|
q
|
||||||
|
|
||||||
Execute (TODO Check dependent plugin):
|
Execute (Check dependent plugin):
|
||||||
^ It is a known issue that when a dependent plugin is installed, it is not
|
|
||||||
^ immediately added to runtimepath. It only becomes available when
|
|
||||||
^ plug#end() is called.
|
|
||||||
|
|
||||||
Assert &rtp =~ 'pseudocl', &rtp
|
Assert &rtp =~ 'pseudocl', &rtp
|
||||||
|
|
||||||
Given (Unaligned code):
|
Given (Unaligned code):
|
||||||
@@ -366,6 +391,6 @@ Execute (Cleanup):
|
|||||||
unlet g:plug_home
|
unlet g:plug_home
|
||||||
unlet g:vimrc_reloaded
|
unlet g:vimrc_reloaded
|
||||||
unlet temp_plugged vader plug basertp save_rtp repo lnum
|
unlet temp_plugged vader plug basertp save_rtp repo lnum
|
||||||
|
delf PlugStatusSorted
|
||||||
|
|
||||||
Restore
|
Restore
|
||||||
source $MYVIMRC
|
|
||||||
|
|||||||