mydotfiles/nvim/lua/minideps-init.lua

44 lines
1.3 KiB
Lua

-- Config file for mini.deps
-- Set up paths for cloning (concat nvim 'data' with /site/)
local path_package = vim.fn.stdpath('data') .. '/site/'
local mini_path = path_package .. 'pack/deps/start/mini.deps'
--- Uncomment to check what the fuck is going on with paths
--vim.print(path_package)
--vim.print(mini_path)
--print(vim.inspect(vim.api.nvim_list_runtime_paths()))
if not vim.loop.fs_stat(mini_path) then
vim.cmd('redraw')
local userinput = vim.fn.input("`mini.deps` was not found, install? [y/n]", "n")
if userinput == "y" or userinput == "Y" then
vim.cmd('echo "Installing `mini.deps`" | redraw')
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/echasnovski/mini.deps",
mini_path,
})
vim.cmd('packadd mini.deps | helptags ALL')
vim.cmd('echo "`mini.deps` has been installed :3" | redraw')
else
vim.cmd('echo "`mini.deps` will not be installed this session." | redraw')
end
end
-- Load mini.deps
require('mini.deps').setup({ path = { package = path_package } })
vim.print("mini.deps loaded")
vim.cmd('redraw')
-- Load plugins and confis from pack.d folder
vim.cmd('runtime! lua/pack.d/**/*.{lua}')
-- Use 'mini.deps'. `now()` and `later()` helpers can be used for a safe two-stage
-- startup (optional).
--local add, now, later = MiniDeps.add, MiniDeps.now, MiniDeps.later