Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post action triggers (hook system?) #804

Open
unode opened this issue Apr 9, 2017 · 5 comments
Open

Post action triggers (hook system?) #804

unode opened this issue Apr 9, 2017 · 5 comments

Comments

@unode
Copy link

unode commented Apr 9, 2017

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.

@vimishor
Copy link

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 ?

@ryanoasis
Copy link
Member

@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

@dabelknap
Copy link

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.

@ryanoasis
Copy link
Member

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

@farhanmustar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants