diff --git a/lua/pckr/loader.lua b/lua/pckr/loader.lua index ee021f1..bc5fb41 100644 --- a/lua/pckr/loader.lua +++ b/lua/pckr/loader.lua @@ -163,8 +163,10 @@ local function packadd(plugin, bang) return end - if vim.v.vim_did_enter == 0 and bang then + -- Use vim.g.loaded_pckr as a signal for then plugin/* is loaded. + if not vim.g.loaded_pckr and bang then -- Do not source. We've already added to rtp, so no need to do anything. + -- Do not load plugin/* as that will be done by 'loadplugins' later. return end diff --git a/plugin/pckr.lua b/plugin/pckr.lua index f13e5fd..d46b60c 100644 --- a/plugin/pckr.lua +++ b/plugin/pckr.lua @@ -1,3 +1,8 @@ +if not vim.g.loaded_pckr then + return +end + +vim.g.loaded_pckr = true vim.api.nvim_create_user_command( 'Pckr',