diff --git a/README.md b/README.md index 7154a34..1cb72bb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/plug.vim b/plug.vim index 9cb02f7..beb51d2 100644 --- a/plug.vim +++ b/plug.vim @@ -723,10 +723,15 @@ function! s:do(pull, force, todo) let type = type(spec.do) if type == s:TYPE.string try - " 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\\" + 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\\" + endif finally if v:shell_error let error = 'Exit status: ' . v:shell_error