-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.lua
More file actions
143 lines (121 loc) ยท 5.66 KB
/
init.lua
File metadata and controls
143 lines (121 loc) ยท 5.66 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
-- โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ --
-- โ โโโโ โโโ โโโโโ โโโ โ --
-- โ โโโโ โโโ โโโโโ โโโ โ --
-- โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ --
require("set")
require("remap")
require("custom_functions")
require("auto_commands")
require("hit_font")
require("cmp_gitcommit")
require("killswitch") -- for conditionally disabling plugins
--==========================[ @LAZY.NVIM_BOOTSTRAP]==========================--
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
local opts = {
ui = {
size = { width = 0.8, height = 0.8 },
border = "rounded",
backdrop = 100,
},
change_detection = {
enabled = true,
notify = false,
},
performance = {
rtp = {
---@type string[]
paths = {}, -- custom paths to includes in the rtp
disabled_plugins = {
"gzip", -- Allows Neovim to read and write gzip compressed files.
-- "matchit", -- Enhances the `%` command to jump between {[()]}
-- "matchparen", -- Highlights matching {[()]}
"netrwPlugin", -- File explorer (:Sex, :Vex, :Ex).
"tarPlugin", -- Adds support for handling tar archives.
"tohtml", -- Converts a buffer or a part of a buffer to HTML format.
"tutor", -- Interactive tutorial for learning basic Neovim commands.
"zipPlugin", -- Adds support for handling zip archives.
},
},
},
}
require("lazy").setup("plugins", opts)
--=======================[ @AFTER LAZY LOAD SETTINGS ]=======================--
function Load_dynamic_colors()
-- Clear cache
package.loaded['lualine.themes.catppuccin'] = nil
local customcat = require 'lualine.themes.catppuccin'
-- Problem: Ugly white separators due to lualine transparency handling bug. Source: lua/catppuccin/utils/lualine.lua > catppuccin.inactive.a.bg = 'NONE'
customcat.inactive.a.bg = '#242428'
-- Transparent background for center
customcat.normal.c.bg = 'NONE'
local ok, colors = pcall(require, 'colors/colors')
if ok and colors.primary then
package.loaded['colors/colors'] = nil
-- โโโ โโโ โโโ โโโ โ โโโโ โโโ โโโ โ --
-- โโโ โโโ โโโ โโโ โ โโโโ โโโ โโโ โ --
-- ================================== --
customcat.normal.a.bg = colors.primary
customcat.normal.a.fg = colors.on_primary
customcat.normal.b.fg = colors.secondary
customcat.normal.b.bg = colors.on_secondary
-- Terminal Mode
customcat.terminal.a.bg = colors.primary
customcat.terminal.a.fg = colors.on_primary
customcat.terminal.b.fg = colors.secondary
customcat.terminal.b.bg = colors.on_secondary
-- Others
customcat.inactive.a.fg = colors.secondary
customcat.inactive.a.bg = colors.surface_container_highest
-- Transparent Tabline Fix
-- Whenever a refresh with SIGUSR1 takes place, lualine fills a weird bg
-- color in tabline only. Pinpointed the hex to this specific highlight.
-- 'lualine_transitional_lualine_z_buffers_inactive_to_TabLineFill'
-- But lualine keeps overriding the highlight.
-- โโโโ โโโ โโโ โโโ โ โโโโโ โโโ โ --
-- โโโโ โโโ โโโ โโโ โ โโโโโ โโโ โ --
-- ================================ --
-- Colour Line
vim.api.nvim_set_hl(0, "CursorLine", { bg = colors.surface_bright })
vim.api.nvim_set_hl(0, "CursorLineNr", { fg = colors.primary, bold = true })
vim.api.nvim_set_hl(0, "LineNr", { fg = colors.outline })
-- Floating Window + Sidebar
local LITE_FLOAT, DARK_FLOAT = colors.secondary, colors.surface_container_high
vim.api.nvim_set_hl(0, "NormalFloat", { bg = DARK_FLOAT })
vim.api.nvim_set_hl(0, "FloatBorder", { fg = LITE_FLOAT, bg = DARK_FLOAT, nocombine = true })
vim.api.nvim_set_hl(0, "FloatTitle", { fg = LITE_FLOAT, bg = DARK_FLOAT })
-- Completion Popup Menu
local LITE_CMP, DARK_CMP = colors.primary, nil
vim.api.nvim_set_hl(0, "Pmenu", { fg = LITE_CMP, bg = DARK_CMP })
vim.api.nvim_set_hl(0, "PmenuBorder", { fg = LITE_CMP, bg = DARK_CMP })
vim.api.nvim_set_hl(0, "PmenuSel", { fg = colors.on_primary, bg = colors.primary, bold = true })
-- Treesitter
local DARK_TS = colors.on_secondary
vim.api.nvim_set_hl(0, "TreesitterContext", { bg = DARK_TS })
vim.api.nvim_set_hl(0, "TreesitterContextLineNumber", { bg = DARK_TS })
end
require 'lualine'.setup { options = { theme = customcat } }
end
Load_dynamic_colors()
-- HOT RELOAD ON SIGUSR1
vim.api.nvim_create_autocmd("Signal", {
pattern = "SIGUSR1",
callback = function()
vim.schedule(function()
Load_dynamic_colors()
end)
end
})