nvim: Add dieter/dieter-nocolor variants. Switch with <Leader>uc
This commit is contained in:
parent
091442fcdf
commit
13348be8e9
5 changed files with 156 additions and 112 deletions
|
@ -154,7 +154,7 @@ in
|
|||
};
|
||||
type = "lua";
|
||||
config = ''
|
||||
vim.cmd.colorscheme "dieter"
|
||||
vim.cmd.colorscheme "dieter-nocolor"
|
||||
'';
|
||||
}
|
||||
|
||||
|
|
2
home/common/nvim/dieter/colors/dieter-nocolor.lua
Normal file
2
home/common/nvim/dieter/colors/dieter-nocolor.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
package.loaded["dieter"] = nil
|
||||
require("dieter").setup_nocolor()
|
|
@ -1,2 +1,2 @@
|
|||
package.loaded["dieter"] = nil
|
||||
require("dieter")
|
||||
require("dieter").setup()
|
||||
|
|
|
@ -93,11 +93,11 @@ local colors = {
|
|||
|
||||
}
|
||||
|
||||
local c = colors[vim.o.background]
|
||||
local setupGroups = function(c)
|
||||
c.dialog_fg = c.foreground
|
||||
c.dialog_bg = c.background
|
||||
|
||||
local theme = {
|
||||
return {
|
||||
Normal = { fg = c.foreground, bg = c.background },
|
||||
|
||||
Constant = { link = "NormalNC" },
|
||||
|
@ -111,6 +111,8 @@ local theme = {
|
|||
|
||||
String = { fg = c.string },
|
||||
|
||||
Visual = { bg = c.selection },
|
||||
|
||||
Comment = { fg = c.comment, italic = true, bold = true },
|
||||
CommentError = { fg = c.comment_error, italic = true, bold = true },
|
||||
["@comment.note"] = { link = "Comment" },
|
||||
|
@ -201,28 +203,61 @@ local theme = {
|
|||
BlinkCmpSignatureHelpBorder = { link = 'BlinkCmpDocBorder' },
|
||||
|
||||
NeoCodeiumSuggestion = { fg = c.suggestion, bold = true, italic = true },
|
||||
|
||||
NoiceMini = { fg = c.foreground, italic = true },
|
||||
|
||||
TelescopeNormal = { fg = c.foreground, bg = c.background },
|
||||
TelescopeBorder = { bold = true },
|
||||
TelescopeSelection = { bg = c.selection },
|
||||
TelescopeResultsNormal = { fg = c.foreground, bold = true },
|
||||
TelescopeResultsComment = { fg = c.dimmed_subtle, italic = true, bold = false },
|
||||
|
||||
Visual = { bg = c.selection },
|
||||
LspReferenceText = { fg = c.highlight_intense, undercurl = true },
|
||||
LspInlayHint = { fg = c.accent1, italic = true, bold = true },
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
local setupGroupsNoColor = function(c)
|
||||
local g = setupGroups(c)
|
||||
local cl = { link = "NormalNC" }
|
||||
g.Constant = cl
|
||||
g.Delimiter = cl
|
||||
g.Function = cl
|
||||
g.Identifier = cl
|
||||
g.Keyword = cl
|
||||
g.Operator = cl
|
||||
g["@punctuation.special"] = cl
|
||||
g["@special"] = cl
|
||||
g["@string"] = cl
|
||||
g["@lsp.type.string"] = cl
|
||||
g.Special = cl
|
||||
g.String = cl
|
||||
g.Type = cl
|
||||
g.Variable = cl
|
||||
g["@variable"] = cl
|
||||
g["@variable.member"] = cl
|
||||
g["@variable.parameter"] = cl
|
||||
g.Comment = { fg = c.dimmed_subtle, italic = true, bold = true }
|
||||
g.CommentError = { link = "Comment" }
|
||||
return g
|
||||
end
|
||||
|
||||
local setup_common = function(groups)
|
||||
vim.cmd("hi clear")
|
||||
|
||||
if vim.fn.exists("syntax_on") == 1 then
|
||||
vim.cmd("syntax reset")
|
||||
end
|
||||
|
||||
for group, hl in pairs(theme) do
|
||||
for group, hl in pairs(groups) do
|
||||
vim.api.nvim_set_hl(0, group, hl)
|
||||
end
|
||||
end
|
||||
|
||||
local T = {}
|
||||
|
||||
T.setup = function()
|
||||
local c = colors[vim.o.background]
|
||||
local groups = setupGroups(c)
|
||||
setup_common(groups)
|
||||
vim.g.colors_name = "dieter"
|
||||
end
|
||||
|
||||
T.setup_nocolor = function()
|
||||
local c = colors[vim.o.background]
|
||||
local groups = setupGroupsNoColor(c)
|
||||
setup_common(groups)
|
||||
vim.g.colors_name = "dieter-nocolor"
|
||||
end
|
||||
|
||||
return T
|
||||
|
|
|
@ -154,6 +154,13 @@ vim.keymap.set("n", "K", function()
|
|||
vim.keymap.set("n", "<Leader>ub", function()
|
||||
vim.o.background = (vim.o.background == "light" and "dark" or "light")
|
||||
end, opts("Toggle dark/light background"))
|
||||
vim.keymap.set("n", "<Leader>uc", function()
|
||||
if vim.g.colors_name == "dieter-nocolor" then
|
||||
vim.cmd [[colorscheme dieter]]
|
||||
else
|
||||
vim.cmd [[colorscheme dieter-nocolor]]
|
||||
end
|
||||
end, opts("Toggle Dieter colors"))
|
||||
vim.keymap.set("n", "<Leader>uh", "<cmd>InlayHintsToggle<cr>", opts("Toggle inlay hints"))
|
||||
vim.keymap.set("n", "<Leader>uw","<cmd>set invwrap<cr>", opts("Toggle line wrapping"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue