mirror of
https://github.com/rose-pine/neovim.git
synced 2025-10-15 12:38:53 +02:00
705 lines
30 KiB
Lua
705 lines
30 KiB
Lua
local M = {}
|
|
local config = require("rose-pine.config")
|
|
|
|
local function set_highlights()
|
|
local utilities = require("rose-pine.utilities")
|
|
local palette = require("rose-pine.palette")
|
|
local styles = config.options.styles
|
|
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",
|
|
}
|
|
end
|
|
|
|
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.text, 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 = { fg = groups.border },
|
|
Visual = { bg = palette.highlight_med },
|
|
-- VisualNOS = {},
|
|
WarningMsg = { fg = groups.warn, bold = styles.bold },
|
|
-- Whitespace = {},
|
|
WildMenu = { link = "IncSearch" },
|
|
WinSeparator = { fg = groups.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" },
|
|
["@punctuation.special"] = { link = "@punctuation" },
|
|
["@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 },
|
|
["@text.diff.delete"] = { fg = groups.git_delete, bg = groups.git_delete, blend = 20 },
|
|
["@text.emphasis"] = { italic = styles.italic },
|
|
["@text.environment"] = { link = "Macro" },
|
|
["@text.environment.name"] = { link = "Type" },
|
|
["@text.math"] = { link = "Special" },
|
|
["@text.note"] = { link = "SpecialComment" },
|
|
["@text.strike"] = { strikethrough = true },
|
|
["@text.strong"] = { bold = styles.bold },
|
|
["@text.title"] = { link = "Title" },
|
|
["@text.title.1.markdown"] = { link = "markdownH1" },
|
|
["@text.title.1.marker.markdown"] = { link = "markdownH1Delimiter" },
|
|
["@text.title.2.markdown"] = { link = "markdownH2" },
|
|
["@text.title.2.marker.markdown"] = { link = "markdownH2Delimiter" },
|
|
["@text.title.3.markdown"] = { link = "markdownH3" },
|
|
["@text.title.3.marker.markdown"] = { link = "markdownH3Delimiter" },
|
|
["@text.title.4.markdown"] = { link = "markdownH4" },
|
|
["@text.title.4.marker.markdown"] = { link = "markdownH4Delimiter" },
|
|
["@text.title.5.markdown"] = { link = "markdownH5" },
|
|
["@text.title.5.marker.markdown"] = { link = "markdownH5Delimiter" },
|
|
["@text.title.6.markdown"] = { link = "markdownH6" },
|
|
["@text.title.6.marker.markdown"] = { link = "markdownH6Delimiter" },
|
|
["@text.underline"] = { underline = true },
|
|
["@text.uri"] = { fg = groups.link },
|
|
["@text.warning"] = { fg = groups.warn },
|
|
["@todo"] = { link = "Todo" },
|
|
["@type"] = { link = "Type" },
|
|
["@variable"] = { fg = palette.text, italic = styles.italic },
|
|
["@variable.builtin"] = { fg = palette.love },
|
|
|
|
-- romgrk/barbar.nvim
|
|
BufferCurrent = { fg = palette.text, bg = palette.overlay },
|
|
BufferCurrentIndex = { fg = palette.text, bg = palette.overlay },
|
|
BufferCurrentMod = { fg = palette.foam, bg = palette.overlay },
|
|
BufferCurrentSign = { fg = palette.subtle, bg = palette.overlay },
|
|
BufferCurrentTarget = { fg = palette.gold, bg = palette.overlay },
|
|
BufferInactive = { fg = palette.subtle },
|
|
BufferInactiveIndex = { fg = palette.subtle },
|
|
BufferInactiveMod = { fg = palette.foam },
|
|
BufferInactiveSign = { fg = palette.muted },
|
|
BufferInactiveTarget = { fg = palette.gold },
|
|
BufferTabpageFill = { fg = "NONE", bg = "NONE" },
|
|
BufferVisible = { fg = palette.subtle },
|
|
BufferVisibleIndex = { fg = palette.subtle },
|
|
BufferVisibleMod = { fg = palette.foam },
|
|
BufferVisibleSign = { fg = palette.muted },
|
|
BufferVisibleTarget = { fg = palette.gold },
|
|
|
|
-- lewis6991/gitsigns.nvim
|
|
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" },
|
|
|
|
-- mvllow/modes.nvim
|
|
ModesCopy = { bg = palette.gold },
|
|
ModesDelete = { bg = palette.love },
|
|
ModesInsert = { bg = palette.foam },
|
|
ModesVisual = { bg = palette.iris },
|
|
|
|
-- kyazdani42/nvim-tree.lua
|
|
NvimTreeEmptyFolderName = { fg = palette.muted },
|
|
NvimTreeFileDeleted = { fg = groups.git_delete },
|
|
NvimTreeFileDirty = { fg = groups.git_dirty },
|
|
NvimTreeFileMerge = { fg = groups.git_merge },
|
|
NvimTreeFileNew = { fg = palette.foam },
|
|
NvimTreeFileRenamed = { fg = groups.git_rename },
|
|
NvimTreeFileStaged = { fg = groups.git_stage },
|
|
NvimTreeFolderIcon = { fg = palette.subtle },
|
|
NvimTreeFolderName = { fg = palette.foam },
|
|
NvimTreeGitDeleted = { fg = groups.git_delete },
|
|
NvimTreeGitDirty = { fg = groups.git_dirty },
|
|
NvimTreeGitIgnored = { fg = groups.git_ignore },
|
|
NvimTreeGitMerge = { fg = groups.git_merge },
|
|
NvimTreeGitNew = { fg = groups.git_add },
|
|
NvimTreeGitRenamed = { fg = groups.git_rename },
|
|
NvimTreeGitStaged = { fg = groups.git_stage },
|
|
NvimTreeImageFile = { fg = palette.text },
|
|
NvimTreeNormal = { link = "Normal" },
|
|
NvimTreeOpenedFile = { fg = palette.text, bg = palette.overlay },
|
|
NvimTreeOpenedFolderName = { link = "NvimTreeFolderName" },
|
|
NvimTreeRootFolder = make_title(),
|
|
NvimTreeSpecialFile = { link = "NvimTreeNormal" },
|
|
NvimTreeWindowPicker = { link = "StatusLineTerm" },
|
|
|
|
-- nvim-neo-tree/neo-tree.nvim
|
|
NeoTreeGitAdded = { fg = groups.git_add },
|
|
NeoTreeGitConflict = { fg = groups.git_merge },
|
|
NeoTreeGitDeleted = { fg = groups.git_delete },
|
|
NeoTreeGitIgnored = { fg = groups.git_ignore },
|
|
NeoTreeGitModified = { fg = groups.git_dirty },
|
|
NeoTreeGitRenamed = { fg = groups.git_rename },
|
|
NeoTreeGitUntracked = { fg = groups.git_untracked },
|
|
NeoTreeTitleBar = { link = "StatusLineTerm" },
|
|
|
|
-- folke/flash.nvim
|
|
FlashLabel = { fg = palette.base, bg = palette.love },
|
|
|
|
-- folke/which-key.nvim
|
|
WhichKey = { fg = palette.iris },
|
|
WhichKeyDesc = { fg = palette.gold },
|
|
WhichKeyFloat = { bg = groups.panel },
|
|
WhichKeyGroup = { fg = palette.foam },
|
|
WhichKeySeparator = { fg = palette.subtle },
|
|
WhichKeyValue = { fg = palette.rose },
|
|
|
|
-- lukas-reineke/indent-blankline.nvim
|
|
IblIndent = { fg = palette.overlay },
|
|
IblScope = { fg = palette.foam },
|
|
IblWhitespace = { fg = palette.overlay },
|
|
|
|
-- for legacy usage
|
|
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 },
|
|
CmpItemAbbrDeprecated = { fg = palette.subtle, strikethrough = true },
|
|
CmpItemAbbrMatch = { fg = palette.text, bold = styles.bold },
|
|
CmpItemAbbrMatchFuzzy = { fg = palette.text, bold = styles.bold },
|
|
CmpItemKind = { fg = palette.subtle },
|
|
CmpItemKindClass = { link = "StorageClass" },
|
|
CmpItemKindFunction = { link = "Function" },
|
|
CmpItemKindInterface = { link = "Type" },
|
|
CmpItemKindMethod = { link = "PreProc" },
|
|
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 },
|
|
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 },
|
|
|
|
-- vimwiki/vimwiki
|
|
VimwikiHR = { fg = palette.subtle },
|
|
VimwikiHeader1 = { link = "markdownH1" },
|
|
VimwikiHeader2 = { link = "markdownH2" },
|
|
VimwikiHeader3 = { link = "markdownH3" },
|
|
VimwikiHeader4 = { link = "markdownH4" },
|
|
VimwikiHeader5 = { link = "markdownH5" },
|
|
VimwikiHeader6 = { link = "markdownH6" },
|
|
VimwikiHeaderChar = { fg = palette.subtle },
|
|
VimwikiLink = { link = "markdownUrl" },
|
|
VimwikiList = { fg = palette.iris },
|
|
VimwikiNoExistsLink = { fg = palette.love },
|
|
|
|
-- nvim-neorg/neorg
|
|
NeorgHeading1Prefix = { link = "markdownH1Delimiter" },
|
|
NeorgHeading1Title = { link = "markdownH1" },
|
|
NeorgHeading2Prefix = { link = "markdownH2Delimiter" },
|
|
NeorgHeading2Title = { link = "markdownH2" },
|
|
NeorgHeading3Prefix = { link = "markdownH3Delimiter" },
|
|
NeorgHeading3Title = { link = "markdownH3" },
|
|
NeorgHeading4Prefix = { link = "markdownH4Delimiter" },
|
|
NeorgHeading4Title = { link = "markdownH4" },
|
|
NeorgHeading5Prefix = { link = "markdownH5Delimiter" },
|
|
NeorgHeading5Title = { link = "markdownH5" },
|
|
NeorgHeading6Prefix = { link = "markdownH6Delimiter" },
|
|
NeorgHeading6Title = { link = "markdownH6" },
|
|
NeorgMarkerTitle = make_title(),
|
|
|
|
-- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim)
|
|
DefinitionCount = { fg = palette.rose },
|
|
DefinitionIcon = { fg = palette.rose },
|
|
DefintionPreviewTitle = { fg = palette.rose, bold = styles.bold },
|
|
LspFloatWinBorder = make_border(),
|
|
LspFloatWinNormal = { bg = groups.panel },
|
|
LspSagaAutoPreview = { fg = palette.subtle },
|
|
LspSagaCodeActionBorder = make_border(palette.rose),
|
|
LspSagaCodeActionContent = { fg = palette.foam },
|
|
LspSagaCodeActionTitle = { fg = palette.gold, bold = styles.bold },
|
|
LspSagaCodeActionTruncateLine = { link = "LspSagaCodeActionBorder" },
|
|
LspSagaDefPreviewBorder = make_border(),
|
|
LspSagaDiagnosticBorder = make_border(palette.gold),
|
|
LspSagaDiagnosticHeader = make_title(),
|
|
LspSagaDiagnosticTruncateLine = { link = "LspSagaDiagnosticBorder" },
|
|
LspSagaDocTruncateLine = { link = "LspSagaHoverBorder" },
|
|
LspSagaFinderSelection = { fg = palette.gold },
|
|
LspSagaHoverBorder = { link = "LspFloatWinBorder" },
|
|
LspSagaLspFinderBorder = { link = "LspFloatWinBorder" },
|
|
LspSagaRenameBorder = make_border(palette.pine),
|
|
LspSagaRenamePromptPrefix = { fg = palette.love },
|
|
LspSagaShTruncateLine = { link = "LspSagaSignatureHelpBorder" },
|
|
LspSagaSignatureHelpBorder = make_border(palette.foam),
|
|
ReferencesCount = { fg = palette.rose },
|
|
ReferencesIcon = { fg = palette.rose },
|
|
SagaShadow = { bg = palette.overlay },
|
|
TargetWord = { fg = palette.iris },
|
|
|
|
-- ray-x/lsp_signature.nvim
|
|
LspSignatureActiveParameter = { bg = palette.overlay },
|
|
|
|
-- rlane/pounce.nvim
|
|
PounceAccept = { fg = palette.love, bg = palette.love, blend = 20 },
|
|
PounceAcceptBest = { fg = palette.gold, bg = palette.gold, blend = 20 },
|
|
PounceGap = { link = "Search" },
|
|
PounceMatch = { link = "Search" },
|
|
|
|
-- ggandor/leap.nvim
|
|
LeapLabelPrimary = { link = "IncSearch" },
|
|
LeapLabelSecondary = { link = "StatusLineTerm" },
|
|
LeapMatch = { link = "MatchParen" },
|
|
|
|
-- phaazon/hop.nvim
|
|
-- smoka7/hop.nvim
|
|
HopNextKey = { fg = palette.love, bg = palette.love, blend = 20 },
|
|
HopNextKey1 = { fg = palette.foam, bg = palette.foam, blend = 20 },
|
|
HopNextKey2 = { fg = palette.pine, bg = palette.pine, blend = 20 },
|
|
HopUnmatched = { fg = palette.muted },
|
|
|
|
-- nvim-telescope/telescope.nvim
|
|
TelescopeBorder = make_border(),
|
|
TelescopeMatching = { fg = palette.rose },
|
|
TelescopeNormal = { link = "NormalFloat" },
|
|
TelescopePromptNormal = { link = "TelescopeNormal" },
|
|
TelescopePromptPrefix = { fg = palette.subtle },
|
|
TelescopeSelection = { fg = palette.text, bg = palette.overlay },
|
|
TelescopeSelectionCaret = { fg = palette.rose, bg = palette.overlay },
|
|
TelescopeTitle = make_title(),
|
|
|
|
-- ibhagwan/fzf-lua
|
|
FzfLuaNormal = { link = "NormalFloat" },
|
|
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
|
|
NotifyDEBUGBorder = make_border(),
|
|
NotifyDEBUGIcon = { link = "NotifyDEBUGTitle" },
|
|
NotifyDEBUGTitle = { fg = palette.muted },
|
|
NotifyERRORBorder = make_border(groups.error),
|
|
NotifyERRORIcon = { link = "NotifyERRORTitle" },
|
|
NotifyERRORTitle = { fg = groups.error },
|
|
NotifyINFOBorder = make_border(groups.info),
|
|
NotifyINFOIcon = { link = "NotifyINFOTitle" },
|
|
NotifyINFOTitle = { fg = groups.info },
|
|
NotifyTRACEBorder = make_border(palette.iris),
|
|
NotifyTRACEIcon = { link = "NotifyTRACETitle" },
|
|
NotifyTRACETitle = { fg = palette.iris },
|
|
NotifyWARNBorder = make_border(groups.warn),
|
|
NotifyWARNIcon = { link = "NotifyWARNTitle" },
|
|
NotifyWARNTitle = { fg = groups.warn },
|
|
|
|
-- rcarriga/nvim-dap-ui
|
|
DapUIBreakpointsCurrentLine = { fg = palette.gold, bold = styles.bold },
|
|
DapUIBreakpointsDisabledLine = { fg = palette.muted },
|
|
DapUIBreakpointsInfo = { link = "DapUIThread" },
|
|
DapUIBreakpointsLine = { link = "DapUIBreakpointsPath" },
|
|
DapUIBreakpointsPath = { fg = palette.foam },
|
|
DapUIDecoration = { link = "DapUIBreakpointsPath" },
|
|
DapUIFloatBorder = make_border(),
|
|
DapUIFrameName = { fg = palette.text },
|
|
DapUILineNumber = { link = "DapUIBreakpointsPath" },
|
|
DapUIModifiedValue = { fg = palette.foam, bold = styles.bold },
|
|
DapUIScope = { link = "DapUIBreakpointsPath" },
|
|
DapUISource = { fg = palette.iris },
|
|
DapUIStoppedThread = { link = "DapUIBreakpointsPath" },
|
|
DapUIThread = { fg = palette.gold },
|
|
DapUIValue = { fg = palette.text },
|
|
DapUIVariable = { fg = palette.text },
|
|
DapUIWatchesEmpty = { fg = palette.love },
|
|
DapUIWatchesError = { link = "DapUIWatchesEmpty" },
|
|
DapUIWatchesValue = { link = "DapUIThread" },
|
|
|
|
-- glepnir/dashboard-nvim
|
|
DashboardCenter = { fg = palette.gold },
|
|
DashboardFooter = { fg = palette.iris },
|
|
DashboardHeader = { fg = palette.pine },
|
|
DashboardShortcut = { fg = palette.love },
|
|
|
|
-- SmiteshP/nvim-navic
|
|
NavicIconsArray = { fg = palette.gold },
|
|
NavicIconsBoolean = { fg = palette.rose },
|
|
NavicIconsClass = { fg = palette.foam },
|
|
NavicIconsConstant = { fg = palette.gold },
|
|
NavicIconsConstructor = { fg = palette.gold },
|
|
NavicIconsEnum = { fg = palette.gold },
|
|
NavicIconsEnumMember = { fg = palette.foam },
|
|
NavicIconsEvent = { fg = palette.gold },
|
|
NavicIconsField = { fg = palette.foam },
|
|
NavicIconsFile = { fg = palette.muted },
|
|
NavicIconsFunction = { fg = palette.pine },
|
|
NavicIconsInterface = { fg = palette.foam },
|
|
NavicIconsKey = { fg = palette.iris },
|
|
NavicIconsKeyword = { fg = palette.pine },
|
|
NavicIconsMethod = { fg = palette.iris },
|
|
NavicIconsModule = { fg = palette.rose },
|
|
NavicIconsNamespace = { fg = palette.muted },
|
|
NavicIconsNull = { fg = palette.love },
|
|
NavicIconsNumber = { fg = palette.gold },
|
|
NavicIconsObject = { fg = palette.gold },
|
|
NavicIconsOperator = { fg = palette.subtle },
|
|
NavicIconsPackage = { fg = palette.muted },
|
|
NavicIconsProperty = { fg = palette.foam },
|
|
NavicIconsString = { fg = palette.gold },
|
|
NavicIconsStruct = { fg = palette.foam },
|
|
NavicIconsTypeParameter = { fg = palette.foam },
|
|
NavicIconsVariable = { fg = palette.text },
|
|
NavicSeparator = { fg = palette.subtle },
|
|
NavicText = { fg = palette.subtle },
|
|
|
|
-- folke/noice.nvim
|
|
NoiceCursor = { fg = palette.highlight_high, bg = palette.text },
|
|
|
|
-- echasnovski/mini.indentscope
|
|
MiniIndentscopeSymbol = { fg = palette.muted },
|
|
MiniIndentscopeSymbolOff = { fg = palette.muted },
|
|
|
|
-- goolord/alpha-nvim
|
|
AlphaButtons = { fg = palette.foam },
|
|
AlphaFooter = { fg = palette.gold },
|
|
AlphaHeader = { fg = palette.pine },
|
|
AlphaShortcut = { fg = palette.rose },
|
|
|
|
-- github/copilot.vim
|
|
CopilotSuggestion = { fg = palette.muted, italic = styles.italic },
|
|
}
|
|
|
|
local transparency_highlights = {
|
|
DiagnosticVirtualTextError = { fg = groups.error },
|
|
DiagnosticVirtualTextHint = { fg = groups.hint },
|
|
DiagnosticVirtualTextInfo = { fg = groups.info },
|
|
DiagnosticVirtualTextWarn = { fg = groups.warn },
|
|
|
|
FloatBorder = { fg = palette.muted, bg = "NONE" },
|
|
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" },
|
|
TabLineFill = { bg = "NONE" },
|
|
TabLineSel = { fg = palette.text, bg = "NONE", bold = styles.bold },
|
|
|
|
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 },
|
|
|
|
WhichKeyFloat = { bg = "NONE" },
|
|
|
|
IblIndent = { fg = palette.overlay, bg = "NONE" },
|
|
IblScope = { fg = palette.foam, bg = "NONE" },
|
|
IblWhitespace = { fg = palette.overlay, bg = "NONE" },
|
|
}
|
|
|
|
if styles.transparency then
|
|
for group, highlight in pairs(transparency_highlights) do
|
|
highlights[group] = highlight
|
|
end
|
|
end
|
|
|
|
for group, options in pairs(config.options.highlight_groups) do
|
|
local default_opts = highlights[group] or {}
|
|
|
|
if (options.inherit == nil or options.inherit) and default_opts ~= nil then -- On merge.
|
|
options.inherit = nil -- Don't add this key to the highlight_group after merge.
|
|
highlights[group] = vim.tbl_extend("force", default_opts, options)
|
|
else -- On overwrite.
|
|
options.inherit = nil -- Don't add this key to the highlight_group.
|
|
highlights[group] = options
|
|
end
|
|
|
|
highlights[group] = vim.tbl_extend("force", highlights[group] or {}, options)
|
|
end
|
|
|
|
for group, highlight in pairs(highlights) do
|
|
config.options.before_highlight(group, highlight, palette)
|
|
utilities.highlight(group, highlight)
|
|
end
|
|
|
|
if config.options.enable.terminal then
|
|
vim.g.terminal_color_0 = palette.overlay -- black
|
|
vim.g.terminal_color_8 = palette.subtle -- bright black
|
|
vim.g.terminal_color_1 = palette.love -- red
|
|
vim.g.terminal_color_9 = palette.love -- bright red
|
|
vim.g.terminal_color_2 = palette.pine -- green
|
|
vim.g.terminal_color_10 = palette.pine -- bright green
|
|
vim.g.terminal_color_3 = palette.gold -- yellow
|
|
vim.g.terminal_color_11 = palette.gold -- bright yellow
|
|
vim.g.terminal_color_4 = palette.foam -- blue
|
|
vim.g.terminal_color_12 = palette.foam -- bright blue
|
|
vim.g.terminal_color_5 = palette.iris -- magenta
|
|
vim.g.terminal_color_13 = palette.iris -- bright magenta
|
|
vim.g.terminal_color_6 = palette.rose -- cyan
|
|
vim.g.terminal_color_14 = palette.rose -- bright cyan
|
|
vim.g.terminal_color_7 = palette.text -- white
|
|
vim.g.terminal_color_15 = palette.text -- bright white
|
|
|
|
-- Support StatusLineTerm & StatusLineTermNC from vim
|
|
vim.cmd([[
|
|
autocmd TermOpen * if &buftype=='terminal'
|
|
\|setlocal winhighlight=StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC
|
|
\|else|setlocal winhighlight=|endif
|
|
]])
|
|
end
|
|
end
|
|
|
|
---@param variant Variant | nil
|
|
function M.colorscheme(variant)
|
|
config.extend_options({ variant = variant })
|
|
|
|
vim.opt.termguicolors = true
|
|
if vim.g.colors_name then
|
|
vim.cmd("hi clear")
|
|
vim.cmd("syntax reset")
|
|
end
|
|
vim.g.colors_name = "rose-pine"
|
|
|
|
set_highlights()
|
|
end
|
|
|
|
---@param options Options
|
|
function M.setup(options)
|
|
config.extend_options(options or {})
|
|
end
|
|
|
|
return M
|