Change post-hook function to take a dictionary for more control

This commit is contained in:
Junegunn Choi
2014-07-27 11:28:53 +09:00
parent e741d02ad0
commit e6a594f1ad
3 changed files with 18 additions and 11 deletions

View File

@@ -129,11 +129,17 @@ In that case, use `do` option to describe the task to be performed.
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
```
If you need more control, you can pass a reference to a Vim function instead.
If you need more control, you can pass a reference to a Vim function that
takes a single argument.
```vim
function! BuildYCM()
" ...
function! BuildYCM(info)
" info is a dictionary with two fields
" - name: name of the plugin
" - status: 'installed' or 'updated'
if a:info.status == 'installed'
!./install.sh
endif
endfunction
Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }