-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
48 lines (41 loc) · 1.22 KB
/
init.lua
File metadata and controls
48 lines (41 loc) · 1.22 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
-- Check Neovim version requirement
if vim.fn.has("nvim-0.12") == 0 then
vim.api.nvim_echo({ { "This configuration requires Neovim 0.12 or later" } }, true, { err = true })
vim.cmd("cquit") -- Exit with error code
end
require("config.options")
require("config.lazy")
require("config.diagnostics")
require("config.quickfix")
require("config.lsp")
require("config.keymaps")
require("config.autocmds")
require("config.session")
require("config.neovide")
vim.api.nvim_create_autocmd("VimEnter", {
once = true,
callback = function()
local ok, loader = pcall(require, "utils.loader")
if ok then
loader.bootstrap()
end
end,
})
local utils = require("utils")
local preferred = utils.load_colorscheme()
local fallback = "kanagawa-tora"
local ok, err = pcall(vim.cmd.colorscheme, preferred)
if not ok then
local message = string.format("Colorscheme '%s' failed: %s", preferred, err)
vim.schedule(function()
vim.notify(message, vim.log.levels.WARN)
end)
if preferred ~= fallback then
local fallback_ok, fallback_err = pcall(vim.cmd.colorscheme, fallback)
if not fallback_ok then
vim.schedule(function()
vim.notify("Failed to load fallback colorscheme: " .. tostring(fallback_err), vim.log.levels.ERROR)
end)
end
end
end