diff --git a/init.lua b/init.lua
index d06a37fd8505a492ef755d3644bf017b58756737..c4df3b3a102809af9b49899d7c4c9986db0844e1 100644
--- a/init.lua
+++ b/init.lua
@@ -1,7 +1,22 @@
-local packer = require("packer")
+local path_package = vim.fn.stdpath('data') .. '/site/'
+local mini_path = path_package .. 'pack/deps/start/mini.nvim'
+if not vim.loop.fs_stat(mini_path) then
+ vim.cmd('echo "Installing `mini.nvim`" | redraw')
+ local clone_cmd = {
+ 'git', 'clone', '--filter=blob:none',
+ 'https://github.com/echasnovski/mini.nvim', mini_path
+ }
+ vim.fn.system(clone_cmd)
+ vim.cmd('packadd mini.nvim | helptags ALL')
+ vim.cmd('echo "Installed `mini.nvim`" | redraw')
+end
+
+local mini_deps = require('mini.deps')
+local add = mini_deps.add
+
+mini_deps.setup({ path = { package = path_package } })
local pkgs = {
- "wbthomason/packer.nvim", -- packer manager
"folke/trouble.nvim", -- diagnostics
"mfussenegger/nvim-dap", -- add dap support
"leoluz/nvim-dap-go", -- add some utilites to go
@@ -22,13 +37,16 @@ "williamboman/mason.nvim", -- manages many things
"neovim/nvim-lspconfig", -- lsp support
}
-local function startup(use)
- use("nvim-treesitter/nvim-treesitter", {run = ":TSUpdate"})
- use("fatih/vim-go", {run = ":GoUpdateBinaries"})
- for _, value in ipairs(pkgs) do use(value) end
-end
+add({
+ source = "nvim-treesitter/nvim-treesitter",
+ hooks = { post_checkout = function() vim.cmd('TSUpdate') end },
+})
+add({
+ source = "fatih/vim-go",
+ hooks = { post_checkout = function() vim.cmd('GoUpdateBinaries') end },
+})
+for _, value in ipairs(pkgs) do add({source = value}) end
-packer.startup(startup)
local neogit = require("neogit")
local null_ls = require("null-ls")
diff --git a/lua/gabrielgio/init.lua b/lua/gabrielgio/init.lua
index a00b425b70230edd856dd9c652ea16c000051dcb..590aa13e11014aacabb4e0c9262d85090225d498 100644
--- a/lua/gabrielgio/init.lua
+++ b/lua/gabrielgio/init.lua
@@ -1,12 +1,16 @@
-require("gabrielgio.lsp")
-require("gabrielgio.settable")
-require("gabrielgio.mini")
-require("gabrielgio.go")
-require("gabrielgio.telescope")
-require("gabrielgio.treesitter")
-require("gabrielgio.undotree")
-require("gabrielgio.so")
-require("gabrielgio.trouble")
-require("gabrielgio.dap")
-require("gabrielgio.term")
-require("gabrielgio.neovide")
+local mini_deps = require('mini.deps')
+local now, later = mini_deps.now, mini_deps.later
+
+now(function() require("gabrielgio.settable") end)
+now(function() require("gabrielgio.treesitter") end)
+
+later(function() require("gabrielgio.lsp") end)
+later(function() require("gabrielgio.mini") end)
+later(function() require("gabrielgio.go") end)
+later(function() require("gabrielgio.telescope") end)
+later(function() require("gabrielgio.undotree") end)
+later(function() require("gabrielgio.so") end)
+later(function() require("gabrielgio.trouble") end)
+later(function() require("gabrielgio.dap") end)
+later(function() require("gabrielgio.term") end)
+later(function() require("gabrielgio.neovide") end)