@@ -32,6 +32,13 @@ function! s:pack_open_dir(name) abort
32
32
exe ' edit' dir
33
33
endfunction
34
34
35
+ function ! s: pack_reinstall (name) abort
36
+ let canonical_name = substitute (a: name , ' \(^\s*\|\s*$\)' , ' ' , ' g' )
37
+ let dir = minpac#getpluginfo (canonical_name).dir
38
+ call delete (dir , ' rf' )
39
+ call minpac#update (a: name )
40
+ endfunction
41
+
35
42
function ! s: pre_cmds () abort
36
43
" tiny wrapper for :packadd
37
44
" good thing is use :PackAdd! to ignore any errors and do not terminate,
@@ -54,14 +61,22 @@ function! s:pre_cmds() abort
54
61
\ call aceforeverd#plugin#init () | call <SID> pack_open_dir (<q-args> )
55
62
56
63
command ! -nargs =1 -complete =custom ,PackList PackOpenUrl
57
- \ call plugin_browse#open_uri (minpac#getpluginfo (substitute (<q-args> , ' \(^\s*\|\s*$\)' , ' ' , ' g' )).url)
64
+ \ call aceforeverd#plugin#init () | call aceforeverd#keymap#browse#open_uri (minpac#getpluginfo (substitute (<q-args> , ' \(^\s*\|\s*$\)' , ' ' , ' g' )).url)
65
+
66
+ command ! -nargs =1 -complete =custom ,PackList PackReinstall
67
+ \ call aceforeverd#plugin#init () | call <sid> pack_reinstall (<q-args> )
58
68
endfunction
59
69
60
70
function ! s: plugin_add (... ) abort
61
71
call call (' minpac#add' , a: 000 )
62
72
endfunction
63
73
64
74
function ! aceforeverd#plugin#init () abort
75
+ if get (g: , ' initialized_minpac' , 0 ) != 0
76
+ return
77
+ endif
78
+ let g: initialized_minpac = 1
79
+
65
80
if has (' nvim' )
66
81
let s: pack_path = stdpath (' data' ) . ' /site/'
67
82
else
0 commit comments