Repository: junegunn/vim-plug

Issue #702: Feature request: Add post-loading hook for plugins
Created: 2017-11-07T14:54:31Z
This is a specific case of where such a hook would be useful.
The NERDTree plugin provides an API for advanced usage, such as custom key mappings and menus. When I load the plugin via vim-plug, I'm unable to access these functions for further customisations from within my configuration files.
I think a fix for the issue would be to provide some sort of post-loading hook, analogous to the post-install/upgrade ones that would allow extra code to be executed once the plugin is loaded. This would also allow plugin-specific configuration options to only be run if the plugin is actually loaded.
If adding such a hook is too complex or involves too much of a rewrite, could you suggest some tips as to how I might go about solving this particular use-case?


NVIM v0.2.1-1122-g54b79f19d
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/src/mak epkg/neovim-git/src/neovim-git/build/config -I/src/makepkg/neovim-git/src/neovim-git/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/src/makepkg/neov im-git/src/neovim-git/build/src/nvim/auto -I/src/makepkg/neovim-git/src/neovim-git/build/include

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
     fall-back for $VIM: "/usr/share/nvim"

	 Run :checkhealth for more info



Type:

 Bug
 Enhancement
 Feature Request
 Question


OS:

 All/Other
 Linux
 OS X
 Windows


Vim:

 Terminal Vim
 GVim
 Neovim

Duplicate issue #1066: [help/feature] is there a way to allow load plugin instantly not lazily?
Created: 2021-02-02T08:15:17Z
First thanks a lot for this vim plugin manager!
My problem
My problem is I use a vim plugin and the setting need using functions in autoload directory of that plugin. For now the setting of that plugin must after the statement call plug#end(), like below:
call plug#begin('~/.vim/plugged')
Plug 'user/plugin-name'
call plug#end()

" settings of plugin-name
call plugin-name#...

The expected behavior is enable call autoload function could work after Plug 'user/plugin-name', again like below:
call plug#begin('~/.vim/plugged')
Plug 'user/plugin-name'
" settings of plugin-name
call plugin-name#...

call plug#end()

Why I expect this
This enable you move
Plug 'user/plugin-name'
" settings of plugin-name

to a single file than source it in block of vim-plug.

Type:

 Bug
 Enhancement
 Feature Request
 Question

Closing comment (2021-02-28T13:57:57Z): Duplicate of #702. Please use the standard VimEnter autocmd.
Plug 'user/plugin-name'
autocmd VimEnter * call foo#bar()

Hi @junegunn thanks for reply! And do you mean dein#set_hook({plugins}, {hook-name}, {hook}) which did that as you posted in #702 when use dein?
https://github.com/Shougo/dein.vim/blob/adac91b05ad9ef123d859edfe549ffde236f930c/doc/dein.txt#L407