Skip to content

Provide an example of how to install a package / plugin with a post-install hook #55

@ipatch

Description

@ipatch

I've been using minpac for a little bit, and I really enjoy the simplistic nature of it, but the terse example of working with packages in the README.md that require post-install hooks comes across as a little bit confusing to me. 🤷‍♂️ I'm no Vimscript ninja by any means, but I gave it the ol college attempt at trying to understand at what is going on with setting up a package / plugin that requires a post-install hook.

Presently I'm using vim-markdown-composer to preview markdown documents that I edit via Vim and Neovim in my default browser, and vim-markdown-composer requires a working rust toolchain to compile properly. I tried a couple of scenarios to download the vim-markdown-composer package and get it to build all in one step when running PackUpdate but the only solution that I'm presently able to get working is,

call minpac#add('euclio/vim-markdown-composer', {'do': '!cargo build --release'})

Optionally I could not get the below to work

function! s:hook(hooktype, name)
  echom a:hooktype
  echom 'Directory:' minpac#getplugininfo(a:name).dir
  call system('cargo build --release')
endfunction
call minpac#add('euclio/vim-markdown-composer', { 'do': function('s:hook')})

Ideally, in a perfect world, I'd like to call function to update the cargo build of this package, when either the vim package or the rust toolchain is updated which seems to be quite frequent.

The ol have my cake 🎂 and eat it, 🍰 at the same time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions