-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit.lua
More file actions
62 lines (56 loc) · 1.38 KB
/
Copy pathinit.lua
File metadata and controls
62 lines (56 loc) · 1.38 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
54
55
56
57
58
59
60
61
62
-- firstly enable luacache loader
vim.loader.enable()
local config_main = function()
-- then try to load util since it's needed everywhere
local ok, util = pcall(require, "me.util")
-- exit the config early, since the util module *is* required for any of this to work
if not ok then
return
end
-- load the config
local err, issues = util.load_modules {
me = {
"options",
"keymaps",
"autocmds",
"plugins",
config = {
"telescope",
"nvim-treesitter",
"which-key",
"notify",
"nvim-tree",
"nvim-surround",
"nvim-autopairs",
"rainbow-delimiters",
"lualine",
"gitsigns",
"comment",
"alpha",
"blink",
"presence"
},
"lsp",
"colors",
ui = {
"lsp",
},
},
}
-- create an error message if there was an issue with some module
if err then
local issue_string = ""
for _, issue in ipairs(issues) do
issue_string = issue_string .. "'" .. issue .. "', "
end
vim.notify("Modules " .. issue_string .. "were invalid!", vim.log.levels.WARN, {
title = "Woops, there was issue!",
})
end
end
-- run it, in protected mode to catch any and all errors
local ok, _ = pcall(config_main)
if not ok then
print("Something went terribly wrong! Exiting the config!")
vim.cmd([[qa!]])
end