2025-05-06 12:02:29 +02:00
-- local c = require("kanso.color")
local M = { }
---@param colors KansoColors
---@param config? KansoConfig
function M . setup ( colors , config )
local theme = colors.theme
config = config or require ( " kanso " ) . config
return {
-- ColorColumn Used for the columns set with 'colorcolumn'.
ColorColumn = { bg = theme.ui . bg_p1 } ,
-- Conceal Placeholder characters substituted for concealed text (see 'conceallevel').
2025-05-21 09:18:51 +02:00
Conceal = { fg = theme.ui . special , bold = config.bold } ,
2025-05-06 12:02:29 +02:00
-- CurSearch Used for highlighting a search pattern under the cursor (see 'hlsearch').
2025-05-21 09:18:51 +02:00
CurSearch = { fg = theme.ui . fg , bg = theme.ui . bg_search , bold = config.bold } ,
2025-05-06 12:02:29 +02:00
-- Cursor Character under the cursor.
Cursor = { fg = theme.ui . cursor_fg , bg = theme.ui . cursor_bg } ,
-- lCursor Character under the cursor when |language-mapping| is used (see 'guicursor').
lCursor = { link = " Cursor " } ,
-- CursorIM Like Cursor, but used when in IME mode.
CursorIM = { link = " Cursor " } ,
-- CursorColumn Screen-column at the cursor, when 'cursorcolumn' is set.
CursorColumn = { link = " CursorLine " } ,
-- CursorLine Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
CursorLine = { bg = theme.ui . bg_p2 } ,
-- Directory Directory names (and other special names in listings).
Directory = { fg = theme.syn . fun } ,
-- DiffAdd Diff mode: Added line. |diff.txt|
DiffAdd = { bg = theme.diff . add } ,
-- DiffChange Diff mode: Changed line. |diff.txt|
DiffChange = { bg = theme.diff . change } ,
-- DiffDelete Diff mode: Deleted line. |diff.txt|
DiffDelete = { fg = theme.vcs . removed , bg = theme.diff . delete } ,
-- DiffText Diff mode: Changed text within a changed line. |diff.txt|
DiffText = { bg = theme.diff . text } ,
-- EndOfBuffer Filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
EndOfBuffer = { fg = theme.ui . bg } ,
-- TermCursor Cursor in a focused terminal.
-- TermCursorNC Cursor in an unfocused terminal.
-- ErrorMsg Error messages on the command line.
ErrorMsg = { fg = theme.diag . error } ,
-- WinSeparator Separators between window splits.
2025-05-08 09:15:24 +02:00
WinSeparator = { fg = theme.ui . bg_m3 , bg = config.dimInactive and theme.ui . bg_dim or theme.ui . none } ,
2025-05-06 12:02:29 +02:00
VertSplit = { link = " WinSeparator " } ,
-- Folded Line used for closed folds.
Folded = { fg = theme.ui . special , bg = theme.ui . bg_p1 } ,
-- FoldColumn 'foldcolumn'
2025-05-07 11:27:21 +02:00
FoldColumn = { fg = theme.ui . nontext , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- SignColumn Column where |signs| are displayed.
2025-05-07 11:27:21 +02:00
SignColumn = { fg = theme.ui . special , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- IncSearch 'incsearch' highlighting; also used for the text replaced with ":s///c".
IncSearch = { fg = theme.ui . fg_reverse , bg = theme.diag . warning } ,
-- Substitute |:substitute| replacement text highlighting.
Substitute = { fg = theme.ui . fg , bg = theme.vcs . removed } ,
-- LineNr Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
LineNr = { fg = theme.ui . cursor_line_nr_foreground , bg = theme.ui . none } ,
-- LineNrAbove Line number for when the 'relativenumber' option is set, above the cursor line.
-- LineNrBelow Line number for when the 'relativenumber' option is set, below the cursor line.
-- CursorLineNr Like LineNr when 'cursorline' is set and 'cursorlineopt' contains "number" or is "both", for the cursor line.
CursorLineNr = { fg = theme.ui . cursor_line_nr_active_foreground , bg = theme.ui . none } ,
-- CursorLineFold Like FoldColumn when 'cursorline' is set for the cursor line.
-- CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
-- MatchParen Character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
2025-05-21 09:18:51 +02:00
MatchParen = { fg = theme.diag . warning , bold = config.bold } ,
2025-05-06 12:02:29 +02:00
-- ModeMsg 'showmode' message (e.g., "-- INSERT --").
2025-05-21 09:18:51 +02:00
ModeMsg = { fg = theme.diag . warning , bold = config.bold } ,
2025-05-06 12:02:29 +02:00
-- MsgArea Area for messages and cmdline.
2025-05-21 09:18:51 +02:00
MsgArea = vim.o . cmdheight == 0 and { link = " StatusLine " } or { fg = theme.ui . fg_dim } ,
2025-05-06 12:02:29 +02:00
-- MsgSeparator Separator for scrolled messages |msgsep|.
MsgSeparator = { bg = vim.o . cmdheight == 0 and theme.ui . bg or theme.ui . bg_m3 } ,
-- MoreMsg |more-prompt|
MoreMsg = { fg = theme.diag . info } ,
-- NonText '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
NonText = { fg = theme.ui . nontext } ,
-- Normal Normal text.
2025-05-08 09:15:24 +02:00
Normal = { fg = theme.ui . fg , bg = config.transparent and theme.ui . none or theme.ui . bg } ,
2025-05-06 12:02:29 +02:00
-- NormalFloat Normal text in floating windows.
2025-05-08 09:43:49 +02:00
NormalFloat = { fg = theme.ui . float.fg , bg = config.transparent and theme.ui . none or theme.ui . float.bg } ,
2025-05-06 12:02:29 +02:00
-- FloatBorder Border of floating windows.
2025-05-21 09:18:51 +02:00
FloatBorder = {
fg = theme.ui . float.fg_border ,
bg = config.transparent and theme.ui . none or theme.ui . float.bg_border ,
} ,
2025-05-06 12:02:29 +02:00
-- FloatTitle Title of floating windows.
2025-05-21 09:18:51 +02:00
FloatTitle = {
fg = theme.ui . special ,
bg = config.transparent and theme.ui . none or theme.ui . float.bg_border ,
bold = config.bold ,
} ,
2025-05-06 12:02:29 +02:00
-- FloatFooter Footer of floating windows.
2025-05-08 09:43:49 +02:00
FloatFooter = { fg = theme.ui . nontext , bg = config.transparent and theme.ui . none or theme.ui . float.bg_border } ,
2025-05-06 12:02:29 +02:00
-- NormalNC Normal text in non-current windows.
NormalNC = config.dimInactive and { fg = theme.ui . fg_dim , bg = theme.ui . bg_dim } or { link = " Normal " } ,
-- Pmenu Popup menu: Normal item.
2025-05-08 09:43:49 +02:00
Pmenu = { fg = theme.ui . pmenu.fg , bg = config.transparent and theme.ui . none or theme.ui . pmenu.bg } ,
2025-05-06 12:02:29 +02:00
-- PmenuSel Popup menu: Selected item.
PmenuSel = { fg = theme.ui . pmenu.fg_sel , bg = theme.ui . pmenu.bg_sel } ,
-- PmenuKind Popup menu: Normal item "kind".
2025-05-08 09:43:49 +02:00
PmenuKind = { fg = theme.ui . fg_dim , bg = config.transparent and theme.ui . none or theme.ui . pmenu.bg } ,
2025-05-06 12:02:29 +02:00
-- PmenuKindSel Popup menu: Selected item "kind".
PmenuKindSel = { fg = theme.ui . fg_dim , bg = theme.ui . pmenu.bg_sel } ,
-- PmenuExtra Popup menu: Normal item "extra text".
PmenuExtra = { fg = theme.ui . special , bg = theme.ui . pmenu.bg } ,
-- PmenuExtraSel Popup menu: Selected item "extra text".
PmenuExtraSel = { fg = theme.ui . special , bg = theme.ui . pmenu.bg_sel } ,
-- PmenuSbar Popup menu: Scrollbar.
2025-05-08 09:43:49 +02:00
PmenuSbar = { bg = config.transparent and theme.ui . none or theme.ui . pmenu.bg_sbar } ,
2025-05-06 12:02:29 +02:00
-- PmenuThumb Popup menu: Thumb of the scrollbar.
PmenuThumb = { bg = theme.ui . pmenu.bg_thumb } ,
-- Question |hit-enter| prompt and yes/no questions.
Question = { link = " MoreMsg " } ,
-- QuickFixLine Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
2025-05-08 09:43:49 +02:00
QuickFixLine = { bg = config.transparent and theme.ui . none or theme.ui . bg_p1 } ,
2025-05-06 12:02:29 +02:00
-- Search Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
Search = { fg = theme.ui . fg , bg = theme.ui . bg_search } ,
-- SpecialKey Unprintable characters: Text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
SpecialKey = { fg = theme.ui . special } ,
-- SpellBad Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
SpellBad = { undercurl = config.undercurl , underline = not config.undercurl , sp = theme.diag . error } ,
-- SpellCap Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
SpellCap = { undercurl = config.undercurl , underline = not config.undercurl , sp = theme.diag . warning } ,
-- SpellLocal Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
SpellLocal = { undercurl = config.undercurl , underline = not config.undercurl , sp = theme.diag . warning } ,
-- SpellRare Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
SpellRare = { undercurl = config.undercurl , underline = not config.undercurl , sp = theme.diag . warning } ,
-- StatusLine Status line of current window.
2025-05-07 11:27:21 +02:00
StatusLine = { fg = theme.ui . fg_dim , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- StatusLineNC Status lines of not-current windows. Note: If this is equal to "StatusLine", Vim will use "^^^" in the status line of the current window.
2025-05-07 11:27:21 +02:00
StatusLineNC = { fg = theme.ui . nontext , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- TabLine Tab pages line, not active tab page label.
2025-05-07 11:27:21 +02:00
TabLine = { bg = theme.ui . none , fg = theme.ui . special } ,
2025-05-06 12:02:29 +02:00
-- TabLineFill Tab pages line, where there are no labels.
2025-05-07 11:27:21 +02:00
TabLineFill = { bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- TabLineSel Tab pages line, active tab page label.
2025-05-21 09:18:51 +02:00
TabLineSel = {
fg = theme.ui . fg_dim ,
bg = not config.transparent and theme.ui . bg_p1 or theme.ui . none ,
bold = config.bold ,
} ,
2025-05-06 12:02:29 +02:00
-- Title Titles for output from ":set all", ":autocmd" etc.
2025-05-21 09:18:51 +02:00
Title = { fg = theme.syn . fun , bold = config.bold } ,
2025-05-06 12:02:29 +02:00
-- Visual Visual mode selection.
Visual = { bg = theme.ui . bg_visual } ,
-- VisualNOS Visual mode selection when vim is "Not Owning the Selection".
VisualNOS = { link = " Visual " } ,
-- WarningMsg Warning messages.
WarningMsg = { fg = theme.diag . warning } ,
-- Whitespace "nbsp", "space", "tab", "multispace", "lead" and "trail" in 'listchars'.
Whitespace = { fg = theme.ui . whitespace } ,
-- WildMenu Current match in 'wildmenu' completion.
WildMenu = { link = " Pmenu " } ,
-- WinBar Window bar of current window.
2025-05-08 09:15:24 +02:00
WinBar = { fg = theme.ui . fg_dim , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- WinBarNC Window bar of not-current windows.
2025-05-08 09:15:24 +02:00
WinBarNC = { fg = theme.ui . fg_dim , bg = config.dimInactive and theme.ui . bg_dim or theme.ui . none } ,
2025-05-06 12:02:29 +02:00
-- SignColumnSB = { link = "SignColumn" },
-- NormalSB = { link = "Normal" },
debugPC = { bg = theme.diff . delete } ,
2025-05-07 11:27:21 +02:00
debugBreakpoint = { fg = theme.syn . special1 , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
LspReferenceText = { bg = theme.ui . bg_p2 } ,
LspReferenceRead = { link = " LspReferenceText " } ,
LspReferenceWrite = { bg = theme.ui . bg_p2 , underline = true } ,
-- LspInlayHint = { link = "NonText"},
DiagnosticError = { fg = theme.diag . error } ,
DiagnosticWarn = { fg = theme.diag . warning } ,
DiagnosticInfo = { fg = theme.diag . info } ,
DiagnosticHint = { fg = theme.diag . hint } ,
DiagnosticOk = { fg = theme.diag . ok } ,
DiagnosticFloatingError = { fg = theme.diag . error } ,
DiagnosticFloatingWarn = { fg = theme.diag . warning } ,
DiagnosticFloatingInfo = { fg = theme.diag . info } ,
DiagnosticFloatingHint = { fg = theme.diag . hint } ,
DiagnosticFloatingOk = { fg = theme.diag . ok } ,
2025-05-07 11:27:21 +02:00
DiagnosticSignError = { fg = theme.diag . error , bg = theme.ui . none } ,
DiagnosticSignWarn = { fg = theme.diag . warning , bg = theme.ui . none } ,
DiagnosticSignInfo = { fg = theme.diag . info , bg = theme.ui . none } ,
DiagnosticSignHint = { fg = theme.diag . hint , bg = theme.ui . none } ,
2025-05-06 12:02:29 +02:00
DiagnosticVirtualTextError = { link = " DiagnosticError " } ,
DiagnosticVirtualTextWarn = { link = " DiagnosticWarn " } ,
DiagnosticVirtualTextInfo = { link = " DiagnosticInfo " } ,
DiagnosticVirtualTextHint = { link = " DiagnosticHint " } ,
2025-05-21 09:18:51 +02:00
DiagnosticUnderlineError = {
undercurl = config.undercurl ,
underline = not config.undercurl ,
sp = theme.diag . error ,
} ,
DiagnosticUnderlineWarn = {
undercurl = config.undercurl ,
underline = not config.undercurl ,
sp = theme.diag . warning ,
} ,
DiagnosticUnderlineInfo = {
undercurl = config.undercurl ,
underline = not config.undercurl ,
sp = theme.diag . info ,
} ,
DiagnosticUnderlineHint = {
undercurl = config.undercurl ,
underline = not config.undercurl ,
sp = theme.diag . hint ,
} ,
2025-05-06 12:02:29 +02:00
LspSignatureActiveParameter = { fg = theme.diag . warning } ,
LspCodeLens = { fg = theme.syn . comment } ,
-- vcs
diffAdded = { fg = theme.vcs . added } ,
diffRemoved = { fg = theme.vcs . removed } ,
diffDeleted = { fg = theme.vcs . removed } ,
diffChanged = { fg = theme.vcs . changed } ,
diffOldFile = { fg = theme.vcs . removed } ,
diffNewFile = { fg = theme.vcs . added } ,
-- diffFile = { fg = c.steelGray },
-- diffLine = { fg = c.steelGray },
-- diffIndexLine = { link = 'Identifier' },
}
end
return M