junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.7k stars 1.9k forks source link

Running multiple commands in after update hook #1265

Closed FalcoGer closed 5 months ago

FalcoGer commented 5 months ago

I wish to run multiple commands in the after update hook. However nothing I do seems to work.

I tried

" Fails to launch vim, syntax error
Plug 'nvim-neorg/neorg', { 'do': ':Neorg sync-parsers | help neorg-breaking-changes' }

" Fails command when hook is called, "too many arguments"
Plug 'nvim-neorg/neorg', { 'do': ':Neorg sync-parsers \| help neorg-breaking-changes' }

" doesn't load plugin
Plug 'nvim-neorg/neorg', { 'do': [':Neorg sync-parsers', 'help neorg-breaking-changes'] }

How do I do it?


NVIM v0.10.0-dev-5e4a5f1aa
Build type: RelWithDebInfo
LuaJIT 2.1.1707061634
Run ":verbose version" for more info
junegunn commented 5 months ago

This should work.

function! NeorgHook()
  Neorg sync-parser
  help neorg-breaking-changes
endfunction

Plug 'nvim-neorg/neorg', { 'do': { -> NeorgHook() } }
junegunn commented 5 months ago

Escaping | should normally work. But it looks like Neorg command is defined without -bar option (see :help command-bar), so the bar and the rest are recognized as extra arguments.