-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
53 lines (45 loc) · 1.59 KB
/
Copy pathinit.lua
File metadata and controls
53 lines (45 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local package_path = vim.fs.joinpath(vim.fn.stdpath("data"), "/site")
local mini_path = vim.fs.joinpath(package_path, "/pack/deps/start/mini.nvim")
if not vim.uv.fs_stat(mini_path) then
vim.cmd('echo "Installing `mini.nvim`" | redraw')
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
-- Uncomment next line to use 'stable' branch
-- '--branch', 'stable',
"https://github.com/nvim-mini/mini.nvim",
mini_path,
})
vim.cmd("packadd mini.nvim | helptags ALL")
vim.cmd('echo "Installed `mini.nvim`" | redraw')
end
require("mini.deps").setup({
path = { package = package_path },
})
--- A table containing useful helpers for configuring neovim
ANC = {}
--- The path where packages are stored.
ANC.package_path = vim.fs.joinpath(package_path, "/pack/deps/opt")
--- The path where `mini.nvim` is used.
ANC.mini_path = mini_path
--- A custom augroup for grouping custom autocmds.
ANC.augroup = vim.api.nvim_create_augroup("custom-config", { clear = true })
--- Helper for creating autocmds
--- @param event vim.api.keyset.events|vim.api.keyset.events[]
--- @param opts vim.api.keyset.create_autocmd
function ANC.new_autocmd(event, opts)
if opts.group ~= nil then
vim.notify(
[[
You can't set the `group` in this function.
If you want to use a custom augroup, then use `nvim.api.nvim_create_autocmd()`.
]],
vim.log.levels.WARN
)
end
opts.group = ANC.augroup
vim.api.nvim_create_autocmd(event, opts)
end
--- A helper function to load plugins depending on the case if nvim is started with a file path.
ANC.now_or_later = vim.fn.argc(0) > 0 and MiniDeps.now or MiniDeps.later