junegunn / junegunn/vim-plug

Load a script file after loaded a plugin

Open
#1,002 0 comments 1 reaction 0 assignees View on GitHub
neovim question
Dominant language
Vim Script
Stars
35.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

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:

```vim
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.