mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-20 02:56:10 -07:00
support do vim command
This commit is contained in:
parent
a4e2c064f0
commit
f2fb27c109
@ -198,6 +198,13 @@ Plug 'Shougo/vimproc.vim', { 'do': 'make' }
|
||||
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
|
||||
```
|
||||
|
||||
If you need to execute Vim's command, you can pass the command name with a
|
||||
leading `:`.
|
||||
|
||||
```
|
||||
Plug 'Shougo/deoplete.nvim', {'do':':UpdateRemotePlugins'}
|
||||
```
|
||||
|
||||
If you need more control, you can pass a reference to a Vim function that
|
||||
takes a single argument.
|
||||
|
||||
|
5
plug.vim
5
plug.vim
@ -723,10 +723,15 @@ function! s:do(pull, force, todo)
|
||||
let type = type(spec.do)
|
||||
if type == s:TYPE.string
|
||||
try
|
||||
if spec.do =~? '^:'
|
||||
let g:_plug_do = spec.do[1:]
|
||||
execute g:_plug_do
|
||||
else
|
||||
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
||||
" but it won't work on Windows.
|
||||
let g:_plug_do = '!'.escape(spec.do, '#!%')
|
||||
execute "normal! :execute g:_plug_do\<cr>\<cr>"
|
||||
endif
|
||||
finally
|
||||
if v:shell_error
|
||||
let error = 'Exit status: ' . v:shell_error
|
||||
|
Loading…
Reference in New Issue
Block a user