k-takata / minpac

A minimal package manager for Vim 8+ (and Neovim)
841 stars 30 forks source link

Installing Javascript plugin #91

Closed Th3Whit3Wolf closed 4 years ago

Th3Whit3Wolf commented 4 years ago

I am trying to install markdown preview nvim

What I've tried

call minpac#add('iamcco/markdown-preview.nvim', {'do': 'cd app & ./install.sh'})
call minpac#add('iamcco/markdown-preview.nvim', {'do': 'cd app & yarn install'})
call minpac#add('iamcco/markdown-preview.nvim', {'dir': '~/app'}, {'do': './install.sh'})
call minpac#add('iamcco/markdown-preview.nvim', {'do': 'app/install.sh'})

It always says it's installed but I keep having to go into start/markdown-preview.nvim/app and run ./install.sh

k-takata commented 4 years ago

The parameter for the 'do' item should be a Vim's Ex command, not an external command. To execute an external command, insert an ! before the command. However, this shows a prompt when the command finishes. To suppress the prompt, you can use silent! So, how about this? {'do': 'silent! !(cd app && ./install.sh)'}

Another way is using system() function: {'do': 'call system("cd app && ./install.sh")'} This doesn't display the output of the external command at all.

Th3Whit3Wolf commented 4 years ago

That works! Thank you so much!!