commit - cef09940687ecc77a9c0305dd2a3af1d87586274
commit + 5d3d0ac348c196a854e7c7d7679337dfcde994b4
blob - b4246dfa520d278702a5d58622d8732f74b46f09
blob + d6d5aae26fa65b3a573eef756f2d75213b148345
--- lua/colors.lua
+++ lua/colors.lua
-vim.opt.termguicolors = true
+_G.apply_theme = function(mode)
+ vim.opt.termguicolors = true
+ vim.cmd('syntax off')
-vim.api.nvim_set_hl(0, "Normal", { fg = "#c6c6c6", bg = "#090909" })
-vim.cmd('syntax off')
+ local c = {}
+ if mode == "light" then
+ c = {
+ bg = "#ffffff",
+ fg = "#222222",
+ visual = "#cccccc",
+ match = "#777777",
+ search_bg = "#aaaaaa",
+ search_fg = "#ffffff",
+ inc_search = "#222222"
+ }
+ else
+ c = {
+ bg = "#1c1c1c",
+ fg = "#d4d4d4",
+ visual = "#696969",
+ match = "#808080",
+ search_bg = "#808080",
+ search_fg = "#090909",
+ inc_search = "#c6c6c6"
+ }
+ end
-vim.api.nvim_set_hl(0, "TelescopeMatching", { fg = "#808080" })
-vim.api.nvim_set_hl(0, "Visual", { bg = "#696969" })
-vim.api.nvim_set_hl(0, "Comment", { fg = "#c6c6c6" })
+ vim.api.nvim_set_hl(0, "Normal", { fg = c.fg, bg = c.bg })
+ vim.api.nvim_set_hl(0, "TelescopeMatching", { fg = c.match })
+ vim.api.nvim_set_hl(0, "Visual", { bg = c.visual })
+ vim.api.nvim_set_hl(0, "Comment", { fg = c.fg })
-vim.api.nvim_set_hl(0, "Search", { fg = "#090909", bg = "#808080" })
-vim.api.nvim_set_hl(0, "IncSearch", { fg = "#090909", bg = "#c6c6c6" })
-vim.api.nvim_set_hl(0, "CurSearch", { fg = "#090909", bg = "#c6c6c6" })
+ vim.api.nvim_set_hl(0, "Search", { fg = c.search_fg, bg = c.search_bg })
+ vim.api.nvim_set_hl(0, "IncSearch", { fg = c.search_fg, bg = c.inc_search })
+ vim.api.nvim_set_hl(0, "CurSearch", { fg = c.search_fg, bg = c.inc_search })
-local groups = {
- "Constant", "Identifier", "Statement", "PreProc", "Type", "Special",
- "String", "Character", "Number", "Boolean", "Float", "Function",
- "Conditional", "Repeat", "Label", "Operator", "Keyword", "Exception",
- "Include", "Define", "Macro", "PreCondit", "StorageClass", "Structure",
- "Typedef", "Delimiter", "Underlined", "Error", "Todo", "netrwDir", "@variable",
- "GitSignsAdd", "GitSignsChange", "GitSignsDelete", "GitSignsStagedAdd",
- "GitSignsStagedChange", "GitSignsStagedDelete"
-}
+ local groups = {
+ "Constant", "Identifier", "Statement", "PreProc", "Type", "Special",
+ "String", "Character", "Number", "Boolean", "Float", "Function",
+ "Conditional", "Repeat", "Label", "Operator", "Keyword", "Exception",
+ "Include", "Define", "Macro", "PreCondit", "StorageClass", "Structure",
+ "Typedef", "Delimiter", "Underlined", "Error", "Todo", "netrwDir", "@variable",
+ "GitSignsAdd", "GitSignsChange", "GitSignsDelete", "GitSignsStagedAdd",
+ "GitSignsStagedChange", "GitSignsStagedDelete"
+ }
-for _, group in ipairs(groups) do
- vim.api.nvim_set_hl(0, group, { link = "Normal" })
+ for _, group in ipairs(groups) do
+ vim.api.nvim_set_hl(0, group, { link = "Normal" })
+ end
end
--- Disable some mistic built-int treesitter that ignores syntax off
+apply_theme("dark")
+
+ -- disable some mistical built-in treesitter that ignores syntax off
vim.api.nvim_create_autocmd("FileType", {
pattern = "*",
callback = function(a)