vim-plug icon indicating copy to clipboard operation
vim-plug copied to clipboard

Load a script file after loaded a plugin

Open fgheng opened this issue 4 years ago • 0 comments

Hello, I wrote config script files for each plugin and I loaded these scripts all after call plug#end(), but sometimes a plugin would not be loaded in the whole editing time, so it's not necessary to load this plugin's config script.

So, now, I want to load a plugin's config script after this plugin load rather than load all plugin's scripts, what I do now is liking below:

call plut#begin...
Plug "plug_a"
...
Plug "plug_b", {'on': 'start_b'}

for [plug_name, spec] in items(g:plugs):
   execute ‘autocmd! User ' . plug_name ' source ' . '/path/to/config/of/custom_plug_script.vim'
endfor
call plug#end()

there's a problem, no script is loaded, no matter plug_a without condition on and for or plug_b with on and for, no custom script about them are loaded.



  • Type:
    • [ ] Bug
    • [ ] Enhancement
    • [ ] Feature Request
    • [X] Question
  • OS:
    • [ ] All/Other
    • [x] Linux
    • [ ] OS X
    • [ ] Windows
  • Vim:
    • [ ] Terminal Vim
    • [ ] GVim
    • [X] Neovim

fgheng avatar Aug 02 '20 15:08 fgheng