vim.cmd('hi clear')
if vim.fn.exists("syntax_on") then
vim.cmd('syntax reset')
end
vim.g.colors_name = 'vacme'
vim.o.background = 'light'
local vcolors = {
-- whites
w1 = {term='15',hex='#FFFFEC'},
w2 = {term='11',hex='#EEEEA7'},
w3 = {term='7',hex='#999957'},
w4 = {term='0',hex='#424242'},
-- reds
r1 = {term='9',hex='#F2ACAA'},
r2 = {term='1',hex='#B85C57'},
-- greens
g1 = {term='193',hex='#EFFEEC'},
g2 = {term='10',hex='#98CE8F'},
g3 = {term='2',hex='#57864E'},
-- yellows
y1 = {term='187',hex='#EAEBDB'},
y2 = {term='8',hex='#B7B19C'},
y3 = {term='3',hex='#8F7634'},
-- blues
b1 = {term='195',hex='#E2F1F8'},
b2 = {term='12',hex='#A6DCF8'},
b3 = {term='4',hex='#2A8DC5'},
-- magentas
m1 = {term='13',hex='#D0D0F7'},
m2 = {term='5',hex='#8888C7'},
-- cyans
c1 = {term='194',hex='#EAFFFF'},
c2 = {term='14',hex='#B0ECED'},
c3 = {term='6',hex='#6AA7A8'},
-- misc (accent)
a1 = {term='195',hex='#030093'}
}
local vstyles = {
normal = {fg=vcolors.w4,bg=vcolors.w1},
ghostly = {fg=vcolors.y3,bg=vcolors.w1},
hilited = {fg=vcolors.w4,bg=vcolors.w2},
justbold = {style='bold'},
justuline = {style='underline'},
justit = {style='italic'}
}
function syntax(group, rule)
vim.cmd(string.format("hi! %s term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE", group))
local fg = ""
if rule.fg then fg = string.format(' guifg=%s ctermfg=%s', rule.fg['hex'], rule.fg['term']) end
local bg = ""
if rule.bg then bg = string.format(' guibg=%s ctermbg=%s', rule.bg['hex'], rule.bg['term']) end
local style = ""
if rule.style then style = string.format(' gui=%s cterm=%s', rule.style, rule.style) end
vim.cmd(string.format( 'hi! %s%s%s%s', group, fg, bg, style))
end
function link(group, model)
vim.cmd(string.format("hi! link %s %s", group, model))
end
-- nvim UI elements
syntax('Normal', vstyles.normal)
syntax('Folded', vstyles.ghostly)
syntax('FoldColumn', vstyles.ghostly)
syntax('Terminal', vstyles.normal)
syntax('ToolbarButton', vstyles.normal)
syntax('ToolbarLine', vstyles.normal)
syntax('CursorLine', {bg=vcolors.g1})
syntax('LineNr', {fg=vcolors.w3,bg=vcolors.y1})
link('LineNrAbove', 'LineNr')
link('LineNrBelow', 'LineNr')
syntax('FloatBorder', {fg=vcolors.g1,bg=vcolors.g3})
syntax('NormalFloat', {fg=vcolors.g3,bg=vcolors.g1})
syntax('DiffAdd', {fg=vcolors.w4, bg=vcolors.g2})
syntax('DiffChange', {fg=vcolors.w4, bg=vcolors.c2})
syntax('DiffDelete', {fg=vcolors.w4, bg=vcolors.r1})
syntax('DiffText', {fg=vcolors.w4, bg=vcolors.g2})
syntax('StatusLine', {fg=vcolors.w4, bg=vcolors.c1, style='bold,underline'})
syntax('StatusLineNC', {fg=vcolors.w4, bg=vcolors.c1})
link('TabLine', 'StatusLineNC')
link('TabLineFill', 'StatusLineNC')
link('WinSeparator', 'StatusLineNC')
syntax('TabLineSel', {fg=vcolors.w1, bg=vcolors.m2})
syntax('CursorLineNr', {fg=vcolors.w1,bg=vcolors.m2})
syntax('NonText', {fg=vcolors.w3})
syntax('SpecialKey', vstyles.justbold)
syntax('SpellBad', {fg=vcolors.r2,style='underline'})
syntax('SpellCap', vstyles.justuline)
syntax('SpellLocal', vstyles.justuline)
syntax('SpellRare', vstyles.justuline)
syntax('Title', vstyles.justbold)
syntax('ColorColumn', vstyles.hilited)
syntax('Conceal', vstyles.ghostly)
syntax('CursorColumn', {bg=vcolors.g1})
syntax('Directory', vstyles.justbold)
syntax('EndOfBuffer', vstyles.ghostly)
syntax('ErrorMsg', vstyles.justbold)
syntax('IncSearch', {fg=vcolors.w1,bg=vcolors.m2})
syntax('MatchParen', {bg=vcolors.w2,style='bold'})
syntax('ModeMsg', vstyles.justbold)
syntax('MoreMsg', vstyles.justbold)
syntax('Pmenu', {fg=vcolors.g3,bg=vcolors.g1})
syntax('PmenuSbar', {fg=vcolors.g1,bg=vcolors.g3})
syntax('PmenuSel', {fg=vcolors.w4,bg=vcolors.g2,style='underline'})
syntax('PmenuKindSel', {fg=vcolors.w4,bg=vcolors.g2})
link('PmenuExtraSel', 'PmenuKindSel')
syntax('PmenuThumb', {fg=vcolors.g1,bg=vcolors.w4})
syntax('Question', vstyles.justbold)
syntax('Search', vstyles.hilited)
link('SignColumn', 'LineNr')
syntax('Visual', vstyles.hilited)
syntax('VisualNOS', vstyles.hilited)
syntax('WarningMsg', vstyles.justbold)
syntax('WildMenu', {fg=vcolors.w1,bg=vcolors.m2})
syntax('QuickFixLine', vstyles.justbold)
-- language syntax (acme philosophy: almost no color, just bold comments)
syntax('Comment', vstyles.justbold)
syntax('Constant', vstyles.normal)
syntax('String', vstyles.normal)
syntax('Character', vstyles.normal)
syntax('Number', vstyles.normal)
syntax('Boolean', vstyles.normal)
syntax('Float', vstyles.normal)
syntax('Identifier', vstyles.normal)
syntax('Function', vstyles.normal)
syntax('Statement', vstyles.normal)
syntax('Conditional', vstyles.normal)
syntax('Repeat', vstyles.normal)
syntax('Label', vstyles.normal)
syntax('Operator', vstyles.normal)
syntax('Keyword', vstyles.normal)
syntax('Exception', vstyles.normal)
syntax('PreProc', vstyles.normal)
syntax('Include', vstyles.normal)
syntax('Define', vstyles.normal)
syntax('Macro', vstyles.normal)
syntax('PreCondit', vstyles.normal)
syntax('Type', vstyles.normal)
syntax('StorageClass', vstyles.normal)
syntax('Structure', vstyles.normal)
syntax('Typedef', vstyles.normal)
syntax('Special', vstyles.normal)
syntax('SpecialChar', vstyles.normal)
syntax('Tag', vstyles.justuline)
syntax('Delimiter', vstyles.normal)
syntax('SpecialComment', vstyles.normal)
syntax('Debug', vstyles.normal)
syntax('Underlined', vstyles.justuline)
syntax('Ignore', vstyles.justbold)
syntax('Error', vstyles.normal)
syntax('Todo', vstyles.hilited)
-- TreeSitter (legacy names)
link('TSAnnotation', 'Normal')
link('TSBoolean', 'Normal')
link('TSCharacter', 'Normal')
link('TSComment', 'Comment')
link('TSConditional', 'Normal')
link('TSConstant', 'Normal')
link('TSConstBuiltin', 'Normal')
link('TSConstMacro', 'Normal')
link('TSError', 'Error')
link('TSException', 'Normal')
link('TSField', 'Normal')
link('TSFloat', 'Normal')
link('TSFunction', 'Normal')
link('TSFuncBuiltin', 'Normal')
link('TSFuncMacro', 'Normal')
link('TSInclude', 'Normal')
link('TSKeyword', 'Normal')
link('TSLabel', 'Normal')
link('TSMethod', 'Normal')
link('TSNamespace', 'Normal')
link('TSNumber', 'Normal')
link('TSOperator', 'Normal')
link('TSParameterReference', 'Normal')
link('TSProperty', 'Normal')
link('TSPunctDelimiter', 'Normal')
link('TSPunctBracket', 'Normal')
link('TSPunctSpecial', 'Normal')
link('TSRepeat', 'Normal')
link('TSString', 'Normal')
link('TSStringRegex', 'Normal')
link('TSStringEscape', 'Normal')
link('TSStrong', 'Normal')
link('TSConstructor', 'Normal')
link('TSKeywordFunction', 'Normal')
link('TSLiteral', 'Normal')
link('TSParameter', 'Normal')
link('TSVariable', 'Normal')
link('TSVariableBuiltin', 'Normal')
link('TSTag', 'Normal')
link('TSTagDelimiter', 'Normal')
link('TSTitle', 'Normal')
link('TSType', 'Normal')
link('TSTypeBuiltin', 'Normal')
link('TSEmphasis', 'Normal')
-- Neovim >= 0.8 treesitter captures
link('@comment', 'Comment')
link('@error', 'Error')
link('@none', 'Normal')
link('@preproc', 'Normal')
link('@keyword.directive', 'Normal')
link('@define', 'Normal')
link('@keyword.directive.define', 'Normal')
link('@operator', 'Normal')
link('@punctuation.delimiter', 'Normal')
link('@markup.raw.delimiter', 'Normal')
link('@punctuation.bracket', 'Normal')
link('@punctuation.special', 'Normal')
link('@markup.list', 'Normal')
link('@string', 'Normal')
link('@string.regex', 'Normal')
link('@string.regexp', 'Normal')
link('@string.escape', 'Normal')
link('@string.special', 'Normal')
link('@markup.link.label', 'Normal')
link('@character', 'Normal')
link('@character.special', 'Normal')
link('@boolean', 'Normal')
link('@number', 'Normal')
link('@float', 'Normal')
link('@number.float', 'Normal')
link('@function', 'Normal')
link('@function.call', 'Normal')
link('@function.builtin', 'Normal')
link('@function.macro', 'Normal')
link('@method', 'Normal')
link('@method.call', 'Normal')
link('@function.method', 'Normal')
link('@function.method.call', 'Normal')
link('@constructor', 'Normal')
link('@parameter', 'Normal')
link('@variable.parameter', 'Normal')
link('@keyword', 'Normal')
link('@keyword.function', 'Normal')
link('@keyword.operator', 'Normal')
link('@keyword.return', 'Normal')
link('@conditional', 'Normal')
link('@repeat', 'Normal')
link('@debug', 'Normal')
link('@keyword.conditional', 'Normal')
link('@keyword.repeat', 'Normal')
link('@keyword.debug', 'Normal')
link('@label', 'Normal')
link('@include', 'Normal')
link('@exception', 'Normal')
link('@keyword.import', 'Normal')
link('@keyword.exception', 'Normal')
link('@type', 'Normal')
link('@type.builtin', 'Normal')
link('@type.qualifier', 'Normal')
link('@type.definition', 'Normal')
link('@storageclass', 'Normal')
link('@keyword.storage', 'Normal')
link('@attribute', 'Normal')
link('@field', 'Normal')
link('@variable.member', 'Normal')
link('@property', 'Normal')
link('@variable', 'Normal')
link('@variable.builtin', 'Normal')
link('@constant', 'Normal')
link('@constant.builtin', 'Normal')
link('@constant.macro', 'Normal')
link('@namespace', 'Normal')
link('@module', 'Normal')
link('@symbol', 'Normal')
link('@string.special.symbol', 'Normal')
link('@text', 'Normal')
link('@text.strong', 'Normal')
link('@text.emphasis', 'Normal')
link('@text.underline', 'Underlined')
link('@text.strike', 'Normal')
link('@markup.strong', 'Normal')
link('@markup.emphasis', 'Normal')
link('@markup.italic', 'Normal')
link('@markup.underline', 'Underlined')
link('@markup.strike', 'Normal')
link('@markup.strikethrough', 'Normal')
link('@text.title', 'Title')
link('@text.literal', 'Normal')
link('@markup.heading', 'Title')
link('@markup.raw', 'Normal')
link('@text.uri', 'Underlined')
link('@string.special.url', 'Underlined')
link('@markup.link.url', 'Underlined')
link('@text.math', 'Normal')
link('@text.environment', 'Normal')
link('@text.environment.name', 'Normal')
link('@markup.math', 'Normal')
link('@markup.environment', 'Normal')
link('@markup.environment.name', 'Normal')
link('@text.reference', 'Normal')
link('@markup.link', 'Normal')
link('@text.todo', 'Todo')
link('@markup.list.checked', 'Todo')
link('@markup.list.unchecked', 'Todo')
link('@comment.todo', 'Todo')
link('@text.note', 'WarningMsg')
link('@comment.info', 'WarningMsg')
link('@comment.hint', 'WarningMsg')
link('@text.warning', 'WarningMsg')
link('@comment.warning', 'WarningMsg')
link('@text.danger', 'ErrorMsg')
link('@comment.danger', 'ErrorMsg')
link('@tag', 'Normal')
link('@tag.attribute', 'Normal')
link('@tag.delimiter', 'Normal')
-- Diagnostics
syntax('DiagnosticError', {fg=vcolors.r2})
syntax('DiagnosticWarn', {fg=vcolors.y3})
syntax('DiagnosticInfo', {fg=vcolors.b3})
syntax('DiagnosticHint', {fg=vcolors.g3})
syntax('DiagnosticUnderlineError', {style='underline'})
syntax('DiagnosticUnderlineWarn', {style='underline'})
syntax('DiagnosticUnderlineInfo', {style='underline'})
syntax('DiagnosticUnderlineHint', {style='underline'})
-- Git signs
link('GitSignsAdd', 'DiffAdd')
link('GitSignsChange', 'DiffChange')
link('GitSignsDelete', 'DiffDelete')