mirror of
https://github.com/webhooked/kanso.nvim.git
synced 2026-05-30 05:37:03 +02:00
Add new `minimal` config option that provides a cleaner, more focused color scheme with fewer distinct colors: - Variables/constants: white - Functions/methods: blue - Types: aqua - Keywords/statements: gray - Operators: yellow - Brackets/punctuation: gray - Properties/members: violet
103 lines
4.1 KiB
Lua
103 lines
4.1 KiB
Lua
-- 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 {
|
|
-- *Comment any comment
|
|
Comment = vim.tbl_extend("force", { fg = theme.syn.comment }, not config.italics and {} or config.commentStyle),
|
|
|
|
-- *Constant any constant
|
|
Constant = { fg = config.minimal and theme.ui.fg or theme.syn.constant },
|
|
-- String a string constant: "this is a string"
|
|
String = { fg = theme.syn.string },
|
|
-- Character a character constant: 'c', '\n'
|
|
Character = { link = "String" },
|
|
-- Number a number constant: 234, 0xff
|
|
Number = { fg = theme.syn.number },
|
|
-- Boolean a boolean constant: TRUE, false
|
|
Boolean = { fg = config.minimal and theme.ui.fg or theme.syn.constant },
|
|
-- Float a floating point constant: 2.3e10
|
|
Float = { link = "Number" },
|
|
|
|
-- *Identifier any variable name
|
|
Identifier = { fg = config.minimal and theme.ui.fg or theme.syn.identifier },
|
|
-- Function function name (also: methods for classes)
|
|
Function = vim.tbl_extend("force", { fg = theme.syn.fun }, config.functionStyle),
|
|
|
|
-- *Statement any statement
|
|
Statement = vim.tbl_extend("force", { fg = config.minimal and theme.syn.operator or theme.syn.statement }, config.statementStyle),
|
|
-- Conditional if, then, else, endif, switch, etc.
|
|
-- Repeat for, do, while, etc.
|
|
-- Label case, default, etc.
|
|
-- Operator "sizeof", "+", "*", etc.
|
|
Operator = { fg = config.minimal and theme.syn.special1 or theme.syn.operator },
|
|
-- Keyword any other keyword
|
|
Keyword = vim.tbl_extend("force", { fg = config.minimal and theme.syn.operator or theme.syn.keyword }, not config.italics and {} or config.keywordStyle),
|
|
-- Exception try, catch, throw
|
|
Exception = { fg = theme.syn.special2 },
|
|
|
|
-- *PreProc generic Preprocessor
|
|
PreProc = { fg = config.minimal and theme.syn.operator or theme.syn.preproc },
|
|
-- Include preprocessor #include
|
|
-- Define preprocessor #define
|
|
-- Macro same as Define
|
|
-- PreCondit preprocessor #if, #else, #endif, etc.
|
|
|
|
-- *Type int, long, char, etc.
|
|
Type = vim.tbl_extend("force", { fg = theme.syn.type }, config.typeStyle),
|
|
-- StorageClass static, register, volatile, etc.
|
|
-- Structure struct, union, enum, etc.
|
|
-- Typedef A typedef
|
|
|
|
-- *Special any special symbol
|
|
Special = { fg = theme.syn.special1 },
|
|
-- SpecialChar special character in a constant
|
|
-- Tag you can use CTRL-] on this
|
|
-- Delimiter character that needs attention
|
|
Delimiter = { fg = config.minimal and theme.syn.operator or theme.syn.punct },
|
|
-- SpecialComment special things inside a comment
|
|
-- Debug debugging statements
|
|
|
|
-- *Underlined text that stands out, HTML links
|
|
Underlined = { fg = theme.syn.special1, underline = true },
|
|
Bold = { bold = config.bold },
|
|
Italic = { italic = config.italics },
|
|
|
|
-- *Ignore left blank, hidden |hl-Ignore|
|
|
Ignore = { link = "NonText" },
|
|
|
|
-- *Error any erroneous construct
|
|
Error = { fg = theme.diag.error },
|
|
|
|
-- *Todo anything that needs extra attention; mostly the keywords TODO FIXME WARNING and XXX
|
|
Todo = { fg = theme.ui.fg_reverse, bg = theme.diag.info, bold = config.bold },
|
|
|
|
qfLineNr = { link = "lineNr" },
|
|
qfFileName = { link = "Directory" },
|
|
|
|
-- htmlH1 = {},
|
|
-- htmlH2 = {},
|
|
|
|
-- mkdHeading = {},
|
|
-- mkdCode = {},
|
|
-- mkdCodeDelimiter = {},
|
|
-- mkdCodeStart = {},
|
|
-- mkdCodeEnd = {},
|
|
-- mkdLink = {},
|
|
|
|
-- markdownHeadingDelimiter = {},
|
|
markdownCode = { fg = theme.syn.string },
|
|
markdownCodeBlock = { fg = theme.syn.string },
|
|
markdownEscape = { fg = theme.ui.none },
|
|
-- markdownH1 = {},
|
|
-- markdownH2 = {},
|
|
-- markdownLinkText = {},
|
|
}
|
|
end
|
|
|
|
return M
|