From 978f17aa640c737cd9959c346560543a7745bb61 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 7 May 2026 10:54:28 -0400 Subject: [PATCH] more compat --- colors/anticuus.vim | 196 ++++++++++++++++++++++++-------------------- vimrc | 7 +- 2 files changed, 114 insertions(+), 89 deletions(-) diff --git a/colors/anticuus.vim b/colors/anticuus.vim index 81c555c..0652d44 100644 --- a/colors/anticuus.vim +++ b/colors/anticuus.vim @@ -1,6 +1,5 @@ " anticuus.vim -" Pitch-black minimalist theme — port of nvim anticuus + custom syntax extensions. -" Requires `set termguicolors`. +" Pitch-black minimalist theme with 256-color terminal fallbacks. hi clear if exists('syntax_on') @@ -10,133 +9,156 @@ endif let g:colors_name = 'anticuus' set background=dark +function! s:hi(group, guifg, guibg, ctermfg, ctermbg, gui, cterm) + let l:cmd = 'highlight ' . a:group + if a:guifg !=# '' + let l:cmd .= ' guifg=' . a:guifg + endif + if a:guibg !=# '' + let l:cmd .= ' guibg=' . a:guibg + endif + if a:ctermfg !=# '' + let l:cmd .= ' ctermfg=' . a:ctermfg + endif + if a:ctermbg !=# '' + let l:cmd .= ' ctermbg=' . a:ctermbg + endif + if a:gui !=# '' + let l:cmd .= ' gui=' . a:gui + endif + if a:cterm !=# '' + let l:cmd .= ' cterm=' . a:cterm + endif + execute l:cmd +endfunction + " === Base === -highlight Normal guifg=#dadada guibg=#000000 -highlight NormalNC guifg=#dadada guibg=#000000 -highlight NonText guifg=#3a3a3a guibg=NONE -highlight EndOfBuffer guifg=#000000 guibg=NONE -highlight Whitespace guifg=#3a3a3a -highlight SpecialKey guifg=#3a3a3a +call s:hi('Normal', '#dadada', '#000000', '253', '16', '', '') +call s:hi('NormalNC', '#dadada', '#000000', '253', '16', '', '') +call s:hi('NonText', '#3a3a3a', 'NONE', '237', 'NONE', '', '') +call s:hi('EndOfBuffer', '#000000', 'NONE', '16', 'NONE', '', '') +call s:hi('Whitespace', '#3a3a3a', '', '237', '', '', '') +call s:hi('SpecialKey', '#3a3a3a', '', '237', '', '', '') " === Syntax: comments dim italic, strings green === -highlight Comment guifg=#5a5a5a gui=italic cterm=italic -highlight SpecialComment guifg=#5a5a5a gui=italic cterm=italic -highlight String guifg=#00b300 -highlight Character guifg=#5a5a5a gui=italic cterm=italic +call s:hi('Comment', '#5a5a5a', '', '240', '', 'italic', 'italic') +call s:hi('SpecialComment', '#5a5a5a', '', '240', '', 'italic', 'italic') +call s:hi('String', '#00b300', '', '34', '', '', '') +call s:hi('Character', '#5a5a5a', '', '240', '', 'italic', 'italic') " === Literals: purple === -highlight Number guifg=#c490d0 -highlight Float guifg=#c490d0 -highlight Boolean guifg=#c490d0 -highlight Constant guifg=#c490d0 +call s:hi('Number', '#c490d0', '', '176', '', '', '') +call s:hi('Float', '#c490d0', '', '176', '', '', '') +call s:hi('Boolean', '#c490d0', '', '176', '', '', '') +call s:hi('Constant', '#c490d0', '', '176', '', '', '') " === Identifiers / functions: white baseline, functions teal === -highlight Identifier guifg=#dadada -highlight Function guifg=#88ddcc +call s:hi('Identifier', '#dadada', '', '253', '', '', '') +call s:hi('Function', '#88ddcc', '', '116', '', '', '') " === Statements: yellow keywords, red exception/return === -highlight Statement guifg=#ffcc00 -highlight Conditional guifg=#ffcc00 -highlight Repeat guifg=#dadada -highlight Keyword guifg=#ffcc00 -highlight Operator guifg=#dadada -highlight Label guifg=#ffcc00 -highlight Exception guifg=#ff6b6b +call s:hi('Statement', '#ffcc00', '', '220', '', '', '') +call s:hi('Conditional', '#ffcc00', '', '220', '', '', '') +call s:hi('Repeat', '#dadada', '', '253', '', '', '') +call s:hi('Keyword', '#ffcc00', '', '220', '', '', '') +call s:hi('Operator', '#dadada', '', '253', '', '', '') +call s:hi('Label', '#ffcc00', '', '220', '', '', '') +call s:hi('Exception', '#ff6b6b', '', '203', '', '', '') " === PreProc family: green === -highlight PreProc guifg=#00b300 -highlight Include guifg=#00b300 -highlight Define guifg=#00b300 -highlight Macro guifg=#00b300 -highlight PreCondit guifg=#00b300 +call s:hi('PreProc', '#00b300', '', '34', '', '', '') +call s:hi('Include', '#00b300', '', '34', '', '', '') +call s:hi('Define', '#00b300', '', '34', '', '', '') +call s:hi('Macro', '#00b300', '', '34', '', '', '') +call s:hi('PreCondit', '#00b300', '', '34', '', '', '') " === Types: amber === -highlight Type guifg=#e8a060 -highlight StorageClass guifg=#e8a060 -highlight Structure guifg=#e8a060 -highlight Typedef guifg=#e8a060 +call s:hi('Type', '#e8a060', '', '215', '', '', '') +call s:hi('StorageClass', '#e8a060', '', '215', '', '', '') +call s:hi('Structure', '#e8a060', '', '215', '', '', '') +call s:hi('Typedef', '#e8a060', '', '215', '', '', '') " === Special: green for special chars, red for tags === -highlight Special guifg=#00b300 -highlight SpecialChar guifg=#00b300 -highlight Tag guifg=#ff6b6b -highlight Delimiter guifg=#dadada +call s:hi('Special', '#00b300', '', '34', '', '', '') +call s:hi('SpecialChar', '#00b300', '', '34', '', '', '') +call s:hi('Tag', '#ff6b6b', '', '203', '', '', '') +call s:hi('Delimiter', '#dadada', '', '253', '', '', '') " === Errors / Todo === -highlight Error guifg=#ff6b6b -highlight Todo guifg=#ffcc00 gui=bold cterm=bold +call s:hi('Error', '#ff6b6b', '', '203', '', '', '') +call s:hi('Todo', '#ffcc00', '', '220', '', 'bold', 'bold') " === Line numbers / cursor / columns === -highlight LineNr guifg=#dadada guibg=NONE -highlight CursorLineNr guifg=#dadada guibg=#282828 gui=bold cterm=bold -highlight CursorLine guibg=#121212 -highlight CursorColumn guibg=#121212 -highlight ColorColumn guibg=#1a1a1a -highlight SignColumn guifg=#00b300 guibg=#000000 +call s:hi('LineNr', '#dadada', 'NONE', '253', 'NONE', '', '') +call s:hi('CursorLineNr', '#dadada', '#282828', '253', '235', 'bold', 'bold') +call s:hi('CursorLine', '', '#121212', '', '233', 'NONE', 'NONE') +call s:hi('CursorColumn', '', '#121212', '', '233', '', '') +call s:hi('ColorColumn', '', '#1a1a1a', '', '234', '', '') +call s:hi('SignColumn', '#00b300', '#000000', '34', '16', '', '') " === Splits / status / winbar === -highlight VertSplit guifg=#3a3a3a guibg=NONE -highlight WinSeparator guifg=#3a3a3a guibg=NONE -highlight StatusLine guifg=#dadada guibg=#000000 -highlight StatusLineNC guifg=#dadada guibg=#000000 -highlight WinBar guifg=#dadada gui=bold cterm=bold -highlight WinBarNC guifg=#888888 +call s:hi('VertSplit', '#3a3a3a', 'NONE', '237', 'NONE', '', '') +call s:hi('WinSeparator', '#3a3a3a', 'NONE', '237', 'NONE', '', '') +call s:hi('StatusLine', '#dadada', '#000000', '253', '16', '', '') +call s:hi('StatusLineNC', '#dadada', '#000000', '253', '16', '', '') +call s:hi('WinBar', '#dadada', '', '253', '', 'bold', 'bold') +call s:hi('WinBarNC', '#888888', '', '245', '', '', '') " === Visual / search === -highlight Visual guibg=#3a3a3a -highlight VisualNOS guibg=#3a3a3a -highlight Search guifg=#000000 guibg=#ffcc00 -highlight IncSearch guifg=#000000 guibg=#88ddcc -highlight CurSearch guifg=#000000 guibg=#c490d0 +call s:hi('Visual', '', '#3a3a3a', '', '237', '', '') +call s:hi('VisualNOS', '', '#3a3a3a', '', '237', '', '') +call s:hi('Search', '#000000', '#ffcc00', '16', '220', '', '') +call s:hi('IncSearch', '#000000', '#88ddcc', '16', '116', '', '') +call s:hi('CurSearch', '#000000', '#c490d0', '16', '176', '', '') " === Brackets === -highlight MatchParen guifg=#c490d0 gui=bold,underline cterm=bold,underline +call s:hi('MatchParen', '#c490d0', '', '176', '', 'bold,underline', 'bold,underline') " === Popup menu (completion / fzf overlay) === -highlight Pmenu guifg=#dadada guibg=#181818 -highlight PmenuSel guifg=#000000 guibg=#ffcc00 -highlight PmenuSbar guibg=#181818 -highlight PmenuThumb guibg=#3a3a3a +call s:hi('Pmenu', '#dadada', '#181818', '253', '234', '', '') +call s:hi('PmenuSel', '#000000', '#ffcc00', '16', '220', '', '') +call s:hi('PmenuSbar', '', '#181818', '', '234', '', '') +call s:hi('PmenuThumb', '', '#3a3a3a', '', '237', '', '') " === Folds / titles / directories === -highlight Folded guifg=#888888 gui=italic cterm=italic -highlight FoldColumn guifg=#888888 guibg=NONE -highlight Title guifg=#88ddcc gui=bold cterm=bold -highlight Directory guifg=#88ddcc +call s:hi('Folded', '#888888', '', '245', '', 'italic', 'italic') +call s:hi('FoldColumn', '#888888', 'NONE', '245', 'NONE', '', '') +call s:hi('Title', '#88ddcc', '', '116', '', 'bold', 'bold') +call s:hi('Directory', '#88ddcc', '', '116', '', '', '') " === Diff === -highlight DiffAdd guifg=#a5d6a7 guibg=#0a2010 -highlight DiffChange guifg=#e8a060 guibg=#201a0a -highlight DiffDelete guifg=#ff6b6b guibg=#200a0a -highlight DiffText guifg=#ffcc00 guibg=#3a2000 gui=bold cterm=bold +call s:hi('DiffAdd', '#a5d6a7', '#0a2010', '151', '22', '','') +call s:hi('DiffChange', '#e8a060', '#201a0a', '215', '58', '','') +call s:hi('DiffDelete', '#ff6b6b', '#200a0a', '203', '52', '','') +call s:hi('DiffText', '#ffcc00', '#3a2000', '220', '94', 'bold', 'bold') " === Spell === highlight SpellBad guisp=#ff6b6b gui=undercurl cterm=underline highlight SpellCap guisp=#ffcc00 gui=undercurl cterm=underline highlight SpellRare guisp=#c490d0 gui=undercurl cterm=underline -highlight SpellLocal guisp=#88ddcc gui=undercurl cterm=undercurl +highlight SpellLocal guisp=#88ddcc gui=undercurl cterm=underline " === Markdown (vim's built-in syntax) === -highlight markdownH1 guifg=#00b300 gui=bold cterm=bold -highlight markdownH2 guifg=#00b300 gui=bold cterm=bold -highlight markdownH3 guifg=#00b300 gui=bold cterm=bold -highlight markdownH4 guifg=#00b300 gui=bold cterm=bold -highlight markdownH5 guifg=#00b300 gui=bold cterm=bold -highlight markdownH6 guifg=#00b300 gui=bold cterm=bold -highlight markdownHeadingDelimiter guifg=#00b300 gui=bold cterm=bold -highlight markdownLinkText guifg=#88ddcc gui=underline cterm=underline -highlight markdownUrl guifg=#5a5a5a gui=italic cterm=italic -highlight markdownCode guifg=#e8a060 -highlight markdownCodeBlock guifg=#e8a060 +call s:hi('markdownH1', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownH2', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownH3', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownH4', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownH5', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownH6', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownHeadingDelimiter', '#00b300', '', '34', '', 'bold', 'bold') +call s:hi('markdownLinkText', '#88ddcc', '', '116', '', 'underline', 'underline') +call s:hi('markdownUrl', '#5a5a5a', '', '240', '', 'italic', 'italic') +call s:hi('markdownCode', '#e8a060', '', '215', '', '', '') +call s:hi('markdownCodeBlock', '#e8a060', '', '215', '', '', '') " === Diagnostic groups (for plugins like ALE/CoC) === -highlight DiagnosticError guifg=#ff6b6b -highlight DiagnosticWarn guifg=#ffcc00 -highlight DiagnosticInfo guifg=#00b300 -highlight DiagnosticHint guifg=#dadada +call s:hi('DiagnosticError', '#ff6b6b', '', '203', '', '', '') +call s:hi('DiagnosticWarn', '#ffcc00', '', '220', '', '', '') +call s:hi('DiagnosticInfo', '#00b300', '', '34', '', '', '') +call s:hi('DiagnosticHint', '#dadada', '', '253', '', '', '') highlight link ALEErrorSign DiagnosticError highlight link ALEWarningSign DiagnosticWarn highlight link ALEInfoSign DiagnosticInfo " === vim-highlightedyank === -highlight HighlightedyankRegion guifg=#000000 guibg=#ffcc00 +call s:hi('HighlightedyankRegion', '#000000', '#ffcc00', '16', '220', '', '') diff --git a/vimrc b/vimrc index 8f4c90a..8c3ac5c 100644 --- a/vimrc +++ b/vimrc @@ -27,6 +27,9 @@ call plug#end() let mapleader = "\" set background=dark +if !has('gui_running') && &t_Co < 256 + set t_Co=256 +endif if has('termguicolors') set termguicolors endif @@ -34,8 +37,8 @@ silent! colorscheme anticuus highlight Normal ctermbg=NONE guibg=NONE ctermfg=White guifg=#FFFFFF highlight NonText ctermbg=NONE guibg=NONE -highlight CursorLine ctermbg=NONE guibg=NONE -highlight CursorLineNr ctermfg=Yellow guifg=#E5C07B ctermbg=NONE guibg=NONE cterm=bold gui=bold +highlight CursorLine term=NONE cterm=NONE gui=NONE ctermbg=NONE guibg=NONE +highlight CursorLineNr term=bold ctermfg=Yellow guifg=#E5C07B ctermbg=NONE guibg=NONE cterm=bold gui=bold highlight HighlightedyankRegion ctermfg=Black guifg=#000000 ctermbg=Yellow guibg=yellow highlight NormalNC ctermbg=NONE guibg=NONE highlight Search ctermfg=Black guifg=#000000 ctermbg=Yellow guibg=#FFCC66