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";
|
type = "lua";
|
||||||
config = ''
|
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
|
package.loaded["dieter"] = nil
|
||||||
require("dieter")
|
require("dieter").setup()
|
||||||
|
|
|
@ -42,7 +42,7 @@ local colors = {
|
||||||
background = "NONE",
|
background = "NONE",
|
||||||
foreground = "NONE",
|
foreground = "NONE",
|
||||||
|
|
||||||
accent1 = hsl(202, 57, 57), -- Blue
|
accent1 = hsl(202, 57, 57), -- Blue
|
||||||
accent2 = hsl(40, 57, 57), -- Yellow
|
accent2 = hsl(40, 57, 57), -- Yellow
|
||||||
|
|
||||||
dimmed = hsl(212, 19, 25),
|
dimmed = hsl(212, 19, 25),
|
||||||
|
@ -93,136 +93,171 @@ local colors = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local c = colors[vim.o.background]
|
local setupGroups = function(c)
|
||||||
c.dialog_fg = c.foreground
|
c.dialog_fg = c.foreground
|
||||||
c.dialog_bg = c.background
|
c.dialog_bg = c.background
|
||||||
|
|
||||||
local theme = {
|
return {
|
||||||
Normal = { fg = c.foreground, bg = c.background },
|
Normal = { fg = c.foreground, bg = c.background },
|
||||||
|
|
||||||
Constant = { link = "NormalNC" },
|
Constant = { link = "NormalNC" },
|
||||||
Delimiter = { link = "NormalNC" },
|
Delimiter = { link = "NormalNC" },
|
||||||
Function = { fg = c.func },
|
Function = { fg = c.func },
|
||||||
Identifier = { link = "NormalNC" },
|
Identifier = { link = "NormalNC" },
|
||||||
Keyword = { fg = c.foreground, bold = true },
|
Keyword = { fg = c.foreground, bold = true },
|
||||||
Operator = { link = "NormalNC" },
|
Operator = { link = "NormalNC" },
|
||||||
Special = { link = "NormalNC" },
|
Special = { link = "NormalNC" },
|
||||||
Type = { link = "NormalNC" },
|
Type = { link = "NormalNC" },
|
||||||
|
|
||||||
String = { fg = c.string },
|
String = { fg = c.string },
|
||||||
|
|
||||||
Comment = { fg = c.comment, italic = true, bold = true },
|
Visual = { bg = c.selection },
|
||||||
CommentError = { fg = c.comment_error, italic = true, bold = true },
|
|
||||||
["@comment.note"] = { link = "Comment" },
|
|
||||||
["@comment.todo"] = { link = "CommentError" },
|
|
||||||
["@comment.error"] = { link = "CommentError" },
|
|
||||||
["@comment.warning"] = { link = "CommentError" },
|
|
||||||
|
|
||||||
DiffAdd = { fg = c.add, bg = c.add_quarter },
|
Comment = { fg = c.comment, italic = true, bold = true },
|
||||||
GitSignsAdd = { fg = c.add, bg = c.background },
|
CommentError = { fg = c.comment_error, italic = true, bold = true },
|
||||||
GitSignsAddNr = { link = "DiffAdd" },
|
["@comment.note"] = { link = "Comment" },
|
||||||
DiffChange = { fg = c.change, bg = c.change_quarter },
|
["@comment.todo"] = { link = "CommentError" },
|
||||||
GitSignsChange = { fg = c.change, bg = c.background },
|
["@comment.error"] = { link = "CommentError" },
|
||||||
GitSignsChangeNr = { link = "DiffChange" },
|
["@comment.warning"] = { link = "CommentError" },
|
||||||
DiffDelete = { fg = c.delete, bg = c.delete_quarter },
|
|
||||||
GitSignsDelete = { fg = c.delete, bg = c.background },
|
|
||||||
GitSignsDeleteNr = { link = "DiffDelete" },
|
|
||||||
|
|
||||||
-- Treesitter
|
DiffAdd = { fg = c.add, bg = c.add_quarter },
|
||||||
-- ["@function"] = { link = "NormalNC" },
|
GitSignsAdd = { fg = c.add, bg = c.background },
|
||||||
["@punctuation.special"] = { fg = c.punc },
|
GitSignsAddNr = { link = "DiffAdd" },
|
||||||
["@special"] = { link = "NormalNC" },
|
DiffChange = { fg = c.change, bg = c.change_quarter },
|
||||||
["@variable"] = { link = "NormalNC" },
|
GitSignsChange = { fg = c.change, bg = c.background },
|
||||||
["@variable.member"] = { fg = c.member },
|
GitSignsChangeNr = { link = "DiffChange" },
|
||||||
["@variable.parameter"] = { fg = c.accent2 },
|
DiffDelete = { fg = c.delete, bg = c.delete_quarter },
|
||||||
-- ["@lsp.type.variable"] = { fg = c.dimmed_subtle, italic = true },
|
GitSignsDelete = { fg = c.delete, bg = c.background },
|
||||||
|
GitSignsDeleteNr = { link = "DiffDelete" },
|
||||||
|
|
||||||
-- UI Elements
|
-- Treesitter
|
||||||
CursorLine = { bg = c.highlight_subtle },
|
-- ["@function"] = { link = "NormalNC" },
|
||||||
|
["@punctuation.special"] = { fg = c.punc },
|
||||||
|
["@special"] = { link = "NormalNC" },
|
||||||
|
["@variable"] = { link = "NormalNC" },
|
||||||
|
["@variable.member"] = { fg = c.member },
|
||||||
|
["@variable.parameter"] = { fg = c.accent2 },
|
||||||
|
-- ["@lsp.type.variable"] = { fg = c.dimmed_subtle, italic = true },
|
||||||
|
|
||||||
DiagnosticError = { fg = c.diagnostic_error, italic = true },
|
-- UI Elements
|
||||||
DiagnosticFloatingError = { fg = c.diagnostic_error, bg = c.popup_error_bg },
|
CursorLine = { bg = c.highlight_subtle },
|
||||||
DiagnosticFloatingWarn = { fg = c.diagnostic_warning, bg = c.popup_warning_bg },
|
|
||||||
DiagnosticFloatingInfo = { fg = c.diagnostic_info, bg = c.popup_info_bg },
|
|
||||||
DiagnosticFloatingHint = { fg = c.diagnostic_hint, bg = c.popup_hint_bg },
|
|
||||||
DiagnosticUnderlineError = { fg = c.diagnostic_error, undercurl = true },
|
|
||||||
DiagnosticUnderlineWarn = { fg = c.diagnostic_warn, undercurl = true },
|
|
||||||
DiagnosticUnderlineInfo = { fg = c.diagnostic_info, undercurl = true },
|
|
||||||
DiagnosticUnderlinehint = { fg = c.diagnostic_hint, undercurl = true },
|
|
||||||
|
|
||||||
DiagnosticSignError = { fg = c.diagnostic_error },
|
DiagnosticError = { fg = c.diagnostic_error, italic = true },
|
||||||
DiagnosticSignHint = { fg = c.diagnostic_hint },
|
DiagnosticFloatingError = { fg = c.diagnostic_error, bg = c.popup_error_bg },
|
||||||
DiagnosticSignInfo = { fg = c.diagnostic_info },
|
DiagnosticFloatingWarn = { fg = c.diagnostic_warning, bg = c.popup_warning_bg },
|
||||||
DiagnosticSignWarn = { fg = c.diagnostic_warning },
|
DiagnosticFloatingInfo = { fg = c.diagnostic_info, bg = c.popup_info_bg },
|
||||||
LineNr = { fg = c.dimmed, italic = true },
|
DiagnosticFloatingHint = { fg = c.diagnostic_hint, bg = c.popup_hint_bg },
|
||||||
CursorLineNr = { fg = c.dimmed_subtle, bg = c.highlight_subtle, bold = true },
|
DiagnosticUnderlineError = { fg = c.diagnostic_error, undercurl = true },
|
||||||
|
DiagnosticUnderlineWarn = { fg = c.diagnostic_warn, undercurl = true },
|
||||||
|
DiagnosticUnderlineInfo = { fg = c.diagnostic_info, undercurl = true },
|
||||||
|
DiagnosticUnderlinehint = { fg = c.diagnostic_hint, undercurl = true },
|
||||||
|
|
||||||
IndentLine = { fg = c.dimmed },
|
DiagnosticSignError = { fg = c.diagnostic_error },
|
||||||
IndentLineCurrent = { fg = c.dimmed_subtle },
|
DiagnosticSignHint = { fg = c.diagnostic_hint },
|
||||||
MiniIndentscopeSymbol = { link = "IndentLine" },
|
DiagnosticSignInfo = { fg = c.diagnostic_info },
|
||||||
MiniIndentscopeSymbolOff = { link = "IndentLine" },
|
DiagnosticSignWarn = { fg = c.diagnostic_warning },
|
||||||
|
LineNr = { fg = c.dimmed, italic = true },
|
||||||
|
CursorLineNr = { fg = c.dimmed_subtle, bg = c.highlight_subtle, bold = true },
|
||||||
|
|
||||||
TreesitterContext = { reverse = true },
|
IndentLine = { fg = c.dimmed },
|
||||||
TreesitterContextLineNumber = { bg = c.dimmed, reverse = true, italic = true },
|
IndentLineCurrent = { fg = c.dimmed_subtle },
|
||||||
InclineNormal = { bg = c.background },
|
MiniIndentscopeSymbol = { link = "IndentLine" },
|
||||||
InclineNormalNC = { bg = c.background },
|
MiniIndentscopeSymbolOff = { link = "IndentLine" },
|
||||||
|
|
||||||
WinSeparator = { bg = c.dialog_bg, fg = c.dialog_fg },
|
TreesitterContext = { reverse = true },
|
||||||
NormalFloat = { bg = c.doc_bg, fg = c.doc_fg },
|
TreesitterContextLineNumber = { bg = c.dimmed, reverse = true, italic = true },
|
||||||
FloatBorder = { fg = c.doc_fg },
|
InclineNormal = { bg = c.background },
|
||||||
FloatTitle = { fg = c.doc_fg, bold = true },
|
InclineNormalNC = { bg = c.background },
|
||||||
|
|
||||||
Title = { fg = c.foreground, bold = true },
|
WinSeparator = { bg = c.dialog_bg, fg = c.dialog_fg },
|
||||||
|
NormalFloat = { bg = c.doc_bg, fg = c.doc_fg },
|
||||||
|
FloatBorder = { fg = c.doc_fg },
|
||||||
|
FloatTitle = { fg = c.doc_fg, bold = true },
|
||||||
|
|
||||||
MiniPickNormal = { link = "Normal" },
|
Title = { fg = c.foreground, bold = true },
|
||||||
MiniPickBorder = { link = "MiniPickNormal" },
|
|
||||||
MiniPickBorderText = { link = "MiniPickBorder" },
|
|
||||||
MiniPickMatchCurrent = { bg = c.background, fg = c.foreground, reverse = true },
|
|
||||||
|
|
||||||
MiniClueBorder = { link = "MiniPickNormal" },
|
MiniPickNormal = { link = "Normal" },
|
||||||
MiniClueTitle = { bg = c.background, fg = c.foreground, bold = true },
|
MiniPickBorder = { link = "MiniPickNormal" },
|
||||||
MiniClueNextKey = { link = "MiniClueTitle" },
|
MiniPickBorderText = { link = "MiniPickBorder" },
|
||||||
MiniClueDescGroup = { bg = c.background, fg = c.foreground, italic = true },
|
MiniPickMatchCurrent = { bg = c.background, fg = c.foreground, reverse = true },
|
||||||
MiniClueDescSingle = { bg = c.background, fg = c.foreground },
|
|
||||||
MiniClueSeparator = { link = "MiniClueBorder" },
|
|
||||||
|
|
||||||
MiniStarterCurrent = { link = "MiniPickMatchCurrent" },
|
MiniClueBorder = { link = "MiniPickNormal" },
|
||||||
|
MiniClueTitle = { bg = c.background, fg = c.foreground, bold = true },
|
||||||
|
MiniClueNextKey = { link = "MiniClueTitle" },
|
||||||
|
MiniClueDescGroup = { bg = c.background, fg = c.foreground, italic = true },
|
||||||
|
MiniClueDescSingle = { bg = c.background, fg = c.foreground },
|
||||||
|
MiniClueSeparator = { link = "MiniClueBorder" },
|
||||||
|
|
||||||
BlinkCmpMenu = { bg = c.cmp_bg, fg = c.cmp_fg },
|
MiniStarterCurrent = { link = "MiniPickMatchCurrent" },
|
||||||
BlinkCmpMenuSelection = { bg = c.cmp_selected_bg, fg = c.cmp_selected_fg, reverse = false },
|
|
||||||
BlinkCmpMenuBorder = { bg = c.cmp_bg, fg = c.cmp_fg },
|
|
||||||
BlinkCmpLabel = { link = 'BlinkCmpMenu' },
|
|
||||||
BlinkCmpLabelMatch = { link = 'BlinkCmpMenu', underline = true },
|
|
||||||
|
|
||||||
BlinkCmpDoc = { bg = c.doc_bg, fg = c.foreground },
|
BlinkCmpMenu = { bg = c.cmp_bg, fg = c.cmp_fg },
|
||||||
BlinkCmpDocBorder = { bg = c.doc_bg, fg = c.doc_fg },
|
BlinkCmpMenuSelection = { bg = c.cmp_selected_bg, fg = c.cmp_selected_fg, reverse = false },
|
||||||
BlinkCmpDocDetail = { link = 'BlinkCmpDoc' },
|
BlinkCmpMenuBorder = { bg = c.cmp_bg, fg = c.cmp_fg },
|
||||||
BlinkCmpSignatureHelp = { link = 'BlinkCmpDoc' },
|
BlinkCmpLabel = { link = 'BlinkCmpMenu' },
|
||||||
BlinkCmpSignatureHelpBorder = { link = 'BlinkCmpDocBorder' },
|
BlinkCmpLabelMatch = { link = 'BlinkCmpMenu', underline = true },
|
||||||
|
|
||||||
NeoCodeiumSuggestion = { fg = c.suggestion , bold = true, italic = true },
|
BlinkCmpDoc = { bg = c.doc_bg, fg = c.foreground },
|
||||||
|
BlinkCmpDocBorder = { bg = c.doc_bg, fg = c.doc_fg },
|
||||||
|
BlinkCmpDocDetail = { link = 'BlinkCmpDoc' },
|
||||||
|
BlinkCmpSignatureHelp = { link = 'BlinkCmpDoc' },
|
||||||
|
BlinkCmpSignatureHelpBorder = { link = 'BlinkCmpDocBorder' },
|
||||||
|
|
||||||
NoiceMini = { fg = c.foreground, italic = true },
|
NeoCodeiumSuggestion = { fg = c.suggestion, bold = true, italic = true },
|
||||||
|
LspReferenceText = { fg = c.highlight_intense, undercurl = true },
|
||||||
TelescopeNormal = { fg = c.foreground, bg = c.background },
|
LspInlayHint = { fg = c.accent1, italic = true, bold = true },
|
||||||
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 },
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.cmd("hi clear")
|
|
||||||
|
|
||||||
if vim.fn.exists("syntax_on") == 1 then
|
|
||||||
vim.cmd("syntax reset")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for group, hl in pairs(theme) do
|
|
||||||
vim.api.nvim_set_hl(0, group, hl)
|
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
|
end
|
||||||
|
|
||||||
vim.g.colors_name = "dieter"
|
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(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.keymap.set("n", "<Leader>ub", function()
|
||||||
vim.o.background = (vim.o.background == "light" and "dark" or "light")
|
vim.o.background = (vim.o.background == "light" and "dark" or "light")
|
||||||
end, opts("Toggle dark/light background"))
|
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>uh", "<cmd>InlayHintsToggle<cr>", opts("Toggle inlay hints"))
|
||||||
vim.keymap.set("n", "<Leader>uw","<cmd>set invwrap<cr>", opts("Toggle line wrapping"))
|
vim.keymap.set("n", "<Leader>uw","<cmd>set invwrap<cr>", opts("Toggle line wrapping"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue