diff --git a/lua/lualine/themes/rose-pine-alt.lua b/lua/lualine/themes/rose-pine-alt.lua index 287144f..05d8af7 100644 --- a/lua/lualine/themes/rose-pine-alt.lua +++ b/lua/lualine/themes/rose-pine-alt.lua @@ -1,10 +1,4 @@ local p = require("rose-pine.palette") -local config = require("rose-pine.config") - -local bg_base = p.base -if config.options.styles.transparency then - bg_base = "NONE" -end return { normal = { @@ -25,8 +19,8 @@ return { a = { bg = p.surface, fg = p.love, gui = "bold" }, }, inactive = { - a = { bg = bg_base, fg = p.subtle, gui = "bold" }, - b = { bg = bg_base, fg = p.subtle }, - c = { bg = bg_base, fg = p.subtle, gui = "italic" }, + a = { bg = p.base, fg = p.subtle, gui = "bold" }, + b = { bg = p.base, fg = p.subtle }, + c = { bg = p.base, fg = p.subtle, gui = "italic" }, }, } diff --git a/lua/lualine/themes/rose-pine.lua b/lua/lualine/themes/rose-pine.lua index e409130..96d6b92 100644 --- a/lua/lualine/themes/rose-pine.lua +++ b/lua/lualine/themes/rose-pine.lua @@ -1,40 +1,34 @@ local p = require("rose-pine.palette") -local config = require("rose-pine.config") - -local bg_base = p.surface -if config.options.styles.transparency then - bg_base = "NONE" -end return { normal = { a = { bg = p.rose, fg = p.base, gui = "bold" }, b = { bg = p.overlay, fg = p.rose }, - c = { bg = bg_base, fg = p.text }, + c = { bg = p.base, fg = p.text }, }, insert = { a = { bg = p.foam, fg = p.base, gui = "bold" }, b = { bg = p.overlay, fg = p.foam }, - c = { bg = bg_base, fg = p.text }, + c = { bg = p.base, fg = p.text }, }, visual = { a = { bg = p.iris, fg = p.base, gui = "bold" }, b = { bg = p.overlay, fg = p.iris }, - c = { bg = bg_base, fg = p.text }, + c = { bg = p.base, fg = p.text }, }, replace = { a = { bg = p.pine, fg = p.base, gui = "bold" }, b = { bg = p.overlay, fg = p.pine }, - c = { bg = bg_base, fg = p.text }, + c = { bg = p.base, fg = p.text }, }, command = { a = { bg = p.love, fg = p.base, gui = "bold" }, b = { bg = p.overlay, fg = p.love }, - c = { bg = bg_base, fg = p.text }, + c = { bg = p.base, fg = p.text }, }, inactive = { - a = { bg = bg_base, fg = p.muted, gui = "bold" }, - b = { bg = bg_base, fg = p.muted }, - c = { bg = bg_base, fg = p.muted }, + a = { bg = p.base, fg = p.muted, gui = "bold" }, + b = { bg = p.base, fg = p.muted }, + c = { bg = p.base, fg = p.muted }, }, } diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index f10ffcd..d45d4af 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -5,36 +5,245 @@ local function set_highlights() local utilities = require("rose-pine.utilities") local palette = require("rose-pine.palette") local styles = config.options.styles - - local groups = {} - for group, color in pairs(config.options.groups) do - groups[group] = utilities.parse_color(color) - end + local groups = config.options.groups local function make_border(fg) fg = fg or groups.border - return { - fg = fg, - bg = (config.options.extend_background_behind_borders and not styles.transparency) and palette.surface - or "NONE", - } + return { fg = fg, bg = config.options.extend_background_behind_borders and palette.surface or "NONE" } end - local highlights = {} - local legacy_highlights = { + local function make_title(fg) + fg = fg or palette.foam + return { fg = styles.bold and palette.text or fg, bold = styles.bold } + end + + local highlights = { + ColorColumn = { bg = palette.surface }, + Conceal = { bg = "NONE" }, + CurSearch = { fg = palette.base, bg = palette.gold }, + Cursor = { fg = palette.text, bg = palette.highlight_high }, + CursorColumn = { bg = palette.overlay }, + -- CursorIM = {}, + CursorLine = { bg = palette.overlay }, + CursorLineNr = { fg = palette.text, bold = styles.bold }, + -- DarkenedPanel = { }, + -- DarkenedStatusline = {}, + DiffAdd = { bg = groups.git_add, blend = 20 }, + DiffChange = { bg = groups.git_change, blend = 20 }, + DiffDelete = { bg = groups.git_delete, blend = 20 }, + DiffText = { bg = groups.git_text, blend = 20 }, + diffAdded = { link = "DiffAdd" }, + diffChanged = { link = "DiffChange" }, + diffRemoved = { link = "DiffDelete" }, + Directory = make_title(), + -- EndOfBuffer = {}, + ErrorMsg = { fg = groups.error, bold = styles.bold }, + FloatBorder = make_border(), + FloatTitle = { link = "Directory" }, + FoldColumn = { fg = palette.muted }, + Folded = { fg = palette.text, bg = groups.panel }, + IncSearch = { link = "CurSearch" }, + LineNr = { fg = palette.muted }, + MatchParen = { fg = palette.pine, bg = palette.pine, blend = 25 }, + ModeMsg = { fg = palette.subtle }, + MoreMsg = { fg = palette.iris }, + NonText = { fg = palette.muted }, + Normal = { fg = palette.text, bg = palette.base }, + NormalFloat = { bg = groups.panel }, + NormalNC = { fg = palette.text, bg = config.options.dim_inactive_windows and palette._nc or palette.base }, + NvimInternalError = { link = "ErrorMsg" }, + Pmenu = { fg = palette.subtle, bg = groups.panel }, + PmenuExtra = { fg = palette.muted, bg = groups.panel }, + PmenuExtraSel = { fg = palette.subtle, bg = palette.overlay }, + PmenuKind = { fg = palette.foam, bg = groups.panel }, + PmenuKindSel = { fg = palette.subtle, bg = palette.overlay }, + PmenuSbar = { bg = groups.panel }, + PmenuSel = { fg = palette.title, bg = palette.overlay }, + PmenuThumb = { bg = palette.muted }, + Question = { fg = palette.gold }, + -- QuickFixLink = {}, + -- RedrawDebugNormal = {}, + RedrawDebugClear = { fg = palette.base, bg = palette.gold }, + RedrawDebugComposed = { fg = palette.base, bg = palette.pine }, + RedrawDebugRecompose = { fg = palette.base, bg = palette.love }, + Search = { fg = palette.base, bg = palette.text }, + SignColumn = { fg = palette.text, bg = "NONE" }, + SpecialKey = { fg = palette.foam }, + SpellBad = { sp = palette.subtle, undercurl = true }, + SpellCap = { sp = palette.subtle, undercurl = true }, + SpellLocal = { sp = palette.subtle, undercurl = true }, + SpellRare = { sp = palette.subtle, undercurl = true }, + StatusLine = { fg = palette.subtle, bg = groups.panel }, + StatusLineNC = { fg = palette.muted, bg = groups.panel, blend = 60 }, + StatusLineTerm = { fg = palette.base, bg = palette.pine }, + StatusLineTermNC = { fg = palette.base, bg = palette.pine, blend = 60 }, + Substitute = { link = "IncSearch" }, + TabLine = { link = "StatusLine" }, + TabLineFill = { bg = groups.panel }, + TabLineSel = { fg = palette.text, bg = palette.overlay, bold = styles.bold }, + Title = make_title(), + VertSplit = make_border(), + Visual = { bg = palette.highlight_med }, + -- VisualNOS = {}, + WarningMsg = { fg = groups.warn, bold = styles.bold }, + -- Whitespace = {}, + WildMenu = { link = "IncSearch" }, + WinSeparator = make_border(), + + DiagnosticError = { fg = groups.error }, + DiagnosticHint = { fg = groups.hint }, + DiagnosticInfo = { fg = groups.info }, + DiagnosticWarn = { fg = groups.warn }, + DiagnosticDefaultError = { link = "DiagnosticError" }, + DiagnosticDefaultHint = { link = "DiagnosticHint" }, + DiagnosticDefaultInfo = { link = "DiagnosticInfo" }, + DiagnosticDefaultWarn = { link = "DiagnosticWarn" }, + DiagnosticFloatingError = { link = "DiagnosticError" }, + DiagnosticFloatingHint = { link = "DiagnosticHint" }, + DiagnosticFloatingInfo = { link = "DiagnosticInfo" }, + DiagnosticFloatingWarn = { link = "DiagnosticWarn" }, + DiagnosticSignError = { link = "DiagnosticError" }, + DiagnosticSignHint = { link = "DiagnosticHint" }, + DiagnosticSignInfo = { link = "DiagnosticInfo" }, + DiagnosticSignWarn = { link = "DiagnosticWarn" }, + DiagnosticUnderlineError = { sp = groups.error, undercurl = true }, + DiagnosticUnderlineHint = { sp = groups.hint, undercurl = true }, + DiagnosticUnderlineInfo = { sp = groups.info, undercurl = true }, + DiagnosticUnderlineWarn = { sp = groups.warn, undercurl = true }, + DiagnosticVirtualTextError = { fg = groups.error, bg = groups.error, blend = 10 }, + DiagnosticVirtualTextHint = { fg = groups.hint, bg = groups.hint, blend = 10 }, + DiagnosticVirtualTextInfo = { fg = groups.info, bg = groups.info, blend = 10 }, + DiagnosticVirtualTextWarn = { fg = groups.warn, bg = groups.warn, blend = 10 }, + + Boolean = { fg = palette.rose }, + Character = { fg = palette.gold }, + Comment = { fg = palette.subtle, italic = styles.italic }, + Conditional = { fg = palette.pine }, + Constant = { fg = palette.gold }, + Debug = { fg = palette.rose }, + Define = { fg = palette.iris }, + Delimiter = { fg = palette.subtle }, + Error = { fg = palette.love }, + Exception = { fg = palette.pine }, + Float = { fg = palette.gold }, + Function = { fg = palette.rose }, + Identifier = { fg = palette.text }, + Include = { fg = palette.pine }, + Keyword = { fg = palette.pine }, + Label = { fg = palette.foam }, + LspCodeLens = { fg = palette.subtle }, + LspCodeLensSeparator = { fg = palette.muted }, + LspInlayHint = { fg = palette.muted, bg = palette.muted, blend = 10 }, + LspReferenceRead = { bg = palette.highlight_med }, + LspReferenceText = { bg = palette.highlight_med }, + LspReferenceWrite = { bg = palette.highlight_med }, + Macro = { fg = palette.iris }, + Number = { fg = palette.gold }, + Operator = { fg = palette.subtle }, + PreConduit = { fg = palette.iris }, + PreProc = { link = "PreConduit" }, + Repeat = { fg = palette.pine }, + Special = { fg = palette.foam }, + SpecialChar = { link = "Special" }, + SpecialComment = { fg = palette.iris }, + Statement = { fg = palette.pine, bold = styles.bold }, + StorageClass = { fg = palette.foam }, + String = { fg = palette.gold }, + Structure = { fg = palette.foam }, + Tag = { fg = palette.foam }, + Todo = { fg = palette.iris, bg = palette.iris, blend = 20 }, + Type = { fg = palette.foam }, + TypeDef = { link = "Type" }, + Underlined = { fg = palette.iris, underline = true }, + + healthError = { fg = groups.error }, + healthSuccess = { fg = groups.info }, + healthWarning = { fg = groups.warn }, + + htmlArg = { fg = palette.iris }, + htmlBold = { bold = styles.bold }, + htmlEndTag = { fg = palette.subtle }, + htmlH1 = { link = "markdownH1" }, + htmlH2 = { link = "markdownH2" }, + htmlH3 = { link = "markdownH3" }, + htmlH4 = { link = "markdownH4" }, + htmlH5 = { link = "markdownH5" }, + htmlItalic = { italic = styles.italic }, + htmlLink = { link = "markdownUrl" }, + htmlTag = { fg = palette.subtle }, + htmlTagN = { fg = palette.text }, + htmlTagName = { fg = palette.foam }, + + markdownDelimiter = { fg = palette.subtle }, + markdownH1 = { fg = groups.headings.h1, bold = styles.bold }, + markdownH1Delimiter = { link = "markdownH1" }, + markdownH2 = { fg = groups.headings.h2, bold = styles.bold }, + markdownH2Delimiter = { link = "markdownH2" }, + markdownH3 = { fg = groups.headings.h3, bold = styles.bold }, + markdownH3Delimiter = { link = "markdownH3" }, + markdownH4 = { fg = groups.headings.h4, bold = styles.bold }, + markdownH4Delimiter = { link = "markdownH4" }, + markdownH5 = { fg = groups.headings.h5, bold = styles.bold }, + markdownH5Delimiter = { link = "markdownH5" }, + markdownH6 = { fg = groups.headings.h6, bold = styles.bold }, + markdownH6Delimiter = { link = "markdownH6" }, + markdownLinkText = { link = "markdownUrl" }, + markdownUrl = { fg = groups.link, sp = groups.link, underline = true }, + + mkdCode = { fg = palette.foam, italic = styles.italic }, + mkdCodeDelimiter = { fg = palette.rose }, + mkdCodeEnd = { fg = palette.foam }, + mkdCodeStart = { fg = palette.foam }, + mkdFootnotes = { fg = palette.foam }, + mkdID = { fg = palette.foam, underline = true }, + mkdInlineURL = { link = "markdownUrl" }, + mkdLink = { link = "markdownUrl" }, + mkdLinkDef = { link = "markdownUrl" }, + mkdListItemLine = { fg = palette.text }, + mkdRule = { fg = palette.subtle }, + mkdURL = { link = "markdownUrl" }, + ["@attribute.diff"] = { fg = palette.gold }, ["@boolean"] = { link = "Boolean" }, + ["@character"] = { link = "Character" }, + ["@character.special"] = { link = "Character" }, ["@class"] = { fg = palette.foam }, + ["@comment"] = { link = "Comment" }, ["@conditional"] = { link = "Conditional" }, + ["@constant"] = { link = "Constant" }, + ["@constant.builtin"] = { fg = palette.love }, + ["@constant.macro"] = { link = "Constant" }, + ["@constructor"] = { fg = palette.foam }, ["@field"] = { fg = palette.foam }, + ["@function"] = { link = "Function" }, + ["@function.builtin"] = { fg = palette.love }, + ["@function.macro"] = { link = "Function" }, ["@include"] = { link = "Include" }, ["@interface"] = { fg = palette.foam }, + ["@keyword"] = { link = "Keyword" }, + ["@keyword.operator"] = { fg = palette.subtle }, + ["@label"] = { link = "Label" }, + ["@lsp.type.comment"] = {}, + ["@lsp.type.enum"] = { link = "Type" }, + ["@lsp.type.interface"] = { link = "@interface" }, + ["@lsp.type.keyword"] = { link = "Keyword" }, + ["@lsp.type.namespace"] = { link = "@namespace" }, + ["@lsp.type.parameter"] = { link = "@parameter" }, + ["@lsp.type.property"] = { link = "@property" }, + ["@lsp.type.variable"] = {}, + ["@lsp.typemod.function.defaultLibrary"] = { link = "Special" }, + ["@lsp.typemod.operator.injected"] = { link = "Operator" }, + ["@lsp.typemod.string.injected"] = { link = "String" }, + ["@lsp.typemod.variable.defaultLibrary"] = { link = "@variable.builtin" }, + ["@lsp.typemod.variable.injected"] = { link = "@variable" }, ["@macro"] = { link = "Macro" }, ["@method"] = { fg = palette.rose }, ["@namespace"] = { link = "Include" }, ["@number"] = { link = "Number" }, + ["@operator"] = { link = "Operator" }, ["@parameter"] = { fg = palette.iris, italic = styles.italic }, ["@preproc"] = { link = "PreProc" }, + ["@property"] = { fg = palette.foam, italic = styles.italic }, ["@punctuation"] = { fg = palette.subtle }, ["@punctuation.bracket"] = { link = "@punctuation" }, ["@punctuation.delimiter"] = { link = "@punctuation" }, @@ -42,7 +251,13 @@ local function set_highlights() ["@regexp"] = { link = "String" }, ["@repeat"] = { link = "Repeat" }, ["@storageclass"] = { link = "StorageClass" }, + ["@string"] = { link = "String" }, + ["@string.escape"] = { fg = palette.pine }, + ["@string.special"] = { link = "String" }, ["@symbol"] = { link = "Identifier" }, + ["@tag"] = { link = "Tag" }, + ["@tag.attribute"] = { fg = palette.iris }, + ["@tag.delimiter"] = { fg = palette.subtle }, ["@text"] = { fg = palette.text }, ["@text.danger"] = { fg = groups.error }, ["@text.diff.add"] = { fg = groups.git_add, bg = groups.git_add, blend = 20 }, @@ -71,368 +286,10 @@ local function set_highlights() ["@text.uri"] = { fg = groups.link }, ["@text.warning"] = { fg = groups.warn }, ["@todo"] = { link = "Todo" }, - - -- lukas-reineke/indent-blankline.nvim - IndentBlanklineChar = { fg = palette.muted, nocombine = true }, - IndentBlanklineSpaceChar = { fg = palette.muted, nocombine = true }, - IndentBlanklineSpaceCharBlankline = { fg = palette.muted, nocombine = true }, - } - local default_highlights = { - ColorColumn = { bg = palette.surface }, - Conceal = { bg = "NONE" }, - CurSearch = { fg = palette.base, bg = palette.gold }, - Cursor = { fg = palette.text, bg = palette.highlight_high }, - CursorColumn = { bg = palette.overlay }, - -- CursorIM = {}, - CursorLine = { bg = palette.overlay }, - CursorLineNr = { fg = palette.text, bold = styles.bold }, - -- DarkenedPanel = { }, - -- DarkenedStatusline = {}, - DiffAdd = { bg = groups.git_add, blend = 20 }, - DiffChange = { bg = groups.git_change, blend = 20 }, - DiffDelete = { bg = groups.git_delete, blend = 20 }, - DiffText = { bg = groups.git_text, blend = 40 }, - diffAdded = { link = "DiffAdd" }, - diffChanged = { link = "DiffChange" }, - diffRemoved = { link = "DiffDelete" }, - Directory = { fg = palette.foam, bold = styles.bold }, - -- EndOfBuffer = {}, - ErrorMsg = { fg = groups.error, bold = styles.bold }, - FloatBorder = make_border(), - FloatTitle = { fg = palette.foam, bg = groups.panel, bold = styles.bold }, - FoldColumn = { fg = palette.muted }, - Folded = { fg = palette.text, bg = groups.panel }, - IncSearch = { link = "CurSearch" }, - LineNr = { fg = palette.muted }, - MatchParen = { fg = palette.pine, bg = palette.pine, blend = 25 }, - ModeMsg = { fg = palette.subtle }, - MoreMsg = { fg = palette.iris }, - NonText = { fg = palette.muted }, - Normal = { fg = palette.text, bg = palette.base }, - NormalFloat = { bg = groups.panel }, - NormalNC = { fg = palette.text, bg = config.options.dim_inactive_windows and palette._nc or palette.base }, - NvimInternalError = { link = "ErrorMsg" }, - Pmenu = { fg = palette.subtle, bg = groups.panel }, - PmenuExtra = { fg = palette.muted, bg = groups.panel }, - PmenuExtraSel = { fg = palette.subtle, bg = palette.overlay }, - PmenuKind = { fg = palette.foam, bg = groups.panel }, - PmenuKindSel = { fg = palette.subtle, bg = palette.overlay }, - PmenuSbar = { bg = groups.panel }, - PmenuSel = { fg = palette.text, bg = palette.overlay }, - PmenuThumb = { bg = palette.muted }, - Question = { fg = palette.gold }, - QuickFixLine = { fg = palette.foam }, - -- RedrawDebugNormal = {}, - RedrawDebugClear = { fg = palette.base, bg = palette.gold }, - RedrawDebugComposed = { fg = palette.base, bg = palette.pine }, - RedrawDebugRecompose = { fg = palette.base, bg = palette.love }, - Search = { fg = palette.text, bg = palette.gold, blend = 20 }, - SignColumn = { fg = palette.text, bg = "NONE" }, - SpecialKey = { fg = palette.foam }, - SpellBad = { sp = palette.subtle, undercurl = true }, - SpellCap = { sp = palette.subtle, undercurl = true }, - SpellLocal = { sp = palette.subtle, undercurl = true }, - SpellRare = { sp = palette.subtle, undercurl = true }, - StatusLine = { fg = palette.subtle, bg = groups.panel }, - StatusLineNC = { fg = palette.muted, bg = groups.panel, blend = 60 }, - StatusLineTerm = { fg = palette.base, bg = palette.pine }, - StatusLineTermNC = { fg = palette.base, bg = palette.pine, blend = 60 }, - Substitute = { link = "IncSearch" }, - TabLine = { fg = palette.subtle, bg = groups.panel }, - TabLineFill = { bg = groups.panel }, - TabLineSel = { fg = palette.text, bg = palette.overlay, bold = styles.bold }, - Title = { fg = palette.foam, bold = styles.bold }, - VertSplit = { fg = groups.border }, - Visual = { bg = palette.iris, blend = 15 }, - -- VisualNOS = {}, - WarningMsg = { fg = groups.warn, bold = styles.bold }, - -- Whitespace = {}, - WildMenu = { link = "IncSearch" }, - WinBar = { fg = palette.subtle, bg = groups.panel }, - WinBarNC = { fg = palette.muted, bg = groups.panel, blend = 60 }, - WinSeparator = { fg = groups.border }, - - DiagnosticError = { fg = groups.error }, - DiagnosticHint = { fg = groups.hint }, - DiagnosticInfo = { fg = groups.info }, - DiagnosticOk = { fg = groups.ok }, - DiagnosticWarn = { fg = groups.warn }, - DiagnosticDefaultError = { link = "DiagnosticError" }, - DiagnosticDefaultHint = { link = "DiagnosticHint" }, - DiagnosticDefaultInfo = { link = "DiagnosticInfo" }, - DiagnosticDefaultOk = { link = "DiagnosticOk" }, - DiagnosticDefaultWarn = { link = "DiagnosticWarn" }, - DiagnosticFloatingError = { link = "DiagnosticError" }, - DiagnosticFloatingHint = { link = "DiagnosticHint" }, - DiagnosticFloatingInfo = { link = "DiagnosticInfo" }, - DiagnosticFloatingOk = { link = "DiagnosticOk" }, - DiagnosticFloatingWarn = { link = "DiagnosticWarn" }, - DiagnosticSignError = { link = "DiagnosticError" }, - DiagnosticSignHint = { link = "DiagnosticHint" }, - DiagnosticSignInfo = { link = "DiagnosticInfo" }, - DiagnosticSignOk = { link = "DiagnosticOk" }, - DiagnosticSignWarn = { link = "DiagnosticWarn" }, - DiagnosticUnderlineError = { sp = groups.error, undercurl = true }, - DiagnosticUnderlineHint = { sp = groups.hint, undercurl = true }, - DiagnosticUnderlineInfo = { sp = groups.info, undercurl = true }, - DiagnosticUnderlineOk = { sp = groups.ok, undercurl = true }, - DiagnosticUnderlineWarn = { sp = groups.warn, undercurl = true }, - DiagnosticVirtualTextError = { fg = groups.error, bg = groups.error, blend = 10 }, - DiagnosticVirtualTextHint = { fg = groups.hint, bg = groups.hint, blend = 10 }, - DiagnosticVirtualTextInfo = { fg = groups.info, bg = groups.info, blend = 10 }, - DiagnosticVirtualTextOk = { fg = groups.ok, bg = groups.ok, blend = 10 }, - DiagnosticVirtualTextWarn = { fg = groups.warn, bg = groups.warn, blend = 10 }, - - Boolean = { fg = palette.rose }, - Character = { fg = palette.gold }, - Comment = { fg = palette.subtle, italic = styles.italic }, - Conditional = { fg = palette.pine }, - Constant = { fg = palette.gold }, - Debug = { fg = palette.rose }, - Define = { fg = palette.iris }, - Delimiter = { fg = palette.subtle }, - Error = { fg = palette.love }, - Exception = { fg = palette.pine }, - Float = { fg = palette.gold }, - Function = { fg = palette.rose }, - Identifier = { fg = palette.text }, - Include = { fg = palette.pine }, - Keyword = { fg = palette.pine }, - Label = { fg = palette.foam }, - LspCodeLens = { fg = palette.subtle }, - LspCodeLensSeparator = { fg = palette.muted }, - LspInlayHint = { fg = palette.muted, bg = palette.muted, blend = 10 }, - LspReferenceRead = { bg = palette.highlight_med }, - LspReferenceText = { bg = palette.highlight_med }, - LspReferenceWrite = { bg = palette.highlight_med }, - Macro = { fg = palette.iris }, - Number = { fg = palette.gold }, - Operator = { fg = palette.subtle }, - PreCondit = { fg = palette.iris }, - PreProc = { link = "PreCondit" }, - Repeat = { fg = palette.pine }, - Special = { fg = palette.foam }, - SpecialChar = { link = "Special" }, - SpecialComment = { fg = palette.iris }, - Statement = { fg = palette.pine, bold = styles.bold }, - StorageClass = { fg = palette.foam }, - String = { fg = palette.gold }, - Structure = { fg = palette.foam }, - Tag = { fg = palette.foam }, - Todo = { fg = palette.rose, bg = palette.rose, blend = 20 }, - Type = { fg = palette.foam }, - TypeDef = { link = "Type" }, - Underlined = { fg = palette.iris, underline = true }, - - healthError = { fg = groups.error }, - healthSuccess = { fg = groups.info }, - healthWarning = { fg = groups.warn }, - - htmlArg = { fg = palette.iris }, - htmlBold = { bold = styles.bold }, - htmlEndTag = { fg = palette.subtle }, - htmlH1 = { link = "markdownH1" }, - htmlH2 = { link = "markdownH2" }, - htmlH3 = { link = "markdownH3" }, - htmlH4 = { link = "markdownH4" }, - htmlH5 = { link = "markdownH5" }, - htmlItalic = { italic = styles.italic }, - htmlLink = { link = "markdownUrl" }, - htmlTag = { fg = palette.subtle }, - htmlTagN = { fg = palette.text }, - htmlTagName = { fg = palette.foam }, - - markdownDelimiter = { fg = palette.subtle }, - markdownH1 = { fg = groups.h1, bold = styles.bold }, - markdownH1Delimiter = { link = "markdownH1" }, - markdownH2 = { fg = groups.h2, bold = styles.bold }, - markdownH2Delimiter = { link = "markdownH2" }, - markdownH3 = { fg = groups.h3, bold = styles.bold }, - markdownH3Delimiter = { link = "markdownH3" }, - markdownH4 = { fg = groups.h4, bold = styles.bold }, - markdownH4Delimiter = { link = "markdownH4" }, - markdownH5 = { fg = groups.h5, bold = styles.bold }, - markdownH5Delimiter = { link = "markdownH5" }, - markdownH6 = { fg = groups.h6, bold = styles.bold }, - markdownH6Delimiter = { link = "markdownH6" }, - markdownLinkText = { link = "markdownUrl" }, - markdownUrl = { fg = groups.link, sp = groups.link, underline = true }, - - mkdCode = { fg = palette.foam, italic = styles.italic }, - mkdCodeDelimiter = { fg = palette.rose }, - mkdCodeEnd = { fg = palette.foam }, - mkdCodeStart = { fg = palette.foam }, - mkdFootnotes = { fg = palette.foam }, - mkdID = { fg = palette.foam, underline = true }, - mkdInlineURL = { link = "markdownUrl" }, - mkdLink = { link = "markdownUrl" }, - mkdLinkDef = { link = "markdownUrl" }, - mkdListItemLine = { fg = palette.text }, - mkdRule = { fg = palette.subtle }, - mkdURL = { link = "markdownUrl" }, - - --- Treesitter - --- |:help treesitter-highlight-groups| + ["@type"] = { link = "Type" }, ["@variable"] = { fg = palette.text, italic = styles.italic }, - ["@variable.builtin"] = { fg = palette.love, italic = styles.italic, bold = styles.bold }, - ["@variable.parameter"] = { fg = palette.iris, italic = styles.italic }, - ["@variable.parameter.builtin"] = { fg = palette.iris, italic = styles.italic, bold = styles.bold }, - ["@variable.member"] = { fg = palette.foam }, + ["@variable.builtin"] = { fg = palette.love }, - ["@constant"] = { fg = palette.gold }, - ["@constant.builtin"] = { fg = palette.gold, bold = styles.bold }, - ["@constant.macro"] = { fg = palette.gold }, - - ["@module"] = { fg = palette.text }, - ["@module.builtin"] = { fg = palette.text, bold = styles.bold }, - ["@label"] = { link = "Label" }, - - ["@string"] = { link = "String" }, - -- ["@string.documentation"] = {}, - ["@string.regexp"] = { fg = palette.iris }, - ["@string.escape"] = { fg = palette.pine }, - ["@string.special"] = { link = "String" }, - ["@string.special.symbol"] = { link = "Identifier" }, - ["@string.special.url"] = { fg = groups.link }, - -- ["@string.special.path"] = {}, - - ["@character"] = { link = "Character" }, - ["@character.special"] = { link = "Character" }, - - ["@boolean"] = { link = "Boolean" }, - ["@number"] = { link = "Number" }, - ["@number.float"] = { link = "Number" }, - ["@float"] = { link = "Number" }, - - ["@type"] = { fg = palette.foam }, - ["@type.builtin"] = { fg = palette.foam, bold = styles.bold }, - -- ["@type.definition"] = {}, - - ["@attribute"] = { fg = palette.iris }, - ["@attribute.builtin"] = { fg = palette.iris, bold = styles.bold }, - ["@property"] = { fg = palette.foam, italic = styles.italic }, - - ["@function"] = { fg = palette.rose }, - ["@function.builtin"] = { fg = palette.rose, bold = styles.bold }, - -- ["@function.call"] = {}, - ["@function.macro"] = { link = "Function" }, - - ["@function.method"] = { fg = palette.rose }, - ["@function.method.call"] = { fg = palette.iris }, - - ["@constructor"] = { fg = palette.foam }, - ["@operator"] = { link = "Operator" }, - - ["@keyword"] = { link = "Keyword" }, - -- ["@keyword.coroutine"] = {}, - -- ["@keyword.function"] = {}, - ["@keyword.operator"] = { fg = palette.subtle }, - ["@keyword.import"] = { fg = palette.pine }, - ["@keyword.storage"] = { fg = palette.foam }, - ["@keyword.repeat"] = { fg = palette.pine }, - ["@keyword.return"] = { fg = palette.pine }, - ["@keyword.debug"] = { fg = palette.rose }, - ["@keyword.exception"] = { fg = palette.pine }, - - ["@keyword.conditional"] = { fg = palette.pine }, - ["@keyword.conditional.ternary"] = { fg = palette.pine }, - - ["@keyword.directive"] = { fg = palette.iris }, - ["@keyword.directive.define"] = { fg = palette.iris }, - - --- Punctuation - ["@punctuation.delimiter"] = { fg = palette.subtle }, - ["@punctuation.bracket"] = { fg = palette.subtle }, - ["@punctuation.special"] = { fg = palette.subtle }, - - --- Comments - ["@comment"] = { link = "Comment" }, - -- ["@comment.documentation"] = {}, - - ["@comment.error"] = { fg = groups.error }, - ["@comment.warning"] = { fg = groups.warn }, - ["@comment.todo"] = { fg = groups.todo, bg = groups.todo, blend = 15 }, - ["@comment.hint"] = { fg = groups.hint, bg = groups.hint, blend = 15 }, - ["@comment.info"] = { fg = groups.info, bg = groups.info, blend = 15 }, - ["@comment.note"] = { fg = groups.note, bg = groups.note, blend = 15 }, - - --- Markup - ["@markup.strong"] = { bold = styles.bold }, - ["@markup.italic"] = { italic = styles.italic }, - ["@markup.strikethrough"] = { strikethrough = true }, - ["@markup.underline"] = { underline = true }, - - ["@markup.heading"] = { fg = palette.foam, bold = styles.bold }, - - ["@markup.quote"] = { fg = palette.text }, - ["@markup.math"] = { link = "Special" }, - ["@markup.environment"] = { link = "Macro" }, - ["@markup.environment.name"] = { link = "@type" }, - - -- ["@markup.link"] = {}, - ["@markup.link.markdown_inline"] = { fg = palette.subtle }, - ["@markup.link.label.markdown_inline"] = { fg = palette.foam }, - ["@markup.link.url"] = { fg = groups.link }, - - -- ["@markup.raw"] = { bg = palette.surface }, - -- ["@markup.raw.block"] = { bg = palette.surface }, - ["@markup.raw.delimiter.markdown"] = { fg = palette.subtle }, - - ["@markup.list"] = { fg = palette.pine }, - ["@markup.list.checked"] = { fg = palette.foam, bg = palette.foam, blend = 10 }, - ["@markup.list.unchecked"] = { fg = palette.text }, - - -- Markdown headings - ["@markup.heading.1.markdown"] = { link = "markdownH1" }, - ["@markup.heading.2.markdown"] = { link = "markdownH2" }, - ["@markup.heading.3.markdown"] = { link = "markdownH3" }, - ["@markup.heading.4.markdown"] = { link = "markdownH4" }, - ["@markup.heading.5.markdown"] = { link = "markdownH5" }, - ["@markup.heading.6.markdown"] = { link = "markdownH6" }, - ["@markup.heading.1.marker.markdown"] = { link = "markdownH1Delimiter" }, - ["@markup.heading.2.marker.markdown"] = { link = "markdownH2Delimiter" }, - ["@markup.heading.3.marker.markdown"] = { link = "markdownH3Delimiter" }, - ["@markup.heading.4.marker.markdown"] = { link = "markdownH4Delimiter" }, - ["@markup.heading.5.marker.markdown"] = { link = "markdownH5Delimiter" }, - ["@markup.heading.6.marker.markdown"] = { link = "markdownH6Delimiter" }, - - ["@diff.plus"] = { fg = groups.git_add, bg = groups.git_add, blend = 20 }, - ["@diff.minus"] = { fg = groups.git_delete, bg = groups.git_delete, blend = 20 }, - ["@diff.delta"] = { bg = groups.git_change, blend = 20 }, - - ["@tag"] = { link = "Tag" }, - ["@tag.attribute"] = { fg = palette.iris }, - ["@tag.delimiter"] = { fg = palette.subtle }, - - --- Non-highlighting captures - -- ["@none"] = {}, - ["@conceal"] = { link = "Conceal" }, - ["@conceal.markdown"] = { fg = palette.subtle }, - - -- ["@spell"] = {}, - -- ["@nospell"] = {}, - - --- Semantic - ["@lsp.type.comment"] = {}, - ["@lsp.type.comment.c"] = { link = "@comment" }, - ["@lsp.type.comment.cpp"] = { link = "@comment" }, - ["@lsp.type.enum"] = { link = "@type" }, - ["@lsp.type.interface"] = { link = "@interface" }, - ["@lsp.type.keyword"] = { link = "@keyword" }, - ["@lsp.type.namespace"] = { link = "@namespace" }, - ["@lsp.type.namespace.python"] = { link = "@variable" }, - ["@lsp.type.parameter"] = { link = "@parameter" }, - ["@lsp.type.property"] = { link = "@property" }, - ["@lsp.type.variable"] = {}, -- defer to treesitter for regular variables - ["@lsp.type.variable.svelte"] = { link = "@variable" }, - ["@lsp.typemod.function.defaultLibrary"] = { link = "@function.builtin" }, - ["@lsp.typemod.operator.injected"] = { link = "@operator" }, - ["@lsp.typemod.string.injected"] = { link = "@string" }, - ["@lsp.typemod.variable.constant"] = { link = "@constant" }, - ["@lsp.typemod.variable.defaultLibrary"] = { link = "@variable.builtin" }, - ["@lsp.typemod.variable.injected"] = { link = "@variable" }, - - --- Plugins -- romgrk/barbar.nvim BufferCurrent = { fg = palette.text, bg = palette.overlay }, BufferCurrentIndex = { fg = palette.text, bg = palette.overlay }, @@ -452,9 +309,9 @@ local function set_highlights() BufferVisibleTarget = { fg = palette.gold }, -- lewis6991/gitsigns.nvim - GitSignsAdd = { fg = groups.git_add, bg = "NONE" }, - GitSignsChange = { fg = groups.git_change, bg = "NONE" }, - GitSignsDelete = { fg = groups.git_delete, bg = "NONE" }, + GitSignsAdd = { link = "SignAdd" }, + GitSignsChange = { link = "SignChange" }, + GitSignsDelete = { link = "SignDelete" }, SignAdd = { fg = groups.git_add, bg = "NONE" }, SignChange = { fg = groups.git_change, bg = "NONE" }, SignDelete = { fg = groups.git_delete, bg = "NONE" }, @@ -462,9 +319,7 @@ local function set_highlights() -- mvllow/modes.nvim ModesCopy = { bg = palette.gold }, ModesDelete = { bg = palette.love }, - ModesFormat = { bg = palette.rose }, ModesInsert = { bg = palette.foam }, - ModesReplace = { bg = palette.pine }, ModesVisual = { bg = palette.iris }, -- kyazdani42/nvim-tree.lua @@ -488,30 +343,10 @@ local function set_highlights() NvimTreeNormal = { link = "Normal" }, NvimTreeOpenedFile = { fg = palette.text, bg = palette.overlay }, NvimTreeOpenedFolderName = { link = "NvimTreeFolderName" }, - NvimTreeRootFolder = { fg = palette.foam, bold = styles.bold }, + NvimTreeRootFolder = make_title(), NvimTreeSpecialFile = { link = "NvimTreeNormal" }, NvimTreeWindowPicker = { link = "StatusLineTerm" }, - -- nvim-neotest/neotest - NeotestAdapterName = { fg = palette.iris }, - NeotestBorder = { fg = palette.highlight_med }, - NeotestDir = { fg = palette.foam }, - NeotestExpandMarker = { fg = palette.highlight_med }, - NeotestFailed = { fg = palette.love }, - NeotestFile = { fg = palette.text }, - NeotestFocused = { fg = palette.gold, bg = palette.highlight_med }, - NeotestIndent = { fg = palette.highlight_med }, - NeotestMarked = { fg = palette.rose, bold = styles.bold }, - NeotestNamespace = { fg = palette.gold }, - NeotestPassed = { fg = palette.pine }, - NeotestRunning = { fg = palette.gold }, - NeotestWinSelect = { fg = palette.muted }, - NeotestSkipped = { fg = palette.subtle }, - NeotestTarget = { fg = palette.love }, - NeotestTest = { fg = palette.gold }, - NeotestUnknown = { fg = palette.subtle }, - NeotestWatching = { fg = palette.iris }, - -- nvim-neo-tree/neo-tree.nvim NeoTreeGitAdded = { fg = groups.git_add }, NeoTreeGitConflict = { fg = groups.git_merge }, @@ -520,40 +355,20 @@ local function set_highlights() NeoTreeGitModified = { fg = groups.git_dirty }, NeoTreeGitRenamed = { fg = groups.git_rename }, NeoTreeGitUntracked = { fg = groups.git_untracked }, - NeoTreeTabActive = { fg = palette.text, bg = palette.overlay }, - NeoTreeTabInactive = { fg = palette.subtle }, - NeoTreeTabSeparatorActive = { link = "WinSeparator" }, - NeoTreeTabSeparatorInactive = { link = "WinSeparator" }, NeoTreeTitleBar = { link = "StatusLineTerm" }, - -- folke/flash.nvim - FlashLabel = { fg = palette.base, bg = palette.love }, - -- folke/which-key.nvim WhichKey = { fg = palette.iris }, - WhichKeyBorder = make_border(), WhichKeyDesc = { fg = palette.gold }, WhichKeyFloat = { bg = groups.panel }, WhichKeyGroup = { fg = palette.foam }, - WhichKeyIcon = { fg = palette.pine }, - WhichKeyIconAzure = { fg = palette.pine }, - WhichKeyIconBlue = { fg = palette.pine }, - WhichKeyIconCyan = { fg = palette.foam }, - WhichKeyIconGreen = { fg = palette.leaf }, - WhichKeyIconGrey = { fg = palette.subtle }, - WhichKeyIconOrange = { fg = palette.rose }, - WhichKeyIconPurple = { fg = palette.iris }, - WhichKeyIconRed = { fg = palette.love }, - WhichKeyIconYellow = { fg = palette.gold }, - WhichKeyNormal = { link = "NormalFloat" }, WhichKeySeparator = { fg = palette.subtle }, - WhichKeyTitle = { link = "FloatTitle" }, WhichKeyValue = { fg = palette.rose }, - -- lukas-reineke/indent-blankline.nvim - IblIndent = { fg = palette.overlay }, - IblScope = { fg = palette.foam }, - IblWhitespace = { fg = palette.overlay }, + -- luka-reineke/indent-blankline.nvim + IndentBlanklineChar = { fg = palette.muted, nocombine = true }, + IndentBlanklineSpaceChar = { fg = palette.muted, nocombine = true }, + IndentBlanklineSpaceCharBlankline = { fg = palette.muted, nocombine = true }, -- hrsh7th/nvim-cmp CmpItemAbbr = { fg = palette.subtle }, @@ -568,20 +383,10 @@ local function set_highlights() CmpItemKindSnippet = { link = "String" }, CmpItemKindVariable = { link = "Identifier" }, - -- NeogitOrg/neogit - -- https://github.com/NeogitOrg/neogit/blob/master/lua/neogit/lib/hl.lua#L109-L198 - NeogitChangeAdded = { fg = groups.git_add, bold = styles.bold, italic = styles.italic }, - NeogitChangeBothModified = { fg = groups.git_change, bold = styles.bold, italic = styles.italic }, - NeogitChangeCopied = { fg = groups.git_untracked, bold = styles.bold, italic = styles.italic }, - NeogitChangeDeleted = { fg = groups.git_delete, bold = styles.bold, italic = styles.italic }, - NeogitChangeModified = { fg = groups.git_change, bold = styles.bold, italic = styles.italic }, - NeogitChangeNewFile = { fg = groups.git_stage, bold = styles.bold, italic = styles.italic }, - NeogitChangeRenamed = { fg = groups.git_rename, bold = styles.bold, italic = styles.italic }, - NeogitChangeUpdated = { fg = groups.git_change, bold = styles.bold, italic = styles.italic }, + -- TimUntersberger/neogit NeogitDiffAddHighlight = { link = "DiffAdd" }, NeogitDiffContextHighlight = { bg = palette.surface }, NeogitDiffDeleteHighlight = { link = "DiffDelete" }, - NeogitFilePath = { fg = palette.foam, italic = styles.italic }, NeogitHunkHeader = { bg = groups.panel }, NeogitHunkHeaderHighlight = { bg = groups.panel }, @@ -611,12 +416,12 @@ local function set_highlights() NeorgHeading5Title = { link = "markdownH5" }, NeorgHeading6Prefix = { link = "markdownH6Delimiter" }, NeorgHeading6Title = { link = "markdownH6" }, - NeorgMarkerTitle = { fg = palette.foam, bold = styles.bold }, + NeorgMarkerTitle = make_title(), -- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim) DefinitionCount = { fg = palette.rose }, DefinitionIcon = { fg = palette.rose }, - DefinitionPreviewTitle = { fg = palette.rose, bold = styles.bold }, + DefintionPreviewTitle = { fg = palette.rose, bold = styles.bold }, LspFloatWinBorder = make_border(), LspFloatWinNormal = { bg = groups.panel }, LspSagaAutoPreview = { fg = palette.subtle }, @@ -626,7 +431,7 @@ local function set_highlights() LspSagaCodeActionTruncateLine = { link = "LspSagaCodeActionBorder" }, LspSagaDefPreviewBorder = make_border(), LspSagaDiagnosticBorder = make_border(palette.gold), - LspSagaDiagnosticHeader = { fg = palette.foam, bold = styles.bold }, + LspSagaDiagnosticHeader = make_title(), LspSagaDiagnosticTruncateLine = { link = "LspSagaDiagnosticBorder" }, LspSagaDocTruncateLine = { link = "LspSagaHoverBorder" }, LspSagaFinderSelection = { fg = palette.gold }, @@ -670,38 +475,30 @@ local function set_highlights() TelescopePromptPrefix = { fg = palette.subtle }, TelescopeSelection = { fg = palette.text, bg = palette.overlay }, TelescopeSelectionCaret = { fg = palette.rose, bg = palette.overlay }, - TelescopeTitle = { fg = palette.foam, bold = styles.bold }, + TelescopeTitle = make_title(), -- ibhagwan/fzf-lua - FzfLuaBorder = make_border(), - FzfLuaBufFlagAlt = { fg = palette.subtle }, - FzfLuaBufFlagCur = { fg = palette.subtle }, - FzfLuaCursorLine = { fg = palette.text, bg = palette.overlay }, - FzfLuaFilePart = { fg = palette.text }, - FzfLuaHeaderBind = { fg = palette.rose }, - FzfLuaHeaderText = { fg = palette.love }, FzfLuaNormal = { link = "NormalFloat" }, - FzfLuaTitle = { link = "FloatTitle" }, + FwzfLuaTitle = make_title(), + FzfLuaBorder = make_border(), + FzfLuaHeaderText = { fg = palette.love }, + FzfLuaHeaderBind = { fg = palette.rose }, + FzfLuaBufFlagCur = { fg = palette.subtle }, + FzfLuaBufFlagAlt = { fg = palette.subtle }, -- rcarriga/nvim-notify - NotifyBackground = { link = "NormalFloat" }, - NotifyDEBUGBody = { link = "NormalFloat" }, NotifyDEBUGBorder = make_border(), NotifyDEBUGIcon = { link = "NotifyDEBUGTitle" }, NotifyDEBUGTitle = { fg = palette.muted }, - NotifyERRORBody = { link = "NormalFloat" }, NotifyERRORBorder = make_border(groups.error), NotifyERRORIcon = { link = "NotifyERRORTitle" }, NotifyERRORTitle = { fg = groups.error }, - NotifyINFOBody = { link = "NormalFloat" }, NotifyINFOBorder = make_border(groups.info), NotifyINFOIcon = { link = "NotifyINFOTitle" }, NotifyINFOTitle = { fg = groups.info }, - NotifyTRACEBody = { link = "NormalFloat" }, NotifyTRACEBorder = make_border(palette.iris), NotifyTRACEIcon = { link = "NotifyTRACETitle" }, NotifyTRACETitle = { fg = palette.iris }, - NotifyWARNBody = { link = "NormalFloat" }, NotifyWARNBorder = make_border(groups.warn), NotifyWARNIcon = { link = "NotifyWARNTitle" }, NotifyWARNTitle = { fg = groups.warn }, @@ -723,7 +520,6 @@ local function set_highlights() DapUIThread = { fg = palette.gold }, DapUIValue = { fg = palette.text }, DapUIVariable = { fg = palette.text }, - DapUIType = { fg = palette.iris }, DapUIWatchesEmpty = { fg = palette.love }, DapUIWatchesError = { link = "DapUIWatchesEmpty" }, DapUIWatchesValue = { link = "DapUIThread" }, @@ -768,143 +564,9 @@ local function set_highlights() -- folke/noice.nvim NoiceCursor = { fg = palette.highlight_high, bg = palette.text }, - -- folke/trouble.nvim - TroubleText = { fg = palette.subtle }, - TroubleCount = { fg = palette.iris, bg = palette.surface }, - TroubleNormal = { fg = palette.text, bg = groups.panel }, - - -- echasnovski/mini.nvim - MiniAnimateCursor = { reverse = true, nocombine = true }, - MiniAnimateNormalFloat = { link = "NormalFloat" }, - - MiniClueBorder = { link = "FloatBorder" }, - MiniClueDescGroup = { link = "DiagnosticFloatingWarn" }, - MiniClueDescSingle = { link = "NormalFloat" }, - MiniClueNextKey = { link = "DiagnosticFloatingHint" }, - MiniClueNextKeyWithPostkeys = { link = "DiagnosticFloatingError" }, - MiniClueSeparator = { link = "DiagnosticFloatingInfo" }, - MiniClueTitle = { bg = groups.panel, bold = styles.bold }, - - MiniCompletionActiveParameter = { underline = true }, - - MiniCursorword = { underline = true }, - MiniCursorwordCurrent = { underline = true }, - - MiniDepsChangeAdded = { fg = groups.git_add }, - MiniDepsChangeRemoved = { fg = groups.git_delete }, - MiniDepsHint = { link = "DiagnosticHint" }, - MiniDepsInfo = { link = "DiagnosticInfo" }, - MiniDepsMsgBreaking = { link = "DiagnosticWarn" }, - MiniDepsPlaceholder = { link = "Comment" }, - MiniDepsTitle = { link = "Title" }, - MiniDepsTitleError = { link = "DiffDelete" }, - MiniDepsTitleSame = { link = "DiffText" }, - MiniDepsTitleUpdate = { link = "DiffAdd" }, - - MiniDiffOverAdd = { fg = groups.git_add, bg = groups.git_add, blend = 20 }, - MiniDiffOverChange = { fg = groups.git_change, bg = groups.git_change, blend = 20 }, - MiniDiffOverContext = { bg = palette.surface }, - MiniDiffOverDelete = { fg = groups.git_delete, bg = groups.git_delete, blend = 20 }, - MiniDiffSignAdd = { fg = groups.git_add }, - MiniDiffSignChange = { fg = groups.git_change }, - MiniDiffSignDelete = { fg = groups.git_delete }, - - MiniFilesBorder = { link = "FloatBorder" }, - MiniFilesBorderModified = { link = "DiagnosticFloatingWarn" }, - MiniFilesCursorLine = { link = "CursorLine" }, - MiniFilesDirectory = { link = "Directory" }, - MiniFilesFile = { fg = palette.text }, - MiniFilesNormal = { link = "NormalFloat" }, - MiniFilesTitle = { link = "FloatTitle" }, - MiniFilesTitleFocused = { fg = palette.rose, bg = groups.panel, bold = styles.bold }, - - MiniHipatternsFixme = { fg = palette.base, bg = groups.error, bold = styles.bold }, - MiniHipatternsHack = { fg = palette.base, bg = groups.warn, bold = styles.bold }, - MiniHipatternsNote = { fg = palette.base, bg = groups.info, bold = styles.bold }, - MiniHipatternsTodo = { fg = palette.base, bg = groups.hint, bold = styles.bold }, - - MiniIconsAzure = { fg = palette.foam }, - MiniIconsBlue = { fg = palette.pine }, - MiniIconsCyan = { fg = palette.foam }, - MiniIconsGreen = { fg = palette.leaf }, - MiniIconsGrey = { fg = palette.subtle }, - MiniIconsOrange = { fg = palette.rose }, - MiniIconsPurple = { fg = palette.iris }, - MiniIconsRed = { fg = palette.love }, - MiniIconsYellow = { fg = palette.gold }, - + -- echasnovski/mini.indentscope MiniIndentscopeSymbol = { fg = palette.muted }, - MiniIndentscopeSymbolOff = { fg = palette.gold }, - - MiniJump = { sp = palette.gold, undercurl = true }, - - MiniJump2dDim = { fg = palette.subtle }, - MiniJump2dSpot = { fg = palette.gold, bold = styles.bold, nocombine = true }, - MiniJump2dSpotAhead = { fg = palette.foam, bg = palette.surface, nocombine = true }, - MiniJump2dSpotUnique = { fg = palette.rose, bold = styles.bold, nocombine = true }, - - MiniMapNormal = { link = "NormalFloat" }, - MiniMapSymbolCount = { link = "Special" }, - MiniMapSymbolLine = { link = "Title" }, - MiniMapSymbolView = { link = "Delimiter" }, - - MiniNotifyBorder = { link = "FloatBorder" }, - MiniNotifyNormal = { link = "NormalFloat" }, - MiniNotifyTitle = { link = "FloatTitle" }, - - MiniOperatorsExchangeFrom = { link = "IncSearch" }, - - MiniPickBorder = { link = "FloatBorder" }, - MiniPickBorderBusy = { link = "DiagnosticFloatingWarn" }, - MiniPickBorderText = { bg = groups.panel }, - MiniPickIconDirectory = { link = "Directory" }, - MiniPickIconFile = { link = "MiniPickNormal" }, - MiniPickHeader = { link = "DiagnosticFloatingHint" }, - MiniPickMatchCurrent = { link = "CursorLine" }, - MiniPickMatchMarked = { link = "Visual" }, - MiniPickMatchRanges = { fg = palette.foam }, - MiniPickNormal = { link = "NormalFloat" }, - MiniPickPreviewLine = { link = "CursorLine" }, - MiniPickPreviewRegion = { link = "IncSearch" }, - MiniPickPrompt = { bg = groups.panel, bold = styles.bold }, - - MiniStarterCurrent = { nocombine = true }, - MiniStarterFooter = { fg = palette.subtle }, - MiniStarterHeader = { link = "Title" }, - MiniStarterInactive = { link = "Comment" }, - MiniStarterItem = { link = "Normal" }, - MiniStarterItemBullet = { link = "Delimiter" }, - MiniStarterItemPrefix = { link = "WarningMsg" }, - MiniStarterSection = { fg = palette.rose }, - MiniStarterQuery = { link = "MoreMsg" }, - - MiniStatuslineDevinfo = { fg = palette.subtle, bg = palette.overlay }, - MiniStatuslineFileinfo = { link = "MiniStatuslineDevinfo" }, - MiniStatuslineFilename = { fg = palette.muted, bg = palette.surface }, - MiniStatuslineInactive = { link = "MiniStatuslineFilename" }, - MiniStatuslineModeCommand = { fg = palette.base, bg = palette.love, bold = styles.bold }, - MiniStatuslineModeInsert = { fg = palette.base, bg = palette.foam, bold = styles.bold }, - MiniStatuslineModeNormal = { fg = palette.base, bg = palette.rose, bold = styles.bold }, - MiniStatuslineModeOther = { fg = palette.base, bg = palette.rose, bold = styles.bold }, - MiniStatuslineModeReplace = { fg = palette.base, bg = palette.pine, bold = styles.bold }, - MiniStatuslineModeVisual = { fg = palette.base, bg = palette.iris, bold = styles.bold }, - - MiniSurround = { link = "IncSearch" }, - - MiniTablineCurrent = { fg = palette.text, bg = palette.overlay, bold = styles.bold }, - MiniTablineFill = { link = "TabLineFill" }, - MiniTablineHidden = { fg = palette.subtle, bg = groups.panel }, - MiniTablineModifiedCurrent = { fg = palette.overlay, bg = palette.text, bold = styles.bold }, - MiniTablineModifiedHidden = { fg = groups.panel, bg = palette.subtle }, - MiniTablineModifiedVisible = { fg = groups.panel, bg = palette.text }, - MiniTablineTabpagesection = { link = "Search" }, - MiniTablineVisible = { fg = palette.text, bg = groups.panel }, - - MiniTestEmphasis = { bold = styles.bold }, - MiniTestFail = { fg = palette.love, bold = styles.bold }, - MiniTestPass = { fg = palette.foam, bold = styles.bold }, - - MiniTrailspace = { bg = palette.love }, + MiniIndentscopeSymbolOff = { fg = palette.muted }, -- goolord/alpha-nvim AlphaButtons = { fg = palette.foam }, @@ -914,275 +576,49 @@ local function set_highlights() -- github/copilot.vim CopilotSuggestion = { fg = palette.muted, italic = styles.italic }, - - -- nvim-treesitter/nvim-treesitter-context - TreesitterContext = { bg = palette.overlay }, - TreesitterContextLineNumber = { fg = palette.rose, bg = palette.overlay }, - - -- RRethy/vim-illuminate - IlluminatedWordRead = { link = "LspReferenceRead" }, - IlluminatedWordText = { link = "LspReferenceText" }, - IlluminatedWordWrite = { link = "LspReferenceWrite" }, - - -- HiPhish/rainbow-delimiters.nvim - RainbowDelimiterBlue = { fg = palette.pine }, - RainbowDelimiterCyan = { fg = palette.foam }, - RainbowDelimiterGreen = { fg = palette.leaf }, - RainbowDelimiterOrange = { fg = palette.rose }, - RainbowDelimiterRed = { fg = palette.love }, - RainbowDelimiterViolet = { fg = palette.iris }, - RainbowDelimiterYellow = { fg = palette.gold }, - - -- MeanderingProgrammer/render-markdown.nvim - RenderMarkdownBullet = { fg = palette.rose }, - RenderMarkdownChecked = { fg = palette.foam }, - RenderMarkdownCode = { bg = palette.overlay }, - RenderMarkdownCodeInline = { fg = palette.text, bg = palette.overlay }, - RenderMarkdownDash = { fg = palette.muted }, - RenderMarkdownH1Bg = { bg = groups.h1, blend = 20 }, - RenderMarkdownH2Bg = { bg = groups.h2, blend = 20 }, - RenderMarkdownH3Bg = { bg = groups.h3, blend = 20 }, - RenderMarkdownH4Bg = { bg = groups.h4, blend = 20 }, - RenderMarkdownH5Bg = { bg = groups.h5, blend = 20 }, - RenderMarkdownH6Bg = { bg = groups.h6, blend = 20 }, - RenderMarkdownQuote = { fg = palette.subtle }, - RenderMarkdownTableFill = { link = "Conceal" }, - RenderMarkdownTableHead = { fg = palette.subtle }, - RenderMarkdownTableRow = { fg = palette.subtle }, - RenderMarkdownUnchecked = { fg = palette.subtle }, - - -- MagicDuck/grug-far.nvim - GrugFarHelpHeader = { fg = palette.pine }, - GrugFarHelpHeaderKey = { fg = palette.gold }, - GrugFarHelpWinActionKey = { fg = palette.gold }, - GrugFarHelpWinActionPrefix = { fg = palette.foam }, - GrugFarHelpWinActionText = { fg = palette.pine }, - GrugFarHelpWinHeader = { link = "FloatTitle" }, - GrugFarInputLabel = { fg = palette.foam }, - GrugFarInputPlaceholder = { link = "Comment" }, - GrugFarResultsActionMessage = { fg = palette.foam }, - GrugFarResultsChangeIndicator = { fg = groups.git_change }, - GrugFarResultsRemoveIndicator = { fg = groups.git_delete }, - GrugFarResultsAddIndicator = { fg = groups.git_add }, - GrugFarResultsHeader = { fg = palette.pine }, - GrugFarResultsLineNo = { fg = palette.iris }, - GrugFarResultsLineColumn = { link = "GrugFarResultsLineNo" }, - GrugFarResultsMatch = { link = "CurSearch" }, - GrugFarResultsPath = { fg = palette.foam }, - GrugFarResultsStats = { fg = palette.iris }, - - -- yetone/avante.nvim - AvanteTitle = { fg = palette.highlight_high, bg = palette.rose }, - AvanteReversedTitle = { fg = palette.rose }, - AvanteSubtitle = { fg = palette.highlight_med, bg = palette.foam }, - AvanteReversedSubtitle = { fg = palette.foam }, - AvanteThirdTitle = { fg = palette.highlight_med, bg = palette.iris }, - AvanteReversedThirdTitle = { fg = palette.iris }, - AvantePromptInput = { fg = palette.text, bg = groups.panel }, - AvantePromptInputBorder = { fg = groups.border }, - - -- Saghen/blink.cmp - BlinkCmpDoc = { bg = palette.highlight_low }, - BlinkCmpDocSeparator = { bg = palette.highlight_low }, - BlinkCmpDocBorder = { fg = palette.highlight_high }, - BlinkCmpGhostText = { fg = palette.muted }, - - BlinkCmpLabel = { fg = palette.muted }, - BlinkCmpLabelDeprecated = { fg = palette.muted, strikethrough = true }, - BlinkCmpLabelMatch = { fg = palette.text, bold = styles.bold }, - - BlinkCmpDefault = { fg = palette.highlight_med }, - BlinkCmpKindText = { fg = palette.pine }, - BlinkCmpKindMethod = { fg = palette.foam }, - BlinkCmpKindFunction = { fg = palette.foam }, - BlinkCmpKindConstructor = { fg = palette.foam }, - BlinkCmpKindField = { fg = palette.pine }, - BlinkCmpKindVariable = { fg = palette.rose }, - BlinkCmpKindClass = { fg = palette.gold }, - BlinkCmpKindInterface = { fg = palette.gold }, - BlinkCmpKindModule = { fg = palette.foam }, - BlinkCmpKindProperty = { fg = palette.foam }, - BlinkCmpKindUnit = { fg = palette.pine }, - BlinkCmpKindValue = { fg = palette.love }, - BlinkCmpKindKeyword = { fg = palette.iris }, - BlinkCmpKindSnippet = { fg = palette.rose }, - BlinkCmpKindColor = { fg = palette.love }, - BlinkCmpKindFile = { fg = palette.foam }, - BlinkCmpKindReference = { fg = palette.love }, - BlinkCmpKindFolder = { fg = palette.foam }, - BlinkCmpKindEnum = { fg = palette.foam }, - BlinkCmpKindEnumMember = { fg = palette.foam }, - BlinkCmpKindConstant = { fg = palette.gold }, - BlinkCmpKindStruct = { fg = palette.foam }, - BlinkCmpKindEvent = { fg = palette.foam }, - BlinkCmpKindOperator = { fg = palette.foam }, - BlinkCmpKindTypeParameter = { fg = palette.iris }, - BlinkCmpKindCodeium = { fg = palette.foam }, - BlinkCmpKindCopilot = { fg = palette.foam }, - BlinkCmpKindSupermaven = { fg = palette.foam }, - BlinkCmpKindTabNine = { fg = palette.foam }, - - -- folke/snacks.nvim - SnacksIndent = { fg = palette.overlay }, - SnacksIndentChunk = { fg = palette.overlay }, - SnacksIndentBlank = { fg = palette.overlay }, - SnacksIndentScope = { fg = palette.foam }, - - SnacksPickerMatch = { fg = palette.rose, bold = styles.bold }, - - -- justinmk/vim-sneak - Sneak = { fg = palette.base, bg = palette.love }, - SneakCurrent = { link = "StatusLineTerm" }, - SneakScope = { link = "IncSearch" }, - - -- sindrets/diffview.nvim - DiffviewPrimary = { fg = palette.pine }, - DiffviewSecondary = { fg = palette.foam }, - DiffviewNormal = { fg = palette.text, bg = palette.surface }, - DiffviewWinSeparator = { fg = palette.text, bg = palette.surface }, - - DiffviewFilePanelTitle = { fg = palette.foam, bold = styles.bold }, - DiffviewFilePanelCounter = { fg = palette.rose }, - DiffviewFilePanelRootPath = { fg = palette.foam, bold = styles.bold }, - DiffviewFilePanelFileName = { fg = palette.text }, - DiffviewFilePanelSelected = { fg = palette.gold }, - DiffviewFilePanelPath = { link = "Comment" }, - - DiffviewFilePanelInsertions = { fg = groups.git_add }, - DiffviewFilePanelDeletions = { fg = groups.git_delete }, - DiffviewFilePanelConflicts = { fg = groups.git_merge }, - DiffviewFolderName = { fg = palette.foam, bold = styles.bold }, - DiffviewFolderSign = { fg = palette.subtle }, - DiffviewHash = { fg = palette.rose }, - DiffviewReference = { fg = palette.foam, bold = styles.bold }, - DiffviewReflogSelector = { fg = palette.rose }, - DiffviewStatusAdded = { fg = groups.git_add }, - DiffviewStatusUntracked = { fg = groups.untracked }, - DiffviewStatusModified = { fg = groups.git_change }, - DiffviewStatusRenamed = { fg = groups.git_rename }, - DiffviewStatusCopied = { fg = groups.untracked }, - DiffviewStatusTypeChange = { fg = groups.git_change }, - DiffviewStatusUnmerged = { fg = groups.git_change }, - DiffviewStatusUnknown = { fg = groups.git_delete }, - DiffviewStatusDeleted = { fg = groups.git_delete }, - DiffviewStatusBroken = { fg = groups.git_delete }, - DiffviewStatusIgnored = { fg = groups.git_ignore }, } + local transparency_highlights = { DiagnosticVirtualTextError = { fg = groups.error }, DiagnosticVirtualTextHint = { fg = groups.hint }, DiagnosticVirtualTextInfo = { fg = groups.info }, - DiagnosticVirtualTextOk = { fg = groups.ok }, DiagnosticVirtualTextWarn = { fg = groups.warn }, FloatBorder = { fg = palette.muted, bg = "NONE" }, - FloatTitle = { fg = palette.foam, bg = "NONE", bold = styles.bold }, Folded = { fg = palette.text, bg = "NONE" }, NormalFloat = { bg = "NONE" }, - Normal = { fg = palette.text, bg = "NONE" }, NormalNC = { fg = palette.text, bg = config.options.dim_inactive_windows and palette._nc or "NONE" }, Pmenu = { fg = palette.subtle, bg = "NONE" }, PmenuKind = { fg = palette.foam, bg = "NONE" }, SignColumn = { fg = palette.text, bg = "NONE" }, StatusLine = { fg = palette.subtle, bg = "NONE" }, StatusLineNC = { fg = palette.muted, bg = "NONE" }, - TabLine = { bg = "NONE", fg = palette.subtle }, TabLineFill = { bg = "NONE" }, TabLineSel = { fg = palette.text, bg = "NONE", bold = styles.bold }, - -- ["@markup.raw"] = { bg = "none" }, - ["@markup.raw.markdown_inline"] = { fg = palette.gold }, - -- ["@markup.raw.block"] = { bg = "none" }, - TelescopeNormal = { fg = palette.subtle, bg = "NONE" }, TelescopePromptNormal = { fg = palette.text, bg = "NONE" }, TelescopeSelection = { fg = palette.text, bg = "NONE", bold = styles.bold }, - TelescopeSelectionCaret = { fg = palette.rose }, - - TroubleNormal = { bg = "NONE" }, + TelescopeSelectionCaret = { fg = palette.rose, bg = palette.rose }, WhichKeyFloat = { bg = "NONE" }, - WhichKeyNormal = { bg = "NONE" }, - - IblIndent = { fg = palette.overlay, bg = "NONE" }, - IblScope = { fg = palette.foam, bg = "NONE" }, - IblWhitespace = { fg = palette.overlay, bg = "NONE" }, - - TreesitterContext = { bg = "NONE" }, - TreesitterContextLineNumber = { fg = palette.rose, bg = "NONE" }, - - MiniFilesTitleFocused = { fg = palette.rose, bg = "NONE", bold = styles.bold }, - - MiniPickPrompt = { bg = "NONE", bold = styles.bold }, - MiniPickBorderText = { bg = "NONE" }, } - if config.options.enable.legacy_highlights then - for group, highlight in pairs(legacy_highlights) do - highlights[group] = highlight - end - end - for group, highlight in pairs(default_highlights) do - highlights[group] = highlight - end if styles.transparency then for group, highlight in pairs(transparency_highlights) do highlights[group] = highlight end end - -- Reconcile highlights with config - if config.options.highlight_groups ~= nil and next(config.options.highlight_groups) ~= nil then - for group, highlight in pairs(config.options.highlight_groups) do - local existing = highlights[group] or {} - -- Traverse link due to - -- "If link is used in combination with other attributes; only the link will take effect" - -- see: https://neovim.io/doc/user/api.html#nvim_set_hl() - while existing.link ~= nil do - existing = highlights[existing.link] or {} - end - local parsed = vim.tbl_extend("force", {}, highlight) - - if highlight.fg ~= nil then - parsed.fg = utilities.parse_color(highlight.fg) or highlight.fg - end - if highlight.bg ~= nil then - parsed.bg = utilities.parse_color(highlight.bg) or highlight.bg - end - if highlight.sp ~= nil then - parsed.sp = utilities.parse_color(highlight.sp) or highlight.sp - end - - if (highlight.inherit == nil or highlight.inherit) and existing ~= nil then - parsed.inherit = nil - highlights[group] = vim.tbl_extend("force", existing, parsed) - else - parsed.inherit = nil - highlights[group] = parsed - end - end + for group, options in pairs(config.options.highlight_groups) do + highlights[group] = vim.tbl_extend("force", highlights[group] or {}, options) end for group, highlight in pairs(highlights) do - if config.options.before_highlight ~= nil then - config.options.before_highlight(group, highlight, palette) - end - - if highlight.blend ~= nil and (highlight.blend >= 0 and highlight.blend <= 100) and highlight.bg ~= nil then - highlight.bg = utilities.blend(highlight.bg, highlight.blend_on or palette.base, highlight.blend / 100) - end - - highlight.blend = nil - highlight.blend_on = nil - - if highlight._nvim_blend ~= nil then - highlight.blend = highlight._nvim_blend - end - - vim.api.nvim_set_hl(0, group, highlight) + config.options.before_highlight(group, highlight, palette) + utilities.highlight(group, highlight) end - --- Terminal if config.options.enable.terminal then vim.g.terminal_color_0 = palette.overlay -- black vim.g.terminal_color_8 = palette.subtle -- bright black @@ -1203,13 +639,9 @@ local function set_highlights() -- Support StatusLineTerm & StatusLineTermNC from vim vim.cmd([[ - augroup rose-pine - autocmd! - autocmd TermOpen * if &buftype=='terminal' - \|setlocal winhighlight=StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC - \|else|setlocal winhighlight=|endif - autocmd ColorSchemePre * autocmd! rose-pine - augroup END + autocmd TermOpen * if &buftype=='terminal' + \|setlocal winhighlight=StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC + \|else|setlocal winhighlight=|endif ]]) end end @@ -1225,12 +657,6 @@ function M.colorscheme(variant) end vim.g.colors_name = "rose-pine" - if variant == "dawn" then - vim.o.background = "light" - elseif variant == "main" or variant == "moon" then - vim.o.background = "dark" - end - set_highlights() end diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index bbc9967..6fc0774 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -1,7 +1,7 @@ ---@alias Variant "main" | "moon" | "dawn" ---@alias Palette { base: string, surface: string, overlay: string, muted: string, subtle: string, text: string, love: string, gold: string, rose: string, pine: string, foam: string, iris: string } ---@alias PaletteColor "base" | "surface" | "overlay" | "muted" | "subtle" | "text" | "love" | "gold" | "rose" | "pine" | "foam" | "iris" | "highlight_low" | "highlight_med" | "highlight_high" ----@alias Highlight { link: string, inherit: boolean } | { fg: string, bg: string, sp: string, bold: boolean, italic: boolean, undercurl: boolean, underline: boolean, underdouble: boolean, underdotted: boolean, underdashed: boolean, strikethrough: boolean, inherit: boolean } +---@alias Highlight { fg: string, bg: string, sp: string, bold: boolean, italic: boolean, undercurl: boolean, underline: boolean, underdouble: boolean, underdotted: boolean, underdashed: boolean, strikethrough: boolean } local config = {} @@ -21,12 +21,11 @@ config.options = { ---Extend background behind borders. Appearance differs based on which ---border characters you are using. - extend_background_behind_borders = true, + extend_background_behind_borders = false, enable = { - legacy_highlights = true, - migrations = true, terminal = true, + migrations = true, }, styles = { @@ -35,9 +34,6 @@ config.options = { transparency = false, }, - ---@type table> - palette = {}, - ---@type table groups = { border = "muted", @@ -47,10 +43,7 @@ config.options = { error = "love", hint = "iris", info = "foam", - ok = "leaf", warn = "gold", - note = "pine", - todo = "rose", git_add = "foam", git_change = "rose", @@ -63,13 +56,15 @@ config.options = { git_text = "rose", git_untracked = "subtle", - ---@type string | PaletteColor - h1 = "iris", - h2 = "foam", - h3 = "rose", - h4 = "gold", - h5 = "pine", - h6 = "leaf", + ---@type string | PaletteColor | table + headings = { + h1 = "iris", + h2 = "foam", + h3 = "rose", + h4 = "gold", + h5 = "pine", + h6 = "foam", + }, ---@deprecated Replaced by `options.highlight_groups["Normal"]` -- background = "base", @@ -77,8 +72,6 @@ config.options = { -- comment = "subtle", ---@deprecated Replaced by `options.highlight_groups["@punctuation"]` -- punctuation = "muted", - ---@deprecated Expects a table with values h1...h6 - -- headings = "text", }, ---@type table @@ -105,13 +98,7 @@ config.options = { local function migrate(options) if options.bold_vert_split then - local border = options.groups.border or "muted" - options.highlight_groups["VertSplit"] = { fg = border, bg = border } - options.highlight_groups["WinSeparator"] = { fg = border, bg = border } - end - - if options.disable_background then - options.highlight_groups["Normal"] = { bg = "NONE" } + options.highlight_groups["VertSplit"] = { fg = "muted", bg = "muted" } end if options.disable_float_background then @@ -132,34 +119,27 @@ local function migrate(options) options.highlight_groups["@punctuation"] = { fg = options.groups.punctuation } end - options.styles.transparency = (options.disable_background and options.disable_float_background) - or options.styles.transparency + options.styles.transparency = options.disable_background or options.styles.transparency -- These never actually existed, but may be set intuitively by the user -- because of `disable_italics` existing. - options.styles.bold = not (options.disable_bold or options.disable_bolds) and options.styles.bold or false + options.styles.bold = (options.disable_bold or options.disable_bolds) and false or options.styles.bold -- Similar to bold options, `disable_italic` never existed but could be a -- common typo of the actual `disable_italics`. - options.styles.italic = not (options.disable_italic or options.disable_italics) and options.styles.italic or false + options.styles.italic = (options.disable_italic or options.disable_italics) and false or options.styles.italic -- Set h1 through h6 to the same color if only one is specified if type(options.groups.headings) == "string" then - options.groups.h1 = options.groups.headings - options.groups.h2 = options.groups.headings - options.groups.h3 = options.groups.headings - options.groups.h4 = options.groups.headings - options.groups.h5 = options.groups.headings - options.groups.h6 = options.groups.headings - elseif options.groups.headings == "table" then - options.groups.h1 = options.groups.headings.h1 or options.groups.h1 - options.groups.h2 = options.groups.headings.h2 or options.groups.h2 - options.groups.h3 = options.groups.headings.h3 or options.groups.h3 - options.groups.h4 = options.groups.headings.h4 or options.groups.h4 - options.groups.h5 = options.groups.headings.h5 or options.groups.h5 - options.groups.h6 = options.groups.headings.h6 or options.groups.h6 + options.groups.headings = { + h1 = options.groups.headings, + h2 = options.groups.headings, + h3 = options.groups.headings, + h4 = options.groups.headings, + h5 = options.groups.headings, + h6 = options.groups.headings, + } end - options.groups.headings = nil return options end diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index cfefd65..6b49f68 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -11,14 +11,12 @@ local variants = { love = "#eb6f92", gold = "#f6c177", rose = "#ebbcba", - pine = "#31748f", + pine = "#3e8fb0", foam = "#9ccfd8", iris = "#c4a7e7", - leaf = "#95b1ac", highlight_low = "#21202e", highlight_med = "#403d52", highlight_high = "#524f67", - none = "NONE", }, moon = { _nc = "#1f1d30", @@ -34,11 +32,9 @@ local variants = { pine = "#3e8fb0", foam = "#9ccfd8", iris = "#c4a7e7", - leaf = "#95b1ac", highlight_low = "#2a283e", highlight_med = "#44415a", highlight_high = "#56526e", - none = "NONE", }, dawn = { _nc = "#f8f0e7", @@ -54,23 +50,12 @@ local variants = { pine = "#286983", foam = "#56949f", iris = "#907aa9", - leaf = "#6d8f89", highlight_low = "#f4ede8", highlight_med = "#dfdad9", highlight_high = "#cecacd", - none = "NONE", }, } -if options.palette ~= nil and next(options.palette) then - -- handle variant specific overrides - for variant_name, override_palette in pairs(options.palette) do - if variants[variant_name] then - variants[variant_name] = vim.tbl_extend("force", variants[variant_name], override_palette or {}) - end - end -end - if variants[options.variant] ~= nil then return variants[options.variant] end diff --git a/lua/rose-pine/plugins/bufferline.lua b/lua/rose-pine/plugins/bufferline.lua index 7a96026..9f85ccd 100644 --- a/lua/rose-pine/plugins/bufferline.lua +++ b/lua/rose-pine/plugins/bufferline.lua @@ -2,43 +2,43 @@ --- https://github.com/akinsho/bufferline.nvim --- --- @usage ---- local highlights = require("rose-pine.plugins.bufferline") ---- require("bufferline").setup({ highlights = highlights }) +--- local highlights = require('rose-pine.plugins.bufferline') +--- require('bufferline').setup({ highlights = highlights }) local p = require("rose-pine.palette") return { -- fill = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- background = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- tab = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, tab_selected = { fg = p.text, bg = p.overlay, }, -- tab_close = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- close_button = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- close_button_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- close_button_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, buffer_visible = { fg = p.subtle, @@ -51,172 +51,172 @@ return { italic = true, }, -- diagnostic = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- diagnostic_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- diagnostic_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, -- }, -- info = { - -- fg = "", - -- sp = "", - -- bg = "", + -- fg = '', + -- sp = '', + -- bg = '', -- }, -- info_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- info_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, - -- sp = "", + -- sp = '', -- }, -- info_diagnostic = { - -- fg = "", - -- sp = "", - -- bg = "", + -- fg = '', + -- sp = '', + -- bg = '', -- }, -- info_diagnostic_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- info_diagnostic_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, - -- sp = "", + -- sp = '', -- }, -- warning = { - -- fg = "", - -- sp = "", - -- bg = "", + -- fg = '', + -- sp = '', + -- bg = '', -- }, -- warning_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- warning_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, - -- sp = "", + -- sp = '', -- }, -- warning_diagnostic = { - -- fg = "", - -- sp = "", - -- bg = "", + -- fg = '', + -- sp = '', + -- bg = '', -- }, -- warning_diagnostic_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- warning_diagnostic_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, -- sp = warning_diagnostic_fg, -- }, -- error = { - -- fg = "", - -- bg = "", - -- sp = "", + -- fg = '', + -- bg = '', + -- sp = '', -- }, -- error_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- error_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, - -- sp = "", + -- sp = '', -- }, -- error_diagnostic = { - -- fg = "", - -- bg = "", - -- sp = "", + -- fg = '', + -- bg = '', + -- sp = '', -- }, -- error_diagnostic_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- error_diagnostic_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, - -- sp = "", + -- sp = '', -- }, -- modified = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- modified_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- modified_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- duplicate_selected = { - -- fg = "", + -- fg = '', -- italic = true, - -- bg = "", + -- bg = '', -- }, -- duplicate_visible = { - -- fg = "", + -- fg = '', -- italic = true, - -- bg = "", + -- bg = '', -- }, -- duplicate = { - -- fg = "", + -- fg = '', -- italic = true, - -- bg = "", + -- bg = '', -- }, -- separator_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- separator_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- separator = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- indicator_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- }, -- pick_selected = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- italic = true, -- }, -- pick_visible = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, -- }, -- pick = { - -- fg = "", - -- bg = "", + -- fg = '', + -- bg = '', -- bold = true, -- italic = true, -- }, diff --git a/lua/rose-pine/plugins/galaxyline.lua b/lua/rose-pine/plugins/galaxyline.lua index 05d9b28..f2c01ab 100644 --- a/lua/rose-pine/plugins/galaxyline.lua +++ b/lua/rose-pine/plugins/galaxyline.lua @@ -2,7 +2,7 @@ --- https://github.com/NTBBloodbath/galaxyline.nvim --- --- @usage ---- local highlights = require("rose-pine.plugins.galaxyline") +--- local highlights = require('rose-pine.plugins.galaxyline') local p = require("rose-pine.palette") diff --git a/lua/rose-pine/plugins/markid.lua b/lua/rose-pine/plugins/markid.lua index 3d6d8f9..2a7b273 100644 --- a/lua/rose-pine/plugins/markid.lua +++ b/lua/rose-pine/plugins/markid.lua @@ -2,7 +2,7 @@ --- https://github.com/David-Kunz/markid --- --- @usage ---- local highlights = require("rose-pine.plugins.markid") +--- local highlights = require('rose-pine.plugins.markid') --- require("nvim-treesitter.configs").setup({ markid = { enable = true, colors = highlights } }) local p = require("rose-pine.palette") diff --git a/lua/rose-pine/plugins/obsidian.lua b/lua/rose-pine/plugins/obsidian.lua deleted file mode 100644 index 43cc3b3..0000000 --- a/lua/rose-pine/plugins/obsidian.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- Rosé Pine for Obsidian(epwalsh) ---- https://github.com/epwalsh/obsidian.nvim ---- ---- @usage ---- local highlights = require("rose-pine.plugins.obsidian") ---- require("obsidian").setup({ ui = {hl_groups = highlights} }) - -local p = require("rose-pine.palette") - -return { - ObsidianBullet = { fg = p.muted }, - ObsidianRefText = { underline = true, fg = p.iris }, - ObsidianDone = { bold = true, fg = p.foam } -} diff --git a/lua/rose-pine/plugins/toggleterm.lua b/lua/rose-pine/plugins/toggleterm.lua index 7f808eb..87b0abc 100644 --- a/lua/rose-pine/plugins/toggleterm.lua +++ b/lua/rose-pine/plugins/toggleterm.lua @@ -2,8 +2,8 @@ --- https://github.com/akinsho/toggleterm.nvim --- --- @usage ---- local highlights = require("rose-pine.plugins.toggleterm") ---- require("toggleterm").setup({ highlights = highlights }) +--- local highlights = require('rose-pine.plugins.toggleterm') +--- require('toggleterm').setup({ highlights = highlights }) return { Normal = { link = "Normal" }, diff --git a/lua/rose-pine/utilities.lua b/lua/rose-pine/utilities.lua index 32a8575..e4c72cc 100644 --- a/lua/rose-pine/utilities.lua +++ b/lua/rose-pine/utilities.lua @@ -14,17 +14,10 @@ local function color_to_rgb(color) return { byte(new_color, 16), byte(new_color, 8), byte(new_color, 0) } end -local color_cache = {} - ---@param color string Palette key or hex value -function utilities.parse_color(color) - if color_cache[color] then - return color_cache[color] - end - +local function parse_color(color) if color == nil then - print("Invalid color: " .. color) - return nil + return print("Invalid color") end color = color:lower() @@ -33,21 +26,13 @@ function utilities.parse_color(color) color = require("rose-pine.palette")[color] or vim.api.nvim_get_color_by_name(color) end - color_cache[color] = color return color end -local blend_cache = {} - ---@param fg string Foreground color ---@param bg string Background color ---@param alpha number Between 0 (background) and 1 (foreground) -function utilities.blend(fg, bg, alpha) - local cache_key = fg .. bg .. alpha - if blend_cache[cache_key] then - return blend_cache[cache_key] - end - +local function blend(fg, bg, alpha) local fg_rgb = color_to_rgb(fg) local bg_rgb = color_to_rgb(bg) @@ -56,10 +41,26 @@ function utilities.blend(fg, bg, alpha) return math.floor(math.min(math.max(0, ret), 255) + 0.5) end - local result = string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3)) + return string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3)) +end - blend_cache[cache_key] = result - return result +---@param group string +---@param highlight table +function utilities.highlight(group, highlight, blend_on) + local fg = highlight.fg and parse_color(highlight.fg) or "NONE" + local bg = highlight.bg and parse_color(highlight.bg) or "NONE" + local sp = highlight.sp and parse_color(highlight.sp) or "NONE" + + if highlight.blend ~= nil and (highlight.blend >= 0 and highlight.blend <= 100) and bg ~= nil then + bg = blend(bg, blend_on or require("rose-pine.palette").base, highlight.blend / 100) + end + + highlight.fg = fg + highlight.bg = bg + highlight.sp = sp + -- highlight = vim.tbl_extend("force", highlight, { fg = fg, bg = bg, sp = sp }) + + vim.api.nvim_set_hl(0, group, highlight) end return utilities diff --git a/readme.md b/readme.md index 6ef48bc..343a587 100644 --- a/readme.md +++ b/readme.md @@ -13,33 +13,18 @@ ## Getting started -Install `rose-pine/neovim` using your favourite package manager: +Install `rose-pine/neovim` using your favourite plugin manager: -### [pam.nvim](https://github.com/mvllow/pam.nvim) +**paq-nvim** ```lua -{ source = "rose-pine/neovim", as = "rose-pine" } +{ 'rose-pine/neovim', as = 'rose-pine' } ``` -### [lazy.nvim](https://lazy.folke.io/installation) - -**Structured Setup** +**lazy.nvim** ```lua --- lua/plugins/rose-pine.lua -return { - "rose-pine/neovim", - name = "rose-pine", - config = function() - vim.cmd("colorscheme rose-pine") - end -} -``` - -**Single file** - -```lua -{ "rose-pine/neovim", name = "rose-pine" } +{ 'rose-pine/neovim', name = 'rose-pine' } ``` ## Gallery @@ -66,17 +51,11 @@ Rosé Pine has three variants: main, moon, and dawn. By default, `vim.o.backgrou Colour values accept named colours from the [Rosé Pine palette](https://rosepinetheme.com/palette/ingredients/), e.g. "foam", or valid hex, e.g. "#fa8072". ```lua -require("rose-pine").setup({ +require('rose-pine').setup({ variant = "auto", -- auto, main, moon, or dawn dark_variant = "main", -- main, moon, or dawn dim_inactive_windows = false, - extend_background_behind_borders = true, - - enable = { - terminal = true, - legacy_highlights = true, -- Improve compatibility for previous versions of Neovim - migrations = true, -- Handle deprecated options automatically - }, + extend_background_behind_borders = false, styles = { bold = true, @@ -92,8 +71,6 @@ require("rose-pine").setup({ error = "love", hint = "iris", info = "foam", - note = "pine", - todo = "rose", warn = "gold", git_add = "foam", @@ -107,29 +84,21 @@ require("rose-pine").setup({ git_text = "rose", git_untracked = "subtle", - h1 = "iris", - h2 = "foam", - h3 = "rose", - h4 = "gold", - h5 = "pine", - h6 = "foam", + headings = { + h1 = "iris", + h2 = "foam", + h3 = "rose", + h4 = "gold", + h5 = "pine", + h6 = "foam", + }, + -- Alternatively, set all headings at once. + -- headings = "subtle", }, - palette = { - -- Override the builtin palette per variant - -- moon = { - -- base = '#18191a', - -- overlay = '#363738', - -- }, - }, - - -- NOTE: Highlight groups are extended (merged) by default. Disable this - -- per group via `inherit = false` highlight_groups = { -- Comment = { fg = "foam" }, - -- StatusLine = { fg = "love", bg = "love", blend = 15 }, -- VertSplit = { fg = "muted", bg = "muted" }, - -- Visual = { fg = "base", bg = "text", inherit = false }, }, before_highlight = function(group, highlight, palette) @@ -145,10 +114,10 @@ require("rose-pine").setup({ end, }) -vim.cmd("colorscheme rose-pine") --- vim.cmd("colorscheme rose-pine-main") --- vim.cmd("colorscheme rose-pine-moon") --- vim.cmd("colorscheme rose-pine-dawn") +vim.cmd('colorscheme rose-pine') +-- vim.cmd('colorscheme rose-pine-main') +-- vim.cmd('colorscheme rose-pine-moon') +-- vim.cmd('colorscheme rose-pine-dawn') ``` > [!NOTE] @@ -156,6 +125,6 @@ vim.cmd("colorscheme rose-pine") ## Contributing -We welcome and appreciate contributions of any kind. Create an issue or start a discussion for any proposed changes. Pull requests are encouraged for supporting additional plugins or [treesitter improvements](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights). +We welcome and appreciate contributions of any kind. Create an issue or start a discussion for any proposed changes. Pull requests are encouraged for supporting additional plugins. Feel free to update the [wiki](https://github.com/rose-pine/neovim/wiki/) with any [recipes](https://github.com/rose-pine/neovim/wiki/Recipes).