diff options
-rw-r--r-- | init.lua | 34 | ||||
-rw-r--r-- | lua/gabrielgio/init.lua | 28 |
2 files changed, 42 insertions, 20 deletions
@@ -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 @@ local pkgs = { "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 a00b425..590aa13 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) |