From d89eb0292c34aa92c92bdd8937218fd7a66e3cc7 Mon Sep 17 00:00:00 2001 From: Rene Descartes Date: Mon, 28 Nov 2022 11:32:39 -0700 Subject: [PATCH] Support plugin lazy-loading. --- plugin/gutentags.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/gutentags.vim b/plugin/gutentags.vim index 63be66b..d2ebffb 100644 --- a/plugin/gutentags.vim +++ b/plugin/gutentags.vim @@ -98,11 +98,16 @@ let g:__gutentags_vim_is_leaving = 0 augroup gutentags_detect autocmd! autocmd BufNewFile,BufReadPost * call gutentags#setup_gutentags() - autocmd VimEnter * if expand('')==''|call gutentags#setup_gutentags()|endif + autocmd VimEnter * call gutentags#setup_gutentags() autocmd VimLeavePre * call gutentags#on_vim_leave_pre() autocmd VimLeave * call gutentags#on_vim_leave() augroup end +" If vim-gutentags lazy-loaded: +if v:vim_did_enter + call gutentags#setup_gutentags() +endif + " }}} " Toggles and Miscellaneous Commands {{{