mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-24 13:07:36 -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' }
|
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
|
If you need more control, you can pass a reference to a Vim function that
|
||||||
takes a single argument.
|
takes a single argument.
|
||||||
|
|
||||||
|
13
plug.vim
13
plug.vim
@ -723,10 +723,15 @@ function! s:do(pull, force, todo)
|
|||||||
let type = type(spec.do)
|
let type = type(spec.do)
|
||||||
if type == s:TYPE.string
|
if type == s:TYPE.string
|
||||||
try
|
try
|
||||||
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
if spec.do =~? '^:'
|
||||||
" but it won't work on Windows.
|
let g:_plug_do = spec.do[1:]
|
||||||
let g:_plug_do = '!'.escape(spec.do, '#!%')
|
execute g:_plug_do
|
||||||
execute "normal! :execute g:_plug_do\<cr>\<cr>"
|
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
|
finally
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
let error = 'Exit status: ' . v:shell_error
|
let error = 'Exit status: ' . v:shell_error
|
||||||
|
Loading…
Reference in New Issue
Block a user