Something went wrong. Try again.
A minimal colorscheme for neovim and more
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405local M = {}
---@param p nor.Palettefunction M.get(p) ---@type nor.Config local opts = vim.tbl_deep_extend("force", require("nor.config").defaults(), vim.g.nor_opts or {})
---@type table<string, vim.api.keyset.highlight> local hl = {} local bg = opts.transparent and "none" or p.bg
-- base hl.Normal = { fg = p.fg, bg = bg } hl.ColorColumn = { bg = p.bg_dim } hl.CursorColumn = { bg = p.bg_dim } hl.CursorLine = { bg = p.bg_dim } hl.NonText = { fg = p.fg_hint } hl.EndOfBuffer = { link = "NonText" } if opts.style.column_bg == "sign" then hl.LineNr = { fg = p.fg_dim, bg = p.bg_dim } hl.SignColumn = { link = "LineNr" } hl.CursorLineNr = { fg = p.fg, bg = p.bg_alt } hl.CursorLineSign = { link = "CursorLineNr" } hl.CursorLineFold = { link = "CursorLineSign" } elseif opts.style.column_bg == "number" then hl.LineNr = { fg = p.fg_dim, bg = p.bg_dim } hl.CursorLineNr = { fg = p.fg, bg = p.bg_alt } else hl.LineNr = { fg = p.fg_hint } hl.CursorLineNr = { fg = p.fg_alt, bg = p.bg_dim } hl.CursorLineSign = { link = "CursorLineNr" } hl.CursorLineFold = { link = "CursorLineSign" } end hl.FoldColumn = { link = "SignColumn" } hl.Folded = { fg = p.fg_dim, bg = p.bg_hint } hl.Cursor = { fg = p.bg, bg = p.fg } hl.iCursor = { link = "Cursor" } hl.lCursor = { link = "Cursor" } hl.vCursor = { link = "Cursor" } hl.MCursor = { fg = p.bg, bg = p.orange.fg } hl.MCursorVisual = { link = "Visual" } hl.QuickFixLine = { bg = p.bg_dim, underdotted = true, sp = p.fg_alt } hl.SpecialKey = { fg = p.info } hl.Whitespace = { fg = p.fg_dim } hl.Conceal = { fg = p.fg_dim, bg = bg } hl.Directory = { fg = p.blue.fg }
hl.Search = { fg = p.bg, bg = p.fg_dim } hl.CurSearch = { fg = p.bg, bg = p.orange.fg, bold = true } hl.IncSearch = { link = "Search" } hl.Substitute = { link = "IncSearch" }
hl.Visual = { bg = p.bg_alt } hl.VisualNOS = { fg = "none", bg = p.bg_alt, underdotted = true } hl.MatchParen = { underline = true }
local slstyle = opts.style.statusline hl.StatusLine = slstyle.bg == "none" and { fg = p.fg, bg = "none" } or { fg = p.fg, bg = p.bg_alt } hl.StatusLineNC = { fg = slstyle.dim_inactive and p.fg_alt or p.fg, bg = slstyle.bg ~= "none" and slstyle.dim_inactive and p.bg_hint or hl.StatusLine.bg, }
hl.WinSeparator = { fg = p.bg_alt, bold = true } hl.Title = { fg = p.fg, bold = true } hl.FloatTitle = { link = "Title" }
if opts.style.border.float then hl.NormalFloat = { fg = p.fg } hl.FloatBorder = { fg = p.bg_alt } else hl.NormalFloat = { fg = p.fg, bg = p.bg_hint } hl.FloatBorder = { fg = p.bg_hint, bg = p.bg_hint } end
if opts.style.border.pum then hl.Pmenu = { fg = p.fg_alt } hl.PmenuBorder = { fg = p.bg_alt } hl.PmenuSel = { fg = p.fg, bg = p.bg_dim, bold = true } hl.PmenuSbar = { bg = p.bg_dim } else hl.Pmenu = { fg = p.fg, bg = p.bg_alt } hl.PmenuBorder = { fg = p.bg_alt, bg = p.bg_alt } hl.PmenuSel = { bg = p.fg_hint, bold = true } hl.PmenuSbar = { bg = p.fg_hint } end hl.PmenuThumb = { bg = p.fg }
hl.TabLine = { fg = p.fg_alt, bg = p.bg_dim } hl.TabLineFill = { link = "TabLine" } hl.TabLineSel = { fg = p.fg, bg = p.bg, bold = true }
hl.WinBar = { fg = p.fg_alt } hl.WinBarNC = slstyle.dim_inactive and { fg = p.fg_hint } or { link = "WinBar" }
hl.Question = { fg = p.blue.fg } hl.MsgArea = { fg = p.fg } hl.MsgSeparator = { fg = p.fg_alt, bg = vim.opt.fillchars:get().msgsep == " " and p.bg_dim or "none" } hl.ModeMsg = { fg = p.fg_alt } hl.MoreMsg = { fg = p.blue.fg, bold = true } hl.OkMsg = { fg = p.success, bold = true } hl.ErrorMsg = { fg = p.error, bold = true } hl.WarningMsg = { fg = p.warning, bold = true }
hl.SpellBad = { fg = "none", undercurl = true, sp = p.error } hl.SpellCap = { fg = "none", undercurl = true, sp = p.warning } hl.SpellLocal = { fg = "none", undercurl = true, sp = p.info } hl.SpellRare = { fg = "none", undercurl = true, sp = p.fg_alt }
hl.DiffAdd = { bg = p.green.bg } hl.DiffChange = { bg = p.orange.bg } hl.DiffDelete = { fg = p.red.fg, bg = p.red.bg } hl.DiffText = { bg = p.blue.bg } hl.Added = { fg = p.green.fg, bg = p.green.bg } hl.Changed = { fg = p.orange.fg, bg = p.orange.bg } hl.Removed = { fg = p.red.fg, bg = p.red.bg }
hl.Debug = { fg = p.error } hl.debugPC = { bg = p.red.bg } hl.debugBreakpoint = { fg = p.error }
-- syntax hl.Comment = { fg = p.fg_dim, italic = true } hl.SpecialComment = { link = "Comment" } hl.Constant = { fg = p.blue.fg } hl.Number = { link = "Constant" } hl.Boolean = { link = "Constant" } hl.Float = { link = "Constant" } hl.String = { fg = p.red.fg } hl.Character = { link = "String" } hl.Identifier = { fg = p.fg_alt } hl.Function = { fg = p.fg } hl.Keyword = { fg = p.red.mid } hl.Statement = { link = "Keyword" } hl.Conditional = { link = "Keyword" } hl.Repeat = { link = "Keyword" } hl.Label = { link = "Keyword" } hl.Exception = { link = "Keyword" } hl.PreCondit = { link = "Keyword" } hl.PreProc = { link = "Keyword" } hl.Include = { link = "PreProc" } hl.Define = { link = "PreProc" } hl.Macro = { fg = p.orange.fg } hl.Type = { fg = p.blue.fg } hl.StorageClass = { link = "Keyword" } hl.Structure = { link = "Keyword" } hl.Typedef = { link = "Keyword" } hl.Special = { fg = p.fg } hl.SpecialChar = { link = "Special" } hl.Tag = { fg = p.fg } hl.Operator = { fg = p.fg } hl.Delimiter = { fg = p.fg_dim } hl.Underlined = { underdotted = true } hl.Error = { fg = p.error } hl.NvimInternalError = { fg = p.bg, bg = p.error }
hl["@variable"] = { fg = p.fg_alt } hl["@variable.builtin"] = { fg = p.orange.fg } hl["@variable.parameter"] = { link = "@variable" } hl["@variable.parameter.builtin"] = { link = "@variable.builtin" } hl["@variable.member"] = { link = "@variable" } hl["@constant"] = { link = "Constant" } hl["@constant.macro"] = { link = "Macro" } hl["@constant.builtin"] = { fg = p.orange.fg } hl["@module"] = { fg = p.orange.fg } hl["@module.builtin"] = { link = "@module" } hl["@label"] = { link = "Structure" } hl["@string"] = { link = "String" } hl["@string.documentation"] = { link = "Comment" } hl["@string.regexp"] = { link = "String" } hl["@string.escape"] = { fg = p.orange.fg } hl["@string.special"] = { link = "Special" } hl["@string.special.symbol"] = { link = "Special" } hl["@string.special.path"] = { link = "Special" } hl["@string.special.url"] = { link = "@markup.link.url" } hl["@character"] = { link = "Character" } hl["@character.special"] = { link = "SpecialChar" } hl["@boolean"] = { link = "Boolean" } hl["@number"] = { link = "Number" } hl["@number.float"] = { link = "Number" } hl["@type"] = { link = "Type" } hl["@type.builtin"] = { link = "Type" } hl["@type.definition"] = { fg = p.fg } hl["@attribute"] = { fg = p.fg_alt } hl["@attribute.builtin"] = { link = "Keyword" } hl["@property"] = { fg = p.fg } hl["@function"] = { link = "Function" } hl["@function.builtin"] = { link = "@variable.builtin" } hl["@function.call"] = { link = "Function" } hl["@function.macro"] = { link = "Macro" } hl["@function.method"] = { link = "Function" } hl["@function.method.call"] = { link = "Function" } hl["@operator"] = { link = "Operator" } hl["@constructor"] = { link = "Operator" } hl["@keyword"] = { link = "Keyword" } hl["@keyword.coroutine"] = { link = "Keyword" } hl["@keyword.function"] = { link = "Keyword" } hl["@keyword.operator"] = { link = "Keyword" } hl["@keyword.import"] = { link = "Include" } hl["@keyword.type"] = { link = "Keyword" } hl["@keyword.modifier"] = { link = "Keyword" } hl["@keyword.repeat"] = { link = "Repeat" } hl["@keyword.return"] = { link = "Keyword" } hl["@keyword.debug"] = { link = "Keyword" } hl["@keyword.exception"] = { link = "Exception" } hl["@keyword.conditional"] = { link = "Conditional" } hl["@keyword.conditional.ternary"] = { link = "Conditional" } hl["@keyword.directive"] = { link = "Keyword" } hl["@keyword.directive.define"] = { link = "Keyword" } hl["@punctuation"] = { link = "Delimiter" } hl["@punctuation.delimiter"] = { link = "Delimiter" } hl["@punctuation.bracket"] = { link = "Delimiter" } hl["@punctuation.special"] = { link = "Delimiter" } hl["@comment"] = { link = "Comment" } hl["@comment.documentation"] = { link = "Comment" } hl["@comment.error"] = { fg = p.error } hl["@comment.warning"] = { fg = p.warning } hl["@comment.todo"] = { fg = p.warning } hl["@comment.fixme"] = { fg = p.error } hl["@comment.note"] = { fg = p.fg_alt } hl["@markup.strong"] = { bold = true } hl["@markup.italic"] = { italic = true } hl["@markup.strikethrough"] = { fg = p.fg_dim, strikethrough = true } hl["@markup.underline"] = { link = "Underlined" } hl["@markup.heading"] = { fg = p.red.mid, bold = true } hl["@markup.heading.gitcommit"] = { fg = p.fg, bold = true } hl["@markup.heading.jjdescription"] = { link = "@markup.heading.gitcommit" } hl["@markup.heading.1.markdown"] = { link = "@markup.heading" } hl["@markup.heading.2.markdown"] = { link = "@markup.heading" } hl["@markup.heading.3.markdown"] = { link = "@markup.heading" } hl["@markup.heading.4.markdown"] = { link = "@markup.heading" } hl["@markup.heading.5.markdown"] = { link = "@markup.heading" } hl["@markup.heading.6.markdown"] = { link = "@markup.heading" } hl["@markup.quote"] = { link = "Comment" } hl["@markup.math"] = { link = "Special" } hl["@markup.link"] = { fg = p.fg_alt } hl["@markup.link.label"] = { fg = p.fg, underdotted = false } hl["@markup.link.url"] = { fg = p.blue.fg, underdotted = true } hl["@markup.raw"] = { fg = p.blue.fg } hl["@markup.raw.block"] = { link = "@markup.raw" } hl["@markup.list"] = { fg = p.fg_alt } hl["@markup.list.checked"] = { fg = p.success } hl["@markup.list.unchecked"] = { fg = p.fg_dim } hl["@diff.plus"] = { link = "DiffAdd" } hl["@diff.minus"] = { link = "DiffDelete" } hl["@diff.delta"] = { link = "DiffChange" } hl["@tag"] = { link = "Tag" } hl["@tag.builtin"] = { link = "@tag" } hl["@tag.delimiter"] = { link = "Delimiter" } hl["@tag.attribute"] = { link = "@attribute" }
hl.DiagnosticError = { fg = p.error } hl.DiagnosticHint = { fg = p.fg_alt } hl.DiagnosticInfo = { fg = p.info } hl.DiagnosticOk = { fg = p.success } hl.DiagnosticWarn = { fg = p.warning } hl.DiagnosticUnnecessary = { fg = p.fg_dim } hl.DiagnosticUnderlineError = { undercurl = true, sp = p.error } hl.DiagnosticUnderlineHint = { undercurl = true, sp = p.fg_alt } hl.DiagnosticUnderlineInfo = { undercurl = true, sp = p.info } hl.DiagnosticUnderlineOK = { undercurl = true, sp = p.success } hl.DiagnosticUnderlineWarn = { undercurl = true, sp = p.warning } hl.LspInlayHint = { fg = p.fg_hint, italic = true } hl["@lsp.type.comment"] = {} hl["@lsp.type.lifetime"] = { fg = p.fg_alt } hl["@lsp.type.modifier"] = { link = "Keyword" } hl["@lsp.type.struct"] = { link = "Type" } hl["@lsp.type.class"] = { link = "Type" } hl["@lsp.type.enum"] = { link = "Type" } hl["@lsp.type.namespace"] = { link = "@module" } hl["@lsp.type.formatSpecifier"] = { fg = p.red.mid } hl["@lsp.typemod.namespace.attribute"] = { link = "@attribute" } hl["@lsp.typemod.interface.declaration"] = { link = "Type" } hl["@lsp.typemod.interface.public"] = { link = "Type" } hl["@lsp.typemod.struct.declaration"] = { link = "@lsp.type.struct" } hl["@lsp.typemod.class.declaration"] = { link = "@lsp.type.class" } hl["@lsp.typemod.enum.declaration"] = { link = "@lsp.type.enum" } hl["@lsp.typemod.type.declaration"] = { link = "Type" } hl["@lsp.typemod.class.globalScope"] = { link = "@variable" } hl["@lsp.typemod.generic.attribute"] = { fg = p.fg_alt } hl["@lsp.typemod.variable.defaultLibrary"] = { link = "@variable.builtin" }
-- languages
-- rust hl.rustSigil = { link = "Operator" } hl.rustFoldBraces = { link = "Delimiter" }
-- go hl.goBuiltins = { link = "@variable.builtin" }
-- fish hl.fishOption = { fg = p.orange.fg } hl["@lsp.type.function.fish"] = { fg = p.blue.fg }
-- plugins
-- blink hl.BlinkCmpDocBorder = { link = "PmenuBorder" } hl.BlinkCmpMenuBorder = { link = "PmenuBorder" }
-- mini.icons hl.MiniIconsAzure = { fg = p.blue.fg } hl.MiniIconsBlue = { fg = p.blue.fg } hl.MiniIconsCyan = { fg = p.blue.fg } hl.MiniIconsGreen = { fg = p.green.fg } hl.MiniIconsGrey = { fg = p.fg_alt } hl.MiniIconsOrange = { fg = p.orange.fg } hl.MiniIconsPurple = { fg = p.magenta.fg } hl.MiniIconsRed = { fg = p.red.fg } hl.MiniIconsYellow = { fg = p.orange.fg }
-- mini.clue hl.MiniClueCurrent = { bg = p.bg_alt, bold = true } hl.MiniClueDescSingle = { fg = p.fg } hl.MiniClueDescGroup = { fg = p.orange.fg } hl.MiniClueSeparator = { fg = p.bg_alt } hl.MiniClueNextKey = { fg = p.blue.fg }
-- mini.hipatterns hl.MiniHipatternsFixme = { fg = p.bg, bg = p.error, bold = true } hl.MiniHipatternsHack = { fg = p.bg, bg = p.warning, bold = true } hl.MiniHipatternsNote = { fg = p.bg, bg = p.fg_alt, bold = true } hl.MiniHipatternsTodo = { fg = p.bg, bg = p.info, bold = true }
-- mini.jump hl.MiniJump = { bg = p.bg_alt, underline = true }
-- mini.trailspace hl.MiniTrailspace = { fg = p.red.fg, bg = p.red.bg }
-- mini.pick hl.MiniPickPrompt = { fg = p.fg, bold = true } hl.MiniPickMatchRanges = { reverse = true, underdotted = true }
-- minuet-ai hl.MinuetVirtualText = { fg = p.fg_hint }
-- oil hl.OilCreate = { link = "Added" } hl.OilDelete = { link = "Removed" } hl.OilExecutable = { fg = p.orange.fg }
-- palette local function pascal_case(name) return (name:gsub("_(%l)", string.upper):gsub("^%l", string.upper)) end
for name, color in pairs({ bg = p.bg, bg_hint = p.bg_hint, bg_dim = p.bg_dim, bg_alt = p.bg_alt, fg_hint = p.fg_hint, fg_dim = p.fg_dim, fg_alt = p.fg_alt, fg = p.fg, success = p.success, error = p.error, warning = p.warning, info = p.info, }) do hl["Nor" .. pascal_case(name)] = { [name:sub(1, 2) == "bg" and "bg" or "fg"] = color } end
for _, accent in ipairs({ "red", "orange", "green", "blue", "cyan", "magenta" }) do local c = p[accent] local prefix = "Nor" .. pascal_case(accent) hl[prefix] = { fg = c.fg } hl[prefix .. "Bg"] = { bg = c.bg } hl[prefix .. "Mid"] = { fg = c.mid } hl[prefix .. "Fg"] = { fg = c.fg } hl[prefix .. "FgIntense"] = { fg = c.fg_intense } end
return hlend
---@param p nor.Palette---@return string[]function M.term_colors(p) return { p.bg, p.red.mid, p.green.fg, p.orange.fg, p.blue.mid, p.magenta.fg, p.cyan.fg, p.fg_alt, p.fg_dim, p.red.fg_intense, p.green.fg_intense, p.orange.fg_intense, p.blue.fg_intense, p.magenta.fg_intense, p.cyan.fg_intense, p.fg, }end
return M