nvim: yolokai: Sync with upstream nvim-highlite

This commit is contained in:
Sanchayan Maity 2021-02-25 13:27:28 +05:30
parent abd22a73db
commit eff13b5225
2 changed files with 94 additions and 67 deletions

View file

@ -109,8 +109,6 @@ local highlight_groups = {
Ignore = {bg=NONE, fg=gray, style=NONE },
Error = {bg=black, fg=red, style=NONE },
Todo = {bg=NONE, fg=orange, style={'bold', 'underline'}},
helpHyperTextJump = 'Underlined',
helpSpecial = 'Function' ,
Hint = {bg=lightblack3, fg=white, style='bold' },
Info = {bg=orange, fg=black, style='bold' },
Warning = {bg=pink, fg=black, style='bold' },
@ -384,10 +382,21 @@ local highlight_groups = {
rubyInterpolationDelimiter = 'Delimiter',
--[[ 4.3.16. Rust ]]
rustAssert = 'Debug' ,
rustConstraint = 'Operator' ,
rustDynKeyword = 'rustStorage',
rustGeneric = 'Delimiter' ,
rustEscape = 'SpecialChar',
rustIdentifier = 'Identifier' ,
rustKeyword = 'Keyword' ,
rustLifetime = 'Label' ,
rustModPath = 'Include' ,
rustNoise = 'Delimiter' ,
rustPanic = 'Exception' ,
rustRepeat = 'Repeat' ,
rustScopeDecl = 'Delimiter' ,
rustTrait = 'StorageClass',
rustStructure = 'Structure' ,
rustUnused = 'Special' ,
--[[ 4.3.17. Scala ]]
scalaKeyword = 'Keyword' ,
@ -409,11 +418,12 @@ local highlight_groups = {
--[[ 4.3.20. TOML ]]
tomlComment = 'Comment' ,
tomlDate = 'Special' ,
tomlFloat = 'Float' ,
tomlKey = 'Label' ,
tomlTable = 'StorageClass',
--[[ 4.3.21. VimScript ]]
helpSpecial = 'Special' ,
vimFgBgAttrib = 'Constant' ,
vimHiCterm = 'Label' ,
vimHiCtermFgBg = 'vimHiCterm',
@ -456,7 +466,7 @@ local highlight_groups = {
luaFuncParens = 'Delimiter' ,
luaFuncTable = 'Structure' ,
luaLocal = 'Type' ,
luaNoise = 'Operator' ,
luaNoise = 'Delimiter' ,
luaParens = 'Delimiter' ,
luaSpecialTable = 'StorageClass',
luaSpecialValue = 'Function' ,
@ -479,7 +489,10 @@ local highlight_groups = {
crontabMnth = 'Structure' ,
--[[ 4.3.28. PlantUML ]]
plantumlColonLine = {},
plantumlArrowLR = 'Statement',
plantumlColonLine = NONE ,
plantumlMindmap = 'Label' ,
plantumlMindmap2 = 'Label' ,
--[[ 4.3.33. YAML ]]
yamlKey = 'Label',
@ -487,6 +500,19 @@ local highlight_groups = {
yamlPlainScalar = { bg=black, fg=green, style=NONE },
--[[ 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' ,
gitrebaseCommit = 'Tag' ,
gitrebaseDrop = 'Exception' ,
@ -500,6 +526,13 @@ local highlight_groups = {
gitrebaseSquash = 'Macro' ,
gitrebaseSummary = 'Normal' ,
--[[ 4.3.35 Help ]]
helpHeader = 'Label' ,
helpOption = 'Keyword' ,
helpHeadline = 'Title' ,
helpSectionDelim = 'Delimiter' ,
helpHyperTextJump = 'Underlined',
--[[ 4.4. Plugins
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

View file

@ -153,13 +153,12 @@ function yolokai.highlight(highlight_group, attributes) -- {{{ †
end --}}} ‡
function yolokai:highlight_terminal(terminal_ansi_colors)
for index, color in ipairs(terminal_ansi_colors) do
vim.g['terminal_color_'..index] = vim.o.termguicolors and color[_PALETTE_HEX] or color[_PALETTE_256] or get(color, _PALETTE_ANSI)
for index, color in ipairs(terminal_ansi_colors) do vim.g['terminal_color_'..(index-1)] =
vim.o.termguicolors and color[_PALETTE_HEX] or color[_PALETTE_256] or get(color, _PALETTE_ANSI)
end
end
return setmetatable(yolokai, {
['__call'] = function(self, normal, highlights, terminal_ansi_colors)
return setmetatable(yolokai, {['__call'] = function(self, normal, highlights, terminal_ansi_colors)
-- function to resolve function highlight groups being defined by function calls.
local function resolve(tbl, key, resolve_links)
local value = tbl[key]
@ -176,13 +175,9 @@ return setmetatable(yolokai, {
return tbl[key]
end
-- save the colors_name before syntax reset
local color_name = vim.g.colors_name
-- Clear the highlighting.
exe 'hi clear'
-- If the syntax has been enabled, reset it.
if fn.exists 'syntax_on' then exe 'syntax reset' end
@ -203,5 +198,4 @@ return setmetatable(yolokai, {
-- Set the terminal highlight colors.
self:highlight_terminal(terminal_ansi_colors)
end
})
end})