mirror of
https://github.com/junegunn/vim-plug.git
synced 2025-12-06 17:14:26 +08:00
Change post-hook function to take a dictionary for more control
This commit is contained in:
12
README.md
12
README.md
@@ -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') }
|
||||
|
||||
Reference in New Issue
Block a user