aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2025-03-28 10:50:22 +0100
committerphilw <dscr@duck.com>2025-03-28 10:50:22 +0100
commit25e664d9f2eaa81720e48ad6b90c1f9804032dc9 (patch)
treed48ed6fbe30130fa2ec861d66bc8f64bac92ccfc /init.lua
parent59d0efed5a8fe6bdcbcd537fe58e8a62511024ba (diff)
downloadneovim-25e664d9f2eaa81720e48ad6b90c1f9804032dc9.tar.gz
neovim-25e664d9f2eaa81720e48ad6b90c1f9804032dc9.zip
Enable colorscheme changes
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua91
1 files changed, 53 insertions, 38 deletions
diff --git a/init.lua b/init.lua
index 44564b2..8db2d6f 100644
--- a/init.lua
+++ b/init.lua
@@ -118,6 +118,57 @@ local function setup_autopairs()
118 ) 118 )
119 end 119 end
120end 120end
121function set_highlights()
122 local highlights = {
123 {"GitGutterAdd", {bg = "none"}},
124 {"GitGutterDelete", {bg = "none"}},
125 {"GitGutterChange", {bg = "none"}},
126 {"GitGutterChangeAdd", {bg = "none"}},
127 {"GitGutterChangeDelete", {bg = "none"}},
128 {"NonText", {fg = "none"}},
129 {"EndOfBuffer", {fg = "none", bg = "none"}},
130-- {"Normal", {bg = "none"}},
131 {"SignColumn", {bg = "none"}},
132 {"StatusLine", {bg = "none", fg = "none"}},
133 {"StatusLineNc", {bg = "none", fg = "none"}},
134 {"NvimTreeWinSeparator", {fg = "none"}},
135 {"CursorColumn", {fg = "none"}},
136 {"CursorLine", {bg = "none"}},
137 {"VertSplit", {bg = "none"}},
138 {"DiagnosticError", {bg = "none"}},
139 {"DiagnosticWarn", {bg = "none"}},
140 {"DiagnosticInfo", {bg = "none"}},
141 {"DiagnosticHint", {bg = "none"}},
142 {"Pmenu", {bg = "none"}},
143 {"DiagnosticVirtualTextError", {bg = "none"}},
144 {"DiagnosticVirtualTextWarn", {bg = "none"}},
145 {"DiagnosticVirtualTextInfo", {bg = "none"}},
146 {"DiagnosticVirtualTextHint", {bg = "none"}},
147 {"LspFloatWinNormal", {bg = "none"}},
148 {"NormalFloat", {bg = "none"}},
149 {"LineNr", {bg = "none"}},
150 {"DiagnosticVirtualError", {bg = "none"}},
151 {"DiagnosticVirtualWarn", {bg = "none"}},
152 {"DiagnosticVirtualInfo", {bg = "none"}},
153 {"DiagnosticVirtualHint", {bg = "none"}}
154}
155
156for _, hl in ipairs(highlights) do
157 vim.api.nvim_set_hl(0, hl[1], hl[2])
158 end
159
160end
161
162
163vim.o.background = "dark"
164function color_mode()
165 if vim.o.background == "dark" then
166 vim.o.background = "light"
167 else
168 vim.o.background = "dark"
169 end
170 set_highlights()
171 end
121 172
122setup_autopairs() 173setup_autopairs()
123 174
@@ -179,7 +230,6 @@ require("lazy").setup({
179 }, 230 },
180}) 231})
181 232
182vim.o.background = "dark"
183vim.cmd('colorscheme gruvbox') 233vim.cmd('colorscheme gruvbox')
184require("colorizer").setup() 234require("colorizer").setup()
185 235
@@ -221,43 +271,7 @@ for lsp, settings in pairs(lsp_servers) do
221 ) 271 )
222end 272end
223 273
224local highlights = { 274set_highlights()
225 {"GitGutterAdd", {bg = "none"}},
226 {"GitGutterDelete", {bg = "none"}},
227 {"GitGutterChange", {bg = "none"}},
228 {"GitGutterChangeAdd", {bg = "none"}},
229 {"GitGutterChangeDelete", {bg = "none"}},
230 {"NonText", {fg = "none"}},
231 {"EndOfBuffer", {fg = "none", bg = "none"}},
232-- {"Normal", {bg = "none"}},
233 {"SignColumn", {bg = "none"}},
234 {"StatusLine", {bg = "none", fg = "none"}},
235 {"StatusLineNc", {bg = "none", fg = "none"}},
236 {"NvimTreeWinSeparator", {fg = "none"}},
237 {"CursorColumn", {fg = "none"}},
238 {"CursorLine", {bg = "none"}},
239 {"VertSplit", {bg = "none"}},
240 {"DiagnosticError", {bg = "none"}},
241 {"DiagnosticWarn", {bg = "none"}},
242 {"DiagnosticInfo", {bg = "none"}},
243 {"DiagnosticHint", {bg = "none"}},
244 {"Pmenu", {bg = "none"}},
245 {"DiagnosticVirtualTextError", {bg = "none"}},
246 {"DiagnosticVirtualTextWarn", {bg = "none"}},
247 {"DiagnosticVirtualTextInfo", {bg = "none"}},
248 {"DiagnosticVirtualTextHint", {bg = "none"}},
249 {"LspFloatWinNormal", {bg = "none"}},
250 {"NormalFloat", {bg = "none"}},
251 {"LineNr", {bg = "none"}},
252 {"DiagnosticVirtualError", {bg = "none"}},
253 {"DiagnosticVirtualWarn", {bg = "none"}},
254 {"DiagnosticVirtualInfo", {bg = "none"}},
255 {"DiagnosticVirtualHint", {bg = "none"}}
256}
257
258for _, hl in ipairs(highlights) do
259 vim.api.nvim_set_hl(0, hl[1], hl[2])
260end
261 275
262vim.g.mapleader = " " 276vim.g.mapleader = " "
263 277
@@ -276,3 +290,4 @@ keymap.set("n", "<leader>f", "<cmd>Telescope find_files<cr>")
276keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>") 290keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>")
277keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts) 291keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts)
278keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts) 292keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts)
293keymap.set('n', '<leader>r', color_mode, {desc = "Change mode light/dark"})