Vundle.vim: Post action triggers (hook system?)

Created on 10 Apr 2017  路  5Comments  路  Source: VundleVim/Vundle.vim

Hi everyone,

I assume this feature has been mentioned/requested before but I couldn't find anything specific under wiki/FAQ/vimhelp/issues.

There are quite a few plugins out there that require manual intervention after cloning. Occasionally these actions differ between new installs and updates.
On the other hand these actions are not consistent across plugins so one may need to run a custom build script or a more standard make, cmake, ...

Is there any support for this in Vundle?

What I had in mind was something along the lines of:

Plugin 'just/plugit', {'oninstall': './setup.sh && make', 'onupdate': 'make'}

where oninstall would be triggered during :PluginInstall and 'onupdate' during :PluginUpdate.

Most helpful comment

Just wanted to see if any progress has been made on this issue in the last two years. This would be a very useful feature for installing and updating YouCompleteMe.

All 5 comments

And maybe also allow to specify a funcref instead of external commands.
Something in the lines of:

Plugin 'just/plugit', { 'oninstall': './setup.sh && make', 'onupdate': function('DoSomethingAfterUpdate') }

@ryanoasis Should we considerate this as blocked by #619 ?

@vimishor Hey! Really sorry for the super relate reply.

Yeah I think we are considering a LOT of non-trivial changes blocked by at least having some minimal testing in place. Trying to stay true to the desire/request of gmarik

Just wanted to see if any progress has been made on this issue in the last two years. This would be a very useful feature for installing and updating YouCompleteMe.

@dabelknap No but I have some interest in looking into some testing...

Hi all, I have just created this feature. It is still very basic, but I would like to share and get some feedback before creating pull request.

Install Guide

Replace Vundle.vim folder. (need to delete existing)

git clone --branch post-install-hook https://github.com/farhanmustar/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Inside .vimrc need to apply following changes.

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
-Plugin 'VundleVim/Vundle.vim'
+Plugin 'farhanmustar/Vundle.vim'

Example

Install 'iamcco/markdown-preview.nvim' plugin if yarn available in shell.
Then add hook script to yarn install inside app directory.

if executable('yarn')
  Plugin 'iamcco/markdown-preview.nvim', { 'oninstall': '!cd app && yarn install', 'onupdate': '!cd app && yarn install' }
endif
Was this page helpful?
0 / 5 - 0 ratings

Related issues

thetutlage picture thetutlage  路  7Comments

binarykitchen picture binarykitchen  路  3Comments

albertz picture albertz  路  8Comments

sheerun picture sheerun  路  4Comments

neil-s picture neil-s  路  5Comments