diff --git a/lua/cosmic/config/plugins.lua b/lua/cosmic/config/plugins.lua index 01ca729..edca5b8 100644 --- a/lua/cosmic/config/plugins.lua +++ b/lua/cosmic/config/plugins.lua @@ -17,4 +17,5 @@ }, } -return plugins ]] +return plugins +]] diff --git a/lua/cosmic/packer.lua b/lua/cosmic/packer.lua index e77bd81..239fc1e 100644 --- a/lua/cosmic/packer.lua +++ b/lua/cosmic/packer.lua @@ -1,9 +1,9 @@ local cmd = vim.cmd -cmd('packadd packer.nvim') - local present, packer = pcall(require, 'packer') +local first_install = false + if not present then local packer_path = vim.fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim' @@ -24,8 +24,7 @@ if not present then if present then print('Packer cloned successfully.') - packer.sync() - packer.compile() + first_install = true else error("Couldn't clone packer !\nPacker path: " .. packer_path .. '\n' .. packer) end @@ -41,9 +40,12 @@ packer.init({ git = { clone_timeout = 800, -- Timeout, in seconds, for git clones }, - compile_path = vim.fn.stdpath('config')..'/lua/cosmic/compiled.lua', + compile_path = vim.fn.stdpath('config') .. '/lua/cosmic/compiled.lua', auto_clean = true, compile_on_sync = true, }) -return packer +return { + packer = packer, + first_install = first_install, +} diff --git a/lua/cosmic/pluginsInit.lua b/lua/cosmic/pluginsInit.lua index 4e4b771..1ae2fbb 100644 --- a/lua/cosmic/pluginsInit.lua +++ b/lua/cosmic/pluginsInit.lua @@ -1,9 +1,10 @@ -local present, packer = pcall(require, 'cosmic.packer') +local present, cosmic_packer = pcall(require, 'cosmic.packer') if not present then return false end +local packer = cosmic_packer.packer local use = packer.use local ok, user_plugins = pcall(require, 'cosmic.config.plugins')