nvim: yolokai: Sync with upstream nvim-highlite
This commit is contained in:
parent
abd22a73db
commit
eff13b5225
2 changed files with 94 additions and 67 deletions
|
@ -109,8 +109,6 @@ local highlight_groups = {
|
||||||
Ignore = {bg=NONE, fg=gray, style=NONE },
|
Ignore = {bg=NONE, fg=gray, style=NONE },
|
||||||
Error = {bg=black, fg=red, style=NONE },
|
Error = {bg=black, fg=red, style=NONE },
|
||||||
Todo = {bg=NONE, fg=orange, style={'bold', 'underline'}},
|
Todo = {bg=NONE, fg=orange, style={'bold', 'underline'}},
|
||||||
helpHyperTextJump = 'Underlined',
|
|
||||||
helpSpecial = 'Function' ,
|
|
||||||
Hint = {bg=lightblack3, fg=white, style='bold' },
|
Hint = {bg=lightblack3, 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' },
|
||||||
|
@ -384,10 +382,21 @@ local highlight_groups = {
|
||||||
rubyInterpolationDelimiter = 'Delimiter',
|
rubyInterpolationDelimiter = 'Delimiter',
|
||||||
|
|
||||||
--[[ 4.3.16. Rust ]]
|
--[[ 4.3.16. Rust ]]
|
||||||
|
rustAssert = 'Debug' ,
|
||||||
|
rustConstraint = 'Operator' ,
|
||||||
|
rustDynKeyword = 'rustStorage',
|
||||||
|
rustGeneric = 'Delimiter' ,
|
||||||
|
rustEscape = 'SpecialChar',
|
||||||
|
rustIdentifier = 'Identifier' ,
|
||||||
rustKeyword = 'Keyword' ,
|
rustKeyword = 'Keyword' ,
|
||||||
|
rustLifetime = 'Label' ,
|
||||||
rustModPath = 'Include' ,
|
rustModPath = 'Include' ,
|
||||||
|
rustNoise = 'Delimiter' ,
|
||||||
|
rustPanic = 'Exception' ,
|
||||||
|
rustRepeat = 'Repeat' ,
|
||||||
rustScopeDecl = 'Delimiter' ,
|
rustScopeDecl = 'Delimiter' ,
|
||||||
rustTrait = 'StorageClass',
|
rustStructure = 'Structure' ,
|
||||||
|
rustUnused = 'Special' ,
|
||||||
|
|
||||||
--[[ 4.3.17. Scala ]]
|
--[[ 4.3.17. Scala ]]
|
||||||
scalaKeyword = 'Keyword' ,
|
scalaKeyword = 'Keyword' ,
|
||||||
|
@ -409,11 +418,12 @@ local highlight_groups = {
|
||||||
|
|
||||||
--[[ 4.3.20. TOML ]]
|
--[[ 4.3.20. TOML ]]
|
||||||
tomlComment = 'Comment' ,
|
tomlComment = 'Comment' ,
|
||||||
|
tomlDate = 'Special' ,
|
||||||
|
tomlFloat = 'Float' ,
|
||||||
tomlKey = 'Label' ,
|
tomlKey = 'Label' ,
|
||||||
tomlTable = 'StorageClass',
|
tomlTable = 'StorageClass',
|
||||||
|
|
||||||
--[[ 4.3.21. VimScript ]]
|
--[[ 4.3.21. VimScript ]]
|
||||||
helpSpecial = 'Special' ,
|
|
||||||
vimFgBgAttrib = 'Constant' ,
|
vimFgBgAttrib = 'Constant' ,
|
||||||
vimHiCterm = 'Label' ,
|
vimHiCterm = 'Label' ,
|
||||||
vimHiCtermFgBg = 'vimHiCterm',
|
vimHiCtermFgBg = 'vimHiCterm',
|
||||||
|
@ -456,7 +466,7 @@ local highlight_groups = {
|
||||||
luaFuncParens = 'Delimiter' ,
|
luaFuncParens = 'Delimiter' ,
|
||||||
luaFuncTable = 'Structure' ,
|
luaFuncTable = 'Structure' ,
|
||||||
luaLocal = 'Type' ,
|
luaLocal = 'Type' ,
|
||||||
luaNoise = 'Operator' ,
|
luaNoise = 'Delimiter' ,
|
||||||
luaParens = 'Delimiter' ,
|
luaParens = 'Delimiter' ,
|
||||||
luaSpecialTable = 'StorageClass',
|
luaSpecialTable = 'StorageClass',
|
||||||
luaSpecialValue = 'Function' ,
|
luaSpecialValue = 'Function' ,
|
||||||
|
@ -479,7 +489,10 @@ local highlight_groups = {
|
||||||
crontabMnth = 'Structure' ,
|
crontabMnth = 'Structure' ,
|
||||||
|
|
||||||
--[[ 4.3.28. PlantUML ]]
|
--[[ 4.3.28. PlantUML ]]
|
||||||
plantumlColonLine = {},
|
plantumlArrowLR = 'Statement',
|
||||||
|
plantumlColonLine = NONE ,
|
||||||
|
plantumlMindmap = 'Label' ,
|
||||||
|
plantumlMindmap2 = 'Label' ,
|
||||||
|
|
||||||
--[[ 4.3.33. YAML ]]
|
--[[ 4.3.33. YAML ]]
|
||||||
yamlKey = 'Label',
|
yamlKey = 'Label',
|
||||||
|
@ -487,12 +500,25 @@ local highlight_groups = {
|
||||||
yamlPlainScalar = { bg=black, fg=green, style=NONE },
|
yamlPlainScalar = { bg=black, fg=green, style=NONE },
|
||||||
|
|
||||||
--[[ 4.3.34. Git ]]
|
--[[ 4.3.34. Git ]]
|
||||||
|
diffAdded = 'DiffAdd' ,
|
||||||
|
diffRemoved = 'DiffDelete' ,
|
||||||
|
gitcommitHeader = 'SpecialComment' ,
|
||||||
|
gitcommitDiscardedFile = 'gitcommitSelectedFile',
|
||||||
|
gitcommitOverFlow = 'Error' ,
|
||||||
|
gitcommitSelectedFile = 'Directory' ,
|
||||||
|
gitcommitSummary = 'Title' ,
|
||||||
|
gitcommitUntrackedFile = 'gitcommitSelectedFile',
|
||||||
|
gitconfigAssignment = 'String' ,
|
||||||
|
gitconfigEscape = 'SpecialChar' ,
|
||||||
|
gitconfigNone = 'Operator' ,
|
||||||
|
gitconfigSection = 'Structure' ,
|
||||||
|
gitconfigVariable = 'Label' ,
|
||||||
gitrebaseBreak = 'Keyword' ,
|
gitrebaseBreak = 'Keyword' ,
|
||||||
gitrebaseCommit = 'Tag' ,
|
gitrebaseCommit = 'Tag' ,
|
||||||
gitrebaseDrop = 'Exception' ,
|
gitrebaseDrop = 'Exception' ,
|
||||||
gitrebaseEdit = 'Define' ,
|
gitrebaseEdit = 'Define' ,
|
||||||
gitrebaseExec = 'PreProc' ,
|
gitrebaseExec = 'PreProc' ,
|
||||||
gitrebaseFixup = 'gitrebaseSquash',
|
gitrebaseFixup = 'gitrebaseSquash' ,
|
||||||
gitrebaseMerge = 'PreProc' ,
|
gitrebaseMerge = 'PreProc' ,
|
||||||
gitrebasePick = 'Include' ,
|
gitrebasePick = 'Include' ,
|
||||||
gitrebaseReset = 'gitrebaseLabel' ,
|
gitrebaseReset = 'gitrebaseLabel' ,
|
||||||
|
@ -500,6 +526,13 @@ local highlight_groups = {
|
||||||
gitrebaseSquash = 'Macro' ,
|
gitrebaseSquash = 'Macro' ,
|
||||||
gitrebaseSummary = 'Normal' ,
|
gitrebaseSummary = 'Normal' ,
|
||||||
|
|
||||||
|
--[[ 4.3.35 Help ]]
|
||||||
|
helpHeader = 'Label' ,
|
||||||
|
helpOption = 'Keyword' ,
|
||||||
|
helpHeadline = 'Title' ,
|
||||||
|
helpSectionDelim = 'Delimiter' ,
|
||||||
|
helpHyperTextJump = 'Underlined',
|
||||||
|
|
||||||
--[[ 4.4. Plugins
|
--[[ 4.4. Plugins
|
||||||
Everything in this section is OPTIONAL. Feel free to remove everything
|
Everything in this section is OPTIONAL. Feel free to remove everything
|
||||||
here if you don't want to define it, or add more if there's something
|
here if you don't want to define it, or add more if there's something
|
||||||
|
|
|
@ -153,13 +153,12 @@ function yolokai.highlight(highlight_group, attributes) -- {{{ †
|
||||||
end --}}} ‡
|
end --}}} ‡
|
||||||
|
|
||||||
function yolokai:highlight_terminal(terminal_ansi_colors)
|
function yolokai:highlight_terminal(terminal_ansi_colors)
|
||||||
for index, color in ipairs(terminal_ansi_colors) do
|
for index, color in ipairs(terminal_ansi_colors) do vim.g['terminal_color_'..(index-1)] =
|
||||||
vim.g['terminal_color_'..index] = vim.o.termguicolors and color[_PALETTE_HEX] or color[_PALETTE_256] or get(color, _PALETTE_ANSI)
|
vim.o.termguicolors and color[_PALETTE_HEX] or color[_PALETTE_256] or get(color, _PALETTE_ANSI)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return setmetatable(yolokai, {
|
return setmetatable(yolokai, {['__call'] = function(self, normal, highlights, terminal_ansi_colors)
|
||||||
['__call'] = function(self, normal, highlights, terminal_ansi_colors)
|
|
||||||
-- function to resolve function highlight groups being defined by function calls.
|
-- function to resolve function highlight groups being defined by function calls.
|
||||||
local function resolve(tbl, key, resolve_links)
|
local function resolve(tbl, key, resolve_links)
|
||||||
local value = tbl[key]
|
local value = tbl[key]
|
||||||
|
@ -176,13 +175,9 @@ return setmetatable(yolokai, {
|
||||||
return tbl[key]
|
return tbl[key]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- save the colors_name before syntax reset
|
-- save the colors_name before syntax reset
|
||||||
local color_name = vim.g.colors_name
|
local color_name = vim.g.colors_name
|
||||||
|
|
||||||
-- Clear the highlighting.
|
|
||||||
exe 'hi clear'
|
|
||||||
|
|
||||||
-- If the syntax has been enabled, reset it.
|
-- If the syntax has been enabled, reset it.
|
||||||
if fn.exists 'syntax_on' then exe 'syntax reset' end
|
if fn.exists 'syntax_on' then exe 'syntax reset' end
|
||||||
|
|
||||||
|
@ -203,5 +198,4 @@ return setmetatable(yolokai, {
|
||||||
|
|
||||||
-- Set the terminal highlight colors.
|
-- Set the terminal highlight colors.
|
||||||
self:highlight_terminal(terminal_ansi_colors)
|
self:highlight_terminal(terminal_ansi_colors)
|
||||||
end
|
end})
|
||||||
})
|
|
||||||
|
|
Loading…
Reference in a new issue