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

Does autocmd User works for lazy loaded plugins only?

Open ikalnytskyi opened this issue 3 years ago • 1 comments

There's a line in the docs that shows how to hook plugin loading events with autocommands

Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
autocmd! User goyo.vim echom 'Goyo is now loaded!'

Do I understand correctly that this only works for plugins with for or on options (i.e. lazy loaded plugins)? I can't make things to work with something like this

Plug 'junegunn/goyo.vim'
autocmd! User goyo.vim echom 'Goyo is now loaded!'

NVIM v0.5.0-dev+1186-g8665a96b9
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-pro
totypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_L
EVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neo
vim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az67-513

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

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

ikalnytskyi avatar Apr 14 '21 11:04 ikalnytskyi

It looks like it... and at least based on my config, it looks like it wasn't always so (can't tell)

I find that triggering the autocmd to set up plugin configuration is really useful/helpful - so I'm hoping if there was a way to do this always (for all plugins)?

raghur avatar May 29 '21 11:05 raghur

I moved away from vim-plug, I'm no longer interested in the answer.

ikalnytskyi avatar Jan 17 '23 21:01 ikalnytskyi