diff options
| author | philw <dscr@duck.com> | 2025-03-28 10:50:22 +0100 |
|---|---|---|
| committer | philw <dscr@duck.com> | 2025-03-28 10:50:22 +0100 |
| commit | 25e664d9f2eaa81720e48ad6b90c1f9804032dc9 (patch) | |
| tree | d48ed6fbe30130fa2ec861d66bc8f64bac92ccfc /init.lua | |
| parent | 59d0efed5a8fe6bdcbcd537fe58e8a62511024ba (diff) | |
| download | neovim-25e664d9f2eaa81720e48ad6b90c1f9804032dc9.tar.gz neovim-25e664d9f2eaa81720e48ad6b90c1f9804032dc9.zip | |
Enable colorscheme changes
Diffstat (limited to '')
| -rw-r--r-- | init.lua | 91 |
1 files changed, 53 insertions, 38 deletions
| @@ -118,6 +118,57 @@ local function setup_autopairs() | |||
| 118 | ) | 118 | ) |
| 119 | end | 119 | end |
| 120 | end | 120 | end |
| 121 | function 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 | |||
| 156 | for _, hl in ipairs(highlights) do | ||
| 157 | vim.api.nvim_set_hl(0, hl[1], hl[2]) | ||
| 158 | end | ||
| 159 | |||
| 160 | end | ||
| 161 | |||
| 162 | |||
| 163 | vim.o.background = "dark" | ||
| 164 | function 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 | ||
| 122 | setup_autopairs() | 173 | setup_autopairs() |
| 123 | 174 | ||
| @@ -179,7 +230,6 @@ require("lazy").setup({ | |||
| 179 | }, | 230 | }, |
| 180 | }) | 231 | }) |
| 181 | 232 | ||
| 182 | vim.o.background = "dark" | ||
| 183 | vim.cmd('colorscheme gruvbox') | 233 | vim.cmd('colorscheme gruvbox') |
| 184 | require("colorizer").setup() | 234 | require("colorizer").setup() |
| 185 | 235 | ||
| @@ -221,43 +271,7 @@ for lsp, settings in pairs(lsp_servers) do | |||
| 221 | ) | 271 | ) |
| 222 | end | 272 | end |
| 223 | 273 | ||
| 224 | local highlights = { | 274 | set_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 | |||
| 258 | for _, hl in ipairs(highlights) do | ||
| 259 | vim.api.nvim_set_hl(0, hl[1], hl[2]) | ||
| 260 | end | ||
| 261 | 275 | ||
| 262 | vim.g.mapleader = " " | 276 | vim.g.mapleader = " " |
| 263 | 277 | ||
| @@ -276,3 +290,4 @@ keymap.set("n", "<leader>f", "<cmd>Telescope find_files<cr>") | |||
| 276 | keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>") | 290 | keymap.set("n", "<leader>g", "<cmd>Telescope live_grep<cr>") |
| 277 | keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts) | 291 | keymap.set("n", "<leader>d", vim.lsp.buf.definition, opts) |
| 278 | keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts) | 292 | keymap.set("n", "<leader>k", vim.lsp.buf.hover, opts) |
| 293 | keymap.set('n', '<leader>r', color_mode, {desc = "Change mode light/dark"}) | ||
