nvim: yolokai: Sync with upstream
Sync with upstream to use the new nvim_set_hl API. The white color was actually wrong, so fix it.
This commit is contained in:
parent
bc55909a12
commit
3e9ed93517
2 changed files with 155 additions and 221 deletions
|
@ -17,7 +17,7 @@ lua << EOF
|
||||||
|
|
||||||
vim.g.colors_name = 'yolokai'
|
vim.g.colors_name = 'yolokai'
|
||||||
|
|
||||||
local white = { '#DOBFA1', 252, 'white' }
|
local white = { '#ffffff', 252, 'white' }
|
||||||
local white2 = { '#d8d8d3', 250, 'white2' }
|
local white2 = { '#d8d8d3', 250, 'white2' }
|
||||||
local black = { '#000000', 234, 'black' }
|
local black = { '#000000', 234, 'black' }
|
||||||
local lightblack = { '#2D2E27', 235, 'lightblack' }
|
local lightblack = { '#2D2E27', 235, 'lightblack' }
|
||||||
|
@ -40,144 +40,137 @@ local red = { '#e73c50', 196, 'red' }
|
||||||
local purered = { '#ff0000', 52, 'purered' }
|
local purered = { '#ff0000', 52, 'purered' }
|
||||||
local darkred = { '#5f0000', 52, 'darkred' }
|
local darkred = { '#5f0000', 52, 'darkred' }
|
||||||
|
|
||||||
--[[ DO NOT EDIT `BG`, `FG`, or `NONE`.
|
|
||||||
Feel free to uncomment `BG`. It is not used by default so it is commented out.
|
|
||||||
]]
|
|
||||||
local BG = 'bg'
|
|
||||||
local FG = 'fg'
|
|
||||||
local NONE = 'NONE'
|
|
||||||
|
|
||||||
--[[ These are the ones you should edit. ]]
|
--[[ These are the ones you should edit. ]]
|
||||||
-- This is the only highlight that must be defined separately.
|
-- This is the only highlight that must be defined separately.
|
||||||
local highlight_group_normal = {bg=black, fg=white, style=NONE}
|
local highlight_group_normal = {bg=black, fg=white}
|
||||||
|
|
||||||
-- This is where the rest of your highlights should go.
|
-- This is where the rest of your highlights should go.
|
||||||
local highlight_groups = {
|
local highlight_groups = {
|
||||||
--[[ 4.1. Text Analysis ]]
|
--[[ 4.1. Text Analysis ]]
|
||||||
Comment = {bg=NONE, fg=warmgrey, style='italic'},
|
EndOfBuffer = 'NonText' ,
|
||||||
EndOfBuffer = 'NonText',
|
Whitespace = 'NonText' ,
|
||||||
NonText = {bg=NONE, fg=lightgrey, style=NONE },
|
Comment = { fg=warmgrey , style='italic' },
|
||||||
Whitespace = 'NonText',
|
NonText = { fg=lightgrey },
|
||||||
|
|
||||||
--[[ 4.1.1. Literals]]
|
--[[ 4.1.1. Literals]]
|
||||||
Constant = {bg=NONE, fg=purple, style=NONE},
|
Constant = { fg=purple },
|
||||||
String = {bg=NONE, fg=yellow, style=NONE},
|
String = { fg=yellow },
|
||||||
Character = {bg=NONE, fg=yellow, style=NONE},
|
Character = { fg=yellow },
|
||||||
Number = {bg=NONE, fg=purple, style=NONE},
|
Number = { fg=purple },
|
||||||
Boolean = {bg=NONE, fg=purple, style=NONE},
|
Boolean = { fg=purple },
|
||||||
Float = 'Number',
|
Float = 'Number' ,
|
||||||
|
|
||||||
--[[ 4.1.2. Identifiers]]
|
--[[ 4.1.2. Identifiers]]
|
||||||
Identifier = {bg=NONE, fg=green, style=NONE},
|
Identifier = { fg=green },
|
||||||
Function = {bg=NONE, fg=darkgreen, style=NONE},
|
Function = { fg=darkgreen },
|
||||||
|
|
||||||
--[[ 4.1.3. Syntax]]
|
--[[ 4.1.3. Syntax]]
|
||||||
Statement = {bg=NONE, fg=pink, style=NONE },
|
|
||||||
Conditional = {bg=NONE, fg=pink, style='italic'},
|
|
||||||
Repeat = 'Keyword',
|
Repeat = 'Keyword',
|
||||||
Label = {bg=NONE, fg=pink, style='italic'},
|
|
||||||
Operator = {bg=NONE, fg=pink, style=NONE },
|
|
||||||
Keyword = {bg=NONE, fg=pink, style='bold' },
|
|
||||||
Exception = {bg=NONE, fg=red, style='bold' },
|
|
||||||
Noise = 'Delimiter',
|
Noise = 'Delimiter',
|
||||||
|
Statement = { fg=pink },
|
||||||
|
Conditional = { fg=pink, style='italic' },
|
||||||
|
Label = { fg=pink, style='italic' },
|
||||||
|
Operator = { fg=pink },
|
||||||
|
Keyword = { fg=pink, style='bold' },
|
||||||
|
Exception = { fg=red, style='bold' },
|
||||||
|
|
||||||
--[[ 4.1.4. Metatextual Information]]
|
--[[ 4.1.4. Metatextual Information]]
|
||||||
PreProc = {bg=NONE, fg=green, style=NONE },
|
PreProc = { fg=green },
|
||||||
Include = {bg=NONE, fg=pink, style='nocombine'},
|
Include = { fg=pink, style='nocombine' },
|
||||||
Define = {bg=NONE, fg=pink, style='nocombine'},
|
Define = { fg=pink, style='nocombine' },
|
||||||
Macro = {bg=NONE, fg=orange, style={'bold', 'nocombine'}},
|
Macro = { fg=orange, style={'bold', 'nocombine' }},
|
||||||
PreCondit = {bg=NONE, fg=green, style='nocombine'},
|
PreCondit = { fg=green, style='nocombine' },
|
||||||
|
|
||||||
--[[ 4.1.5. Semantics]]
|
--[[ 4.1.5. Semantics]]
|
||||||
Type = {bg=NONE, fg=aqua, style=NONE },
|
Type = { fg=aqua },
|
||||||
StorageClass = {bg=NONE, fg=aqua, style='bold' },
|
StorageClass = { fg=aqua, style='bold' },
|
||||||
Structure = {bg=NONE, fg=aqua, style='bold' },
|
Structure = { fg=aqua, style='bold' },
|
||||||
Typedef = {bg=NONE, fg=aqua, style='italic'},
|
Typedef = { fg=aqua, style='italic' },
|
||||||
|
|
||||||
--[[ 4.1.6. Edge Cases]]
|
--[[ 4.1.6. Edge Cases]]
|
||||||
Special = {bg=NONE, fg=purple, style=NONE },
|
|
||||||
SpecialChar = 'Character' ,
|
SpecialChar = 'Character' ,
|
||||||
SpecialKey = 'Character' ,
|
SpecialKey = 'Character' ,
|
||||||
Tag = 'Underlined',
|
Tag = 'Underlined',
|
||||||
Delimiter = {bg=NONE, fg=red, style=NONE },
|
Special = { fg=purple },
|
||||||
|
Delimiter = { fg=red },
|
||||||
-- SpecialComment affects Haskell Language Extension
|
-- SpecialComment affects Haskell Language Extension
|
||||||
SpecialComment = {bg=NONE, fg=orange, style={'bold', 'nocombine'}},
|
SpecialComment = { fg=orange , style={'bold', 'nocombine'}},
|
||||||
Debug = 'WarningMsg',
|
Debug = 'WarningMsg',
|
||||||
|
|
||||||
--[[ 4.1.7. Help Syntax]]
|
--[[ 4.1.7. Help Syntax]]
|
||||||
Underlined = {bg=NONE, fg=green, style='underline' },
|
Ignore = { fg=gray },
|
||||||
Ignore = {bg=NONE, fg=gray, style=NONE },
|
Error = { bg=black , fg=red },
|
||||||
Error = {bg=black, fg=red, style=NONE },
|
Underlined = { fg=green , style='underline' },
|
||||||
Todo = {bg=NONE, fg=orange, style={'bold', 'underline'}},
|
Todo = { fg=orange, style={'bold', 'underline' }},
|
||||||
Hint = {bg=black, fg=white, style='bold' },
|
Hint = { bg=black , fg=white, style='bold' },
|
||||||
Info = {bg=orange, fg=black, style='bold' },
|
Info = { bg=orange, fg=black, style='bold' },
|
||||||
Warning = {bg=pink, fg=black, style='bold' },
|
Warning = { bg=pink , fg=black, style='bold' },
|
||||||
|
|
||||||
--[[ 4.2... Editor UI ]]
|
--[[ 4.2... Editor UI ]]
|
||||||
--[[ 4.2.1. Status Line]]
|
--[[ 4.2.1. Status Line]]
|
||||||
StatusLine = {bg=black, fg=warmgrey, style=NONE},
|
StatusLine = { bg=black, fg=warmgrey },
|
||||||
StatusLineNC = {bg=black, fg=darkgrey, style=NONE},
|
StatusLineNC = { bg=black, fg=darkgrey },
|
||||||
StatusLineTerm = 'StatusLine' ,
|
StatusLineTerm = 'StatusLine' ,
|
||||||
StatusLineTermNC = 'StatusLineNC',
|
StatusLineTermNC = 'StatusLineNC',
|
||||||
|
|
||||||
--[[ 4.2.2. Separators]]
|
--[[ 4.2.2. Separators]]
|
||||||
VertSplit = {bg=darkblack, fg=darkgrey, style=NONE },
|
VertSplit = { bg=darkblack, fg=darkgrey },
|
||||||
TabLine = {bg=darkblack, fg=white, style=NONE },
|
TabLine = { bg=darkblack, fg=white },
|
||||||
TabLineFill = {bg=NONE, fg=FG, style=NONE },
|
TabLineFill = { fg=white },
|
||||||
TabLineSel = {bg=darkgrey, fg=FG, style='inverse'},
|
TabLineSel = { bg=darkgrey, fg=white, style='inverse' },
|
||||||
Title = {bg=NONE, fg=NONE, style='bold' },
|
Title = { style='bold' },
|
||||||
|
|
||||||
--[[ 4.2.3. Conditional Line Highlighting]]
|
--[[ 4.2.3. Conditional Line Highlighting]]
|
||||||
--Conceal={}
|
--Conceal={}
|
||||||
CursorLine = {bg=lightblack2, fg=NONE, style=NONE },
|
|
||||||
CursorLineNr = {bg=lightblack, fg=orange,style=NONE },
|
|
||||||
debugBreakpoint = 'ErrorMsg' ,
|
debugBreakpoint = 'ErrorMsg' ,
|
||||||
debugPC = 'ColorColumn',
|
debugPC = 'ColorColumn',
|
||||||
LineNr = {bg=black, fg=grey, style=NONE },
|
CursorLine = { bg=lightblack2 },
|
||||||
QuickFixLine = {bg=darkgrey, fg=NONE, style=NONE },
|
CursorLineNr = { bg=lightblack, fg=orange },
|
||||||
Visual = {bg=NONE, fg=NONE, style='inverse'},
|
LineNr = { bg=black, fg=grey },
|
||||||
VisualNOS = {bg=darkgrey, fg=NONE, style=NONE },
|
QuickFixLine = { bg=darkgrey },
|
||||||
|
Visual = { style='inverse' },
|
||||||
|
VisualNOS = { bg=darkgrey },
|
||||||
|
|
||||||
--[[ 4.2.4. Popup Menu]]
|
--[[ 4.2.4. Popup Menu]]
|
||||||
Pmenu = {bg=black, fg=aqua, style=NONE },
|
Pmenu = { bg=black, fg=aqua },
|
||||||
PmenuSbar = {bg=black, fg=NONE, style=NONE },
|
PmenuSbar = { bg=black },
|
||||||
PmenuSel = {bg=warmgrey, fg=white, style='bold' },
|
PmenuSel = { bg=warmgrey, fg=white, style='bold' },
|
||||||
PmenuThumb = {bg=grey, fg=lightblack, style=NONE },
|
PmenuThumb = { bg=grey, fg=lightblack },
|
||||||
WildMenu = {bg=NONE, fg=NONE, style=NONE },
|
WildMenu = {},
|
||||||
|
|
||||||
--[[ 4.2.5. Folds]]
|
--[[ 4.2.5. Folds]]
|
||||||
FoldColumn = {bg=darkblack, fg=NONE, style='bold' },
|
FoldColumn = { bg=darkblack, style='bold' },
|
||||||
Folded = {bg=darkblack, fg=warmgrey, style='italic'},
|
Folded = { bg=darkblack, fg=warmgrey, style='italic' },
|
||||||
|
|
||||||
--[[ 4.2.6. Diffs]]
|
--[[ 4.2.6. Diffs]]
|
||||||
DiffAdd = {bg=black, fg=darkgreen, style=NONE},
|
DiffAdd = { bg=black, fg=darkgreen },
|
||||||
DiffChange = {bg=black, fg=yellow, style=NONE},
|
DiffChange = { bg=black, fg=yellow },
|
||||||
DiffDelete = {bg=black, fg=red, style=NONE},
|
DiffDelete = { bg=black, fg=red },
|
||||||
DiffText = {bg=black, fg=NONE, style=NONE},
|
DiffText = { bg=black },
|
||||||
|
|
||||||
--[[ 4.2.7. Searching]]
|
--[[ 4.2.7. Searching]]
|
||||||
IncSearch = {bg=NONE, fg=NONE, style='inverse' },
|
IncSearch = { style='inverse' },
|
||||||
Search = {bg=yellow,fg=black, style={'underline', color=white}},
|
Search = { bg=yellow,fg=black, style={'underline', color=white }},
|
||||||
CurSearch = {bg=pink, fg=black, style={'underline', color=white}},
|
CurSearch = { bg=pink, fg=black, style={'underline', color=white }},
|
||||||
MatchParen = {bg=NONE, fg=orange, style={'bold', 'underline' }},
|
MatchParen = { fg=orange, style={'bold', 'underline' }},
|
||||||
|
|
||||||
--[[ 4.2.8. Spelling]]
|
--[[ 4.2.8. Spelling]]
|
||||||
SpellBad = {bg=NONE, fg=NONE, style={'undercurl', color=red }},
|
SpellBad = { style={'undercurl', color=red }},
|
||||||
SpellCap = {bg=NONE, fg=NONE, style={'undercurl', color=purple}},
|
SpellCap = { style={'undercurl', color=purple }},
|
||||||
SpellLocal = {bg=NONE, fg=NONE, style={'undercurl', color=pink }},
|
SpellLocal = { style={'undercurl', color=pink }},
|
||||||
SpellRare = {bg=NONE, fg=NONE, style={'undercurl', color=aqua }},
|
SpellRare = { style={'undercurl', color=aqua }},
|
||||||
|
|
||||||
--[[ 4.2.9. Conditional Column Highlighting]]
|
--[[ 4.2.9. Conditional Column Highlighting]]
|
||||||
ColorColumn = {bg=lightblack, fg=NONE, style=NONE },
|
ColorColumn = { bg=lightblack },
|
||||||
SignColumn = {bg=black, fg=NONE, style=NONE },
|
SignColumn = { bg=black },
|
||||||
|
|
||||||
--[[ 4.2.10. Messages]]
|
--[[ 4.2.10. Messages]]
|
||||||
ErrorMsg = {bg=black, fg=red, style=NONE },
|
ErrorMsg = { bg=black, fg=red },
|
||||||
HintMsg = {bg=black, fg=purple, style='bold' },
|
HintMsg = { bg=black, fg=purple, style='bold' },
|
||||||
InfoMsg = {bg=black, fg=orange, style='bold' },
|
InfoMsg = { bg=black, fg=orange, style='bold' },
|
||||||
ModeMsg = {bg=black, fg=yellow, style=NONE },
|
ModeMsg = { bg=black, fg=yellow },
|
||||||
WarningMsg = {bg=black, fg=pink, style='bold' },
|
WarningMsg = { bg=black, fg=pink, style='bold' },
|
||||||
Question = {bg=black, fg=yellow, style='underline'},
|
Question = { bg=black, fg=yellow, style='underline' },
|
||||||
|
|
||||||
--[[ 4.2.11. Diagnostics ]]
|
--[[ 4.2.11. Diagnostics ]]
|
||||||
DiagnosticError = 'ErrorMsg' ,
|
DiagnosticError = 'ErrorMsg' ,
|
||||||
|
@ -206,14 +199,14 @@ local highlight_groups = {
|
||||||
DiagnosticVirtualTextHint = 'HintMsg' ,
|
DiagnosticVirtualTextHint = 'HintMsg' ,
|
||||||
|
|
||||||
--[[ 4.2.12. Cursor ]]
|
--[[ 4.2.12. Cursor ]]
|
||||||
Cursor = {bg=white, fg=black, style='inverse'},
|
CursorIM = 'Cursor',
|
||||||
CursorIM = 'Cursor',
|
Cursor = { bg=white, fg=black, style='inverse' },
|
||||||
CursorColumn = {bg=lightblack2,fg=NONE, style=NONE },
|
CursorColumn = { bg=lightblack2 },
|
||||||
|
|
||||||
--[[ 4.2.13. Misc ]]
|
--[[ 4.2.13. Misc ]]
|
||||||
Directory = {bg=NONE, fg=aqua, style='bold'},
|
|
||||||
Terminal = 'Normal',
|
Terminal = 'Normal',
|
||||||
NormalFloat = {bg=black, fg=white, style=NONE },
|
Directory = { fg=aqua, style='bold' },
|
||||||
|
NormalFloat = { bg=black, fg=white },
|
||||||
|
|
||||||
--[[ 4.2.14. LSP Highlight ]]
|
--[[ 4.2.14. LSP Highlight ]]
|
||||||
LspReferenceText = 'InfoMsg',
|
LspReferenceText = 'InfoMsg',
|
||||||
|
@ -298,7 +291,7 @@ local highlight_groups = {
|
||||||
scssElse = 'scssIf',
|
scssElse = 'scssIf',
|
||||||
scssMixinName = function(self)
|
scssMixinName = function(self)
|
||||||
local super = self.cssClassName
|
local super = self.cssClassName
|
||||||
return {bg = super.bg, fg=super.fg, style='Italic'}
|
return {bg = super.bg, fg=super.fg, style='italic'}
|
||||||
end,
|
end,
|
||||||
scssIf = 'PreCondit',
|
scssIf = 'PreCondit',
|
||||||
scssInclude = 'Include',
|
scssInclude = 'Include',
|
||||||
|
@ -324,7 +317,7 @@ local highlight_groups = {
|
||||||
goFormatSpecifier = 'Character' ,
|
goFormatSpecifier = 'Character' ,
|
||||||
goFunction = 'Function' ,
|
goFunction = 'Function' ,
|
||||||
goFunctionCall = 'goFunction',
|
goFunctionCall = 'goFunction',
|
||||||
goFunctionReturn = {bg=NONE, fg=NONE, style=NONE},
|
goFunctionReturn = {},
|
||||||
goMethodCall = 'goFunctionCall',
|
goMethodCall = 'goFunctionCall',
|
||||||
goParamType = 'goReceiverType',
|
goParamType = 'goReceiverType',
|
||||||
goPointerOperator = 'SpecialChar' ,
|
goPointerOperator = 'SpecialChar' ,
|
||||||
|
@ -340,7 +333,7 @@ local highlight_groups = {
|
||||||
|
|
||||||
--[[ 4.3.8. HTML ]]
|
--[[ 4.3.8. HTML ]]
|
||||||
htmlArg = 'Label',
|
htmlArg = 'Label',
|
||||||
htmlBold = {bg=NONE, fg=lightgrey, style='bold'},
|
htmlBold = { fg=lightgrey, style='bold' },
|
||||||
htmlTitle = 'htmlBold',
|
htmlTitle = 'htmlBold',
|
||||||
htmlEndTag = 'htmlTag',
|
htmlEndTag = 'htmlTag',
|
||||||
htmlH1 = 'markdownH1',
|
htmlH1 = 'markdownH1',
|
||||||
|
@ -349,7 +342,7 @@ local highlight_groups = {
|
||||||
htmlH4 = 'markdownH4',
|
htmlH4 = 'markdownH4',
|
||||||
htmlH5 = 'markdownH5',
|
htmlH5 = 'markdownH5',
|
||||||
htmlH6 = 'markdownH6',
|
htmlH6 = 'markdownH6',
|
||||||
htmlItalic = {bg=NONE, fg=NONE, style='italic'},
|
htmlItalic = { style='italic' },
|
||||||
htmlSpecialTagName = 'Keyword',
|
htmlSpecialTagName = 'Keyword',
|
||||||
htmlTag = 'Special',
|
htmlTag = 'Special',
|
||||||
htmlTagN = 'Typedef',
|
htmlTagN = 'Typedef',
|
||||||
|
@ -377,12 +370,12 @@ local highlight_groups = {
|
||||||
makeSpecTarget = 'Type' ,
|
makeSpecTarget = 'Type' ,
|
||||||
|
|
||||||
--[[ 4.3.13. Markdown ]]
|
--[[ 4.3.13. Markdown ]]
|
||||||
markdownH1 = {bg=NONE, fg=green_dark, style='bold' },
|
markdownH1 = { fg=green_dark, style='bold' },
|
||||||
markdownH2 = {bg=NONE, fg=red_light, style='bold' },
|
markdownH2 = { fg=red_light, style='bold' },
|
||||||
markdownH3 = {bg=NONE, fg=green, style='bold' },
|
markdownH3 = { fg=green, style='bold' },
|
||||||
markdownH4 = {bg=NONE, fg=purple, style='bold' },
|
markdownH4 = { fg=purple, style='bold' },
|
||||||
markdownH5 = {bg=NONE, fg=orange, style='bold' },
|
markdownH5 = { fg=orange, style='bold' },
|
||||||
markdownH6 = {bg=NONE, fg=yellow, style='bold' },
|
markdownH6 = { fg=yellow, style='bold' },
|
||||||
mkdBold = 'SpecialComment' ,
|
mkdBold = 'SpecialComment' ,
|
||||||
mkdCode = 'Keyword' ,
|
mkdCode = 'Keyword' ,
|
||||||
mkdCodeDelimiter = 'mkdBold' ,
|
mkdCodeDelimiter = 'mkdBold' ,
|
||||||
|
@ -537,14 +530,14 @@ local highlight_groups = {
|
||||||
|
|
||||||
--[[ 4.3.28. PlantUML ]]
|
--[[ 4.3.28. PlantUML ]]
|
||||||
plantumlArrowLR = 'Statement',
|
plantumlArrowLR = 'Statement',
|
||||||
plantumlColonLine = NONE ,
|
plantumlColonLine = {} ,
|
||||||
plantumlMindmap = 'Label' ,
|
plantumlMindmap = 'Label' ,
|
||||||
plantumlMindmap2 = 'Label' ,
|
plantumlMindmap2 = 'Label' ,
|
||||||
|
|
||||||
--[[ 4.3.33. YAML ]]
|
--[[ 4.3.33. YAML ]]
|
||||||
yamlKey = 'Label',
|
yamlKey = 'Label',
|
||||||
yamlBlockMappingKey = { bg=black, fg=red, style=NONE },
|
yamlBlockMappingKey = { bg=black, fg=red },
|
||||||
yamlPlainScalar = { bg=black, fg=green, style=NONE },
|
yamlPlainScalar = { bg=black, fg=green },
|
||||||
|
|
||||||
--[[ 4.3.34. Git ]]
|
--[[ 4.3.34. Git ]]
|
||||||
diffAdded = 'DiffAdd' ,
|
diffAdded = 'DiffAdd' ,
|
||||||
|
@ -602,10 +595,10 @@ local highlight_groups = {
|
||||||
htmlH6 = 'markdownH6',
|
htmlH6 = 'markdownH6',
|
||||||
|
|
||||||
--[[ 4.4.4. vim-gitgutter / vim-signify ]]
|
--[[ 4.4.4. vim-gitgutter / vim-signify ]]
|
||||||
GitGutterAdd = {bg=NONE, fg=green, style=NONE},
|
GitGutterAdd = { fg=green },
|
||||||
GitGutterChange = {bg=NONE, fg=yellow, style=NONE},
|
GitGutterChange = { fg=yellow },
|
||||||
GitGutterDelete = {bg=NONE, fg=red, style=NONE},
|
GitGutterDelete = { fg=red },
|
||||||
GitGutterChangeDelete = {bg=NONE, fg=orange, style=NONE},
|
GitGutterChangeDelete = { fg=orange },
|
||||||
|
|
||||||
SignifySignAdd = 'GitGutterAdd' ,
|
SignifySignAdd = 'GitGutterAdd' ,
|
||||||
SignifySignChange = 'GitGutterChange' ,
|
SignifySignChange = 'GitGutterChange' ,
|
||||||
|
@ -613,8 +606,8 @@ local highlight_groups = {
|
||||||
SignifySignChangeDelete = 'GitGutterChangeDelete',
|
SignifySignChangeDelete = 'GitGutterChangeDelete',
|
||||||
|
|
||||||
--[[ 4.4.5. vim-indent-guides ]]
|
--[[ 4.4.5. vim-indent-guides ]]
|
||||||
IndentGuidesOdd = {bg=darkgrey, fg=NONE, style=NONE},
|
IndentGuidesOdd = { bg=darkgrey },
|
||||||
IndentGuidesEven = {bg=grey, fg=NONE, style=NONE},
|
IndentGuidesEven = { bg=grey },
|
||||||
|
|
||||||
--[[ 4.4.7. NERDTree ]]
|
--[[ 4.4.7. NERDTree ]]
|
||||||
NERDTreeCWD = 'Label' ,
|
NERDTreeCWD = 'Label' ,
|
||||||
|
@ -677,25 +670,25 @@ local highlight_groups = {
|
||||||
TSVariableBuiltin = 'Identifier',
|
TSVariableBuiltin = 'Identifier',
|
||||||
|
|
||||||
--[[ 4.4.9 SearchLight ]]
|
--[[ 4.4.9 SearchLight ]]
|
||||||
SearchLight = {bg=black, fg=orange, style={'bold', 'italic', 'underline'}},
|
SearchLight = { bg=black, fg=orange, style={'bold', 'italic', 'underline' }},
|
||||||
|
|
||||||
--[[ 4.4.10 Sneak ]]
|
--[[ 4.4.10 Sneak ]]
|
||||||
Sneak = {bg=red, fg=black, style='bold' },
|
Sneak = { bg=red, fg=black, style='bold' },
|
||||||
SneakScope = {bg=black, fg=orange, style={'bold', 'underline'}},
|
SneakScope = { bg=black, fg=orange, style={'bold', 'underline' }},
|
||||||
|
|
||||||
--[[ 4.4.11 Which key ]]
|
--[[ 4.4.11 Which key ]]
|
||||||
WhichKey = 'Function' ,
|
WhichKey = 'Function' ,
|
||||||
WhichKeySeperator = {bg=black, fg=green, style=NONE },
|
WhichKeySeperator = {bg=black, fg=green},
|
||||||
WhichKeyGroup = 'Keyword' ,
|
WhichKeyGroup = 'Keyword' ,
|
||||||
WhichKeyDesc = {bg=black, fg=orange, style=NONE },
|
WhichKeyDesc = {bg=black, fg=orange},
|
||||||
WhichKeyFloating = 'Pmenu' ,
|
WhichKeyFloating = 'Pmenu' ,
|
||||||
|
|
||||||
--[[ 4.4.12 conflict-marker ]]
|
--[[ 4.4.12 conflict-marker ]]
|
||||||
ConflictMarkerBegin = {bg=black, fg=purple, style=NONE },
|
ConflictMarkerBegin = { bg=black, fg=purple },
|
||||||
ConflictMarkerEnd = {bg=black, fg=purple, style=NONE },
|
ConflictMarkerEnd = { bg=black, fg=purple },
|
||||||
ConflictMarkerOurs = {bg=black, fg=green, style=NONE },
|
ConflictMarkerOurs = { bg=black, fg=green },
|
||||||
ConflictMarkerTheirs = {bg=black, fg=red, style=NONE },
|
ConflictMarkerTheirs = { bg=black, fg=red },
|
||||||
ConflictMarkerCommonAncestorsHunk = {bg=black, fg=orange, style=NONE },
|
ConflictMarkerCommonAncestorsHunk = { bg=black, fg=orange },
|
||||||
|
|
||||||
--[[ 4.4.13 hlslens ]]
|
--[[ 4.4.13 hlslens ]]
|
||||||
HlSearchLensCur = 'SearchLight',
|
HlSearchLensCur = 'SearchLight',
|
||||||
|
@ -703,13 +696,13 @@ local highlight_groups = {
|
||||||
HlSearchCur = 'SearchLight',
|
HlSearchCur = 'SearchLight',
|
||||||
|
|
||||||
--[[ 4.4.14 pandoc ]]
|
--[[ 4.4.14 pandoc ]]
|
||||||
pandocAtxHeader = { bg=black, fg=aqua, style=NONE },
|
pandocAtxHeader = { bg=black, fg=aqua },
|
||||||
pandocAtxStart = { bg=black, fg=orange, style=NONE },
|
pandocAtxStart = { bg=black, fg=orange },
|
||||||
pandocDelimitedCodeBlockStart = { bg=black, fg=green, style=NONE },
|
pandocDelimitedCodeBlockStart = { bg=black, fg=green },
|
||||||
pandocDelimitedCodeBlockEnd = { bg=black, fg=green, style=NONE },
|
pandocDelimitedCodeBlockEnd = { bg=black, fg=green },
|
||||||
pandocDelimitedCodeBlockLanguage = 'Comment',
|
pandocDelimitedCodeBlockLanguage = 'Comment',
|
||||||
pandocListItemBullet = { bg=black, fg=purple, style=NONE },
|
pandocListItemBullet = { bg=black, fg=purple },
|
||||||
pandocUListItemBullet = { bg=black, fg=purple, style=NONE },
|
pandocUListItemBullet = { bg=black, fg=purple },
|
||||||
pandocReferenceURL = { bg=black, fg=pink, style={'underline' }},
|
pandocReferenceURL = { bg=black, fg=pink, style={'underline' }},
|
||||||
pandocReferenceDefinition = { bg=black, fg=aqua, style={'bold' }},
|
pandocReferenceDefinition = { bg=black, fg=aqua, style={'bold' }},
|
||||||
pandocEmphasis = { bg=black, fg=purple, style={'italic' }},
|
pandocEmphasis = { bg=black, fg=purple, style={'italic' }},
|
||||||
|
@ -718,45 +711,12 @@ local highlight_groups = {
|
||||||
pandocStrongInEmphasis = 'pandocStrongEmphasis',
|
pandocStrongInEmphasis = 'pandocStrongEmphasis',
|
||||||
pandocEmphasisInStrong = 'pandocStrongEmphasis',
|
pandocEmphasisInStrong = 'pandocStrongEmphasis',
|
||||||
|
|
||||||
--[[ 4.4.15 nvim-cmp ]]
|
--[[ 4.4.15 Hop ]]
|
||||||
CmpItemMenu = {bg=black, fg=NONE, style=NONE },
|
HopNextKey = { bg=red , fg=black , style='bold' },
|
||||||
CmpItemAbbr = {bg=black, fg=aqua, style=NONE },
|
HopNextKey1 = { bg=black, fg=orange , style='bold' },
|
||||||
CmpItemAbbrMatch = {bg=black, fg=red, style='underline' },
|
HopNextKey2 = { bg=black, fg=purple , style='bold' },
|
||||||
CmpItemAbbrMatchFuzzy = {bg=black, fg=aqua, style='bold' },
|
HopUnmatched = { bg=black, fg=lightgrey, style='bold' },
|
||||||
CmpItemAbbrDeprecated = {bg=black, fg=purple, style=NONE },
|
HopCursor = { bg=black, fg=aqua , style='bold' },
|
||||||
CmpItemKind = {bg=black, fg=orange, style=NONE },
|
|
||||||
CmpItemKindText = 'String',
|
|
||||||
CmpItemKindMethod = 'CmpItemKindFunction',
|
|
||||||
CmpItemKindFunction = 'Function',
|
|
||||||
CmpItemKindConstructor = 'CmpItemKindMethod',
|
|
||||||
CmpItemKindField = 'Identifier',
|
|
||||||
CmpItemKindVariable = 'Identifier',
|
|
||||||
CmpItemKindClass = 'CmpItemKindStruct',
|
|
||||||
CmpItemKindInterface = 'Type',
|
|
||||||
CmpItemKindModule = 'Include',
|
|
||||||
CmpItemKindProperty = 'CmpItemKindField',
|
|
||||||
CmpItemKindUnit = 'CmpItemKindStruct',
|
|
||||||
CmpItemKindValue = 'CmpItemKindConstant',
|
|
||||||
CmpItemKindEnum = 'CmpItemKindStruct',
|
|
||||||
CmpItemKindKeyword = 'Keyword',
|
|
||||||
CmpItemKindSnippet = 'Special',
|
|
||||||
CmpItemKindColor = 'Label',
|
|
||||||
CmpItemKindFile = 'Directory',
|
|
||||||
CmpItemKindReference = 'StorageClass',
|
|
||||||
CmpItemKindFolder = 'CmpItemKindFile',
|
|
||||||
CmpItemKindEnumMember = 'CmpItemKindConstant',
|
|
||||||
CmpItemKindConstant = 'Constant',
|
|
||||||
CmpItemKindStruct = 'Structure',
|
|
||||||
CmpItemKindEvent = 'Repeat',
|
|
||||||
CmpItemKindOperator = 'Operator',
|
|
||||||
CmpItemKindTypeParameter = 'Typedef',
|
|
||||||
|
|
||||||
--[[ 4.4.16 Hop ]]
|
|
||||||
HopNextKey = {bg=red , fg=black , style='bold'},
|
|
||||||
HopNextKey1 = {bg=black, fg=orange , style='bold'},
|
|
||||||
HopNextKey2 = {bg=black, fg=purple , style='bold'},
|
|
||||||
HopUnmatched = {bg=black, fg=lightgrey, style='bold'},
|
|
||||||
HopCursor = {bg=black, fg=aqua , style='bold'},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- We do not care about terminals which do not support 256 colors
|
-- We do not care about terminals which do not support 256 colors
|
||||||
|
|
|
@ -16,9 +16,6 @@
|
||||||
--- Which set of colors to use.
|
--- Which set of colors to use.
|
||||||
local _USE_256 = tonumber(vim.go.t_Co) > 255 or string.find(vim.env.TERM, '256')
|
local _USE_256 = tonumber(vim.go.t_Co) > 255 or string.find(vim.env.TERM, '256')
|
||||||
|
|
||||||
--- Indicating nothing for a highlight field.
|
|
||||||
local _NONE = 'NONE'
|
|
||||||
|
|
||||||
--- Which index to use for `cterm` highlights.
|
--- Which index to use for `cterm` highlights.
|
||||||
local _PALETTE_CTERM = _USE_256 and 2 or 3
|
local _PALETTE_CTERM = _USE_256 and 2 or 3
|
||||||
|
|
||||||
|
@ -42,36 +39,8 @@ local function get(color, index) -- {{{ †
|
||||||
elseif type(color) == _TYPE_STRING then
|
elseif type(color) == _TYPE_STRING then
|
||||||
return color
|
return color
|
||||||
end
|
end
|
||||||
|
|
||||||
return _NONE
|
|
||||||
end --}}} ‡
|
end --}}} ‡
|
||||||
|
|
||||||
--- Take a `command` and add color-specifying components to it.
|
|
||||||
--- @param command table the in-progress `:highlight` command
|
|
||||||
--- @param definition Yolokai.Definition the definition of the highlight group
|
|
||||||
local function colorize(command, definition) -- {{{ †
|
|
||||||
command[#command+1]=' guibg='..get(definition.bg, _PALETTE_HEX)..' guifg='..get(definition.fg, _PALETTE_HEX)
|
|
||||||
..' ctermbg='..get(definition.bg, _PALETTE_CTERM)..' ctermfg='..get(definition.fg, _PALETTE_CTERM)
|
|
||||||
|
|
||||||
-- Add the `blend` parameter if it is present
|
|
||||||
if definition.blend then -- There is a value for the `highlight-blend` field.
|
|
||||||
command[#command+1]=' blend='..definition.blend
|
|
||||||
end
|
|
||||||
end --}}} ‡
|
|
||||||
|
|
||||||
--- This function appends `selected_definition` to the end of `highlight_cmd`.
|
|
||||||
--- @param command table the in-progress `:highlight` command
|
|
||||||
--- @param style string the `gui`/`cterm` arguments to apply
|
|
||||||
--- @param color string|table a `guisp` argument; same arg as `get`
|
|
||||||
--- @see get
|
|
||||||
local function stylize(command, style, color)
|
|
||||||
command[#command+1]=' gui='..style..' cterm='..style
|
|
||||||
|
|
||||||
if color then -- There is an undercurl color.
|
|
||||||
command[#command+1]=' guisp='..get(color, _PALETTE_HEX)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- @param rgb string some string of RGB colors.
|
--- @param rgb string some string of RGB colors.
|
||||||
--- @return string hex
|
--- @return string hex
|
||||||
local function tohex(rgb) return string.format('#%06x', rgb) end
|
local function tohex(rgb) return string.format('#%06x', rgb) end
|
||||||
|
@ -108,10 +77,10 @@ function yolokai.group(name)
|
||||||
|
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
fg = definition.foreground and tohex(definition.foreground) or _NONE,
|
fg = definition.foreground and tohex(definition.foreground),
|
||||||
bg = definition.background and tohex(definition.background) or _NONE,
|
bg = definition.background and tohex(definition.background),
|
||||||
blend = definition.blend,
|
blend = definition.blend,
|
||||||
style = style or _NONE
|
style = style,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -121,31 +90,36 @@ end
|
||||||
--- @param group_name string the `{group-name}` argument for `:highlight`
|
--- @param group_name string the `{group-name}` argument for `:highlight`
|
||||||
--- @param definition Yolokai.Definition|string a link or an attribute map
|
--- @param definition Yolokai.Definition|string a link or an attribute map
|
||||||
function yolokai.highlight(group_name, definition) -- {{{ †
|
function yolokai.highlight(group_name, definition) -- {{{ †
|
||||||
|
local highlight = {}
|
||||||
if type(definition) == _TYPE_STRING then -- `highlight_group` is a link to another group.
|
if type(definition) == _TYPE_STRING then -- `highlight_group` is a link to another group.
|
||||||
vim.api.nvim_command('hi! link '..group_name..' '..definition)
|
highlight.link = definition
|
||||||
return
|
else
|
||||||
|
-- Take care of special instructions for certain background colors.
|
||||||
|
if definition[vim.go.background] then
|
||||||
|
definition = use_background_with(definition)
|
||||||
|
end
|
||||||
|
|
||||||
|
highlight.bg = get(definition.bg, _PALETTE_HEX)
|
||||||
|
highlight.fg = get(definition.fg, _PALETTE_HEX)
|
||||||
|
|
||||||
|
highlight.ctermbg = get(definition.bg, _PALETTE_CTERM)
|
||||||
|
highlight.ctermfg = get(definition.fg, _PALETTE_CTERM)
|
||||||
|
|
||||||
|
highlight.blend = definition.blend
|
||||||
|
|
||||||
|
local style = definition.style
|
||||||
|
if type(style) == _TYPE_TABLE then
|
||||||
|
for _, option in ipairs(style) do highlight[option] = true end
|
||||||
|
highlight.special = get(style.color, _PALETTE_HEX)
|
||||||
|
elseif style then
|
||||||
|
highlight[style] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
highlight.reverse = highlight.inverse
|
||||||
|
highlight.inverse = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The base highlight command
|
vim.api.nvim_set_hl(0, group_name, highlight)
|
||||||
local highlight_cmd = {'hi! ', group_name}
|
|
||||||
|
|
||||||
-- Take care of special instructions for certain background colors.
|
|
||||||
if definition[vim.go.background] then
|
|
||||||
definition = use_background_with(definition)
|
|
||||||
end
|
|
||||||
|
|
||||||
colorize(highlight_cmd, definition)
|
|
||||||
|
|
||||||
local style = definition.style or _NONE
|
|
||||||
|
|
||||||
if type(style) == _TYPE_TABLE then
|
|
||||||
-- Concat all of the entries together with a comma between before styling.
|
|
||||||
stylize(highlight_cmd, table.concat(style, ','), style.color)
|
|
||||||
else -- The style is just a single entry.
|
|
||||||
stylize(highlight_cmd, style)
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_command(table.concat(highlight_cmd))
|
|
||||||
end --}}} ‡
|
end --}}} ‡
|
||||||
|
|
||||||
--- Set `g:terminal_color_`s based on `terminal_colors`.
|
--- Set `g:terminal_color_`s based on `terminal_colors`.
|
||||||
|
|
Loading…
Reference in a new issue