-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
66 lines (52 loc) · 1.88 KB
/
init.lua
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
63
64
65
66
--
--[[
💓 thank you kicksart, lunarvim, lazyvim! 💓
]]
-- TODO: remove this when plugins patched the deprecated vim.api
-- vim.tbl_add_reverse_lookup = function(tbl)
-- for k, v in pairs(tbl) do
-- tbl[v] = k
-- end
-- end
-- [[ Set runtime path for shims if using mise ]]
-- vim.env.PATH = vim.env.HOME .. '/.local/share/mise/shims:' .. vim.env.PATH
-- improve startup time, experimental
vim.loader.enable()
-- TODO: improve startup, check :StartupTime and :autocmd, nvim --startuptime
-- possible culprits: overseer, wakatime, dap, session-manager, alpha, vm-start, indent-blankline, crates
-- reduce plugins, use VeryLazy for plugins that are not used often
-- [[ Initialize global variables and user defined settings before everything else ]]
require('user.config')
-- [[ Settings ]]
require('user.options')
-- [[ Basic Keymaps ]]
require('user.keymaps')
-- [[ Install `lazy.nvim` plugin manager ]]
require('user.lazy-bootstrap')
--[[ if using VSCODE Neovim extension,
load only what you want
(the vscode extension sets the global var vim.g.vscode) ]]
--
if vim.g.vscode then
-- [[ VSCODE Neovim extension ]] load only what you want
require('user.vscode')
else
-- [[ Configure and install plugins ]]
-- TODO: this takes 88% of startup time
require('user.lazy-plugins')
-- [[ autocommands ]]
require('user.auto-commands')
--[[ theme settings
outside of vscode, after plugins
set them on the individual theme setup inside _G global obj
so as to have intellisense of whats available ]]
-- don't change here, change _G in globals.lua under
-- _G.user.background = 'dark' or 'light'
vim.opt.background = _G.user.background
-- change in globals.lua under _G.user.theme = _G.user.themes.<theme>
-- Set here: G.user.themes.<theme>
vim.cmd.colorscheme(_G.user.theme())
end
if vim.g.neovide then
require('user.neovide')
end