Use new functionality
This commit is contained in:
parent
b9cf35585c
commit
2de9c2b6bf
|
@ -196,6 +196,27 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
||||||
shouldn't remove any if you want a working colorscheme. Most of them are
|
shouldn't remove any if you want a working colorscheme. Most of them are
|
||||||
described under |highlight-default|, some from |group-name|, and others from
|
described under |highlight-default|, some from |group-name|, and others from
|
||||||
common syntax groups. Both help sections are good reads.
|
common syntax groups. Both help sections are good reads.
|
||||||
|
____________________________________________________________________________
|
||||||
|
|
||||||
|
If you want to inherit a specific attribute of another highlight group, you
|
||||||
|
can do the following:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
SpellBad = function(self)
|
||||||
|
local inherited_style = self.SpellRare.style
|
||||||
|
inherited_style.color = red
|
||||||
|
|
||||||
|
return {
|
||||||
|
bg=NONE,
|
||||||
|
fg=NONE,
|
||||||
|
style=inherited_style
|
||||||
|
}
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
The function will be executed by |highlite| and transformed into the
|
||||||
|
expected result.
|
||||||
|
____________________________________________________________________________
|
||||||
|
|
||||||
NOTE: |Replace-mode| will probably be useful here.
|
NOTE: |Replace-mode| will probably be useful here.
|
||||||
|
|
||||||
|
@ -208,12 +229,9 @@ local purple_light = {'#af60af', 63, 'magenta'}
|
||||||
the benefits of using this template.
|
the benefits of using this template.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--[[ DO NOT EDIT `BG`, `FG`, or `NONE`.
|
--[[ DO NOT EDIT `BG` NOR `FG`. ]]
|
||||||
Feel free to uncomment `BG` and `NONE`. They are not used by default so they are commented out.
|
local BG = 'bg'
|
||||||
]]
|
local FG = 'fg'
|
||||||
-- 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.
|
||||||
|
@ -279,13 +297,13 @@ local highlight_groups = {
|
||||||
helpHyperTextJump = 'Underlined',
|
helpHyperTextJump = 'Underlined',
|
||||||
helpSpecial = 'Function',
|
helpSpecial = 'Function',
|
||||||
Hint = {bg=magenta, fg=black, style='bold'},
|
Hint = {bg=magenta, fg=black, style='bold'},
|
||||||
Info = {bg=pink_light, fg=black, style='bold'},
|
Info = function(self) return {bg=pink_light, fg=self.Hint.fg, style=self.Hint.style} end,
|
||||||
Warning = {bg=orange, fg=black, style='bold'},
|
Warning = function(self) return {bg=orange, fg=self.Hint.fg, style=self.Hint.style} end,
|
||||||
|
|
||||||
--[[ 4.2... Editor UI ]]
|
--[[ 4.2... Editor UI ]]
|
||||||
--[[ 4.2.1. Status Line]]
|
--[[ 4.2.1. Status Line]]
|
||||||
StatusLine = {bg=gray_darker, fg=green_light},
|
StatusLine = {bg=gray_darker, fg=green_light},
|
||||||
StatusLineNC = {bg=gray_darker, fg=gray},
|
StatusLineNC = function(self) return {bg=self.StatusLine.bg, fg=gray} end,
|
||||||
StatusLineTerm = 'StatusLine',
|
StatusLineTerm = 'StatusLine',
|
||||||
StatusLineTermNC = 'StatusLineNC',
|
StatusLineTermNC = 'StatusLineNC',
|
||||||
|
|
||||||
|
@ -297,9 +315,9 @@ local highlight_groups = {
|
||||||
Title = {style='bold'},
|
Title = {style='bold'},
|
||||||
|
|
||||||
--[[ 4.2.3. Conditional Line Highlighting]]
|
--[[ 4.2.3. Conditional Line Highlighting]]
|
||||||
--Conceal={}
|
Conceal = 'NonText',
|
||||||
CursorLine = {bg=gray_dark},
|
CursorLine = {bg=gray_dark},
|
||||||
CursorLineNr = {bg=gray_dark, fg=pink},
|
CursorLineNr = function(self) return {bg=self.CursorLine.bg, fg=pink} end,
|
||||||
debugBreakpoint = 'ErrorMsg',
|
debugBreakpoint = 'ErrorMsg',
|
||||||
debugPC = 'ColorColumn',
|
debugPC = 'ColorColumn',
|
||||||
LineNr = {fg=gray},
|
LineNr = {fg=gray},
|
||||||
|
@ -312,7 +330,7 @@ local highlight_groups = {
|
||||||
PmenuSbar = {bg=black},
|
PmenuSbar = {bg=black},
|
||||||
PmenuSel = {fg=FG},
|
PmenuSel = {fg=FG},
|
||||||
PmenuThumb = {bg=white},
|
PmenuThumb = {bg=white},
|
||||||
WildMenu = {},
|
WildMenu = 'PmenuSel',
|
||||||
|
|
||||||
--[[ 4.2.5. Folds]]
|
--[[ 4.2.5. Folds]]
|
||||||
FoldColumn = {bg=gray_darker, style='bold'},
|
FoldColumn = {bg=gray_darker, style='bold'},
|
||||||
|
@ -320,8 +338,8 @@ local highlight_groups = {
|
||||||
|
|
||||||
--[[ 4.2.6. Diffs]]
|
--[[ 4.2.6. Diffs]]
|
||||||
DiffAdd = {fg=green_dark, style='inverse'},
|
DiffAdd = {fg=green_dark, style='inverse'},
|
||||||
DiffChange = {fg=yellow, style='inverse'},
|
DiffChange = {fg=yellow, style='inverse'},
|
||||||
DiffDelete = {fg=red, style='inverse'},
|
DiffDelete = {fg=red, style='inverse'},
|
||||||
DiffText = {fg=FG},
|
DiffText = {fg=FG},
|
||||||
|
|
||||||
--[[ 4.2.7. Searching]]
|
--[[ 4.2.7. Searching]]
|
||||||
|
@ -350,21 +368,20 @@ local highlight_groups = {
|
||||||
--[[ 4.2.11. LSP ]]
|
--[[ 4.2.11. LSP ]]
|
||||||
LspDiagnosticsDefaultError = 'Error',
|
LspDiagnosticsDefaultError = 'Error',
|
||||||
LspDiagnosticsFloatingError = 'ErrorMsg',
|
LspDiagnosticsFloatingError = 'ErrorMsg',
|
||||||
LspDiagnosticsSignError = 'ErrorMsg',
|
LspDiagnosticsSignError = 'LspDiagnosticsFloatingError',
|
||||||
|
|
||||||
LspDiagnosticsDefaultWarning = 'Warning',
|
LspDiagnosticsDefaultWarning = 'Warning',
|
||||||
LspDiagnosticsFloatingWarning = 'WarningMsg',
|
LspDiagnosticsFloatingWarning = 'WarningMsg',
|
||||||
LspDiagnosticsSignWarning = 'WarningMsg',
|
LspDiagnosticsSignWarning = 'LspDiagnosticsFloatingWarning',
|
||||||
|
|
||||||
LspDiagnosticsDefaultHint = 'Hint',
|
LspDiagnosticsDefaultHint = 'Hint',
|
||||||
LspDiagnosticsFloatingHint = 'HintMsg',
|
LspDiagnosticsFloatingHint = 'HintMsg',
|
||||||
LspDiagnosticsSignHint = 'HintMsg',
|
LspDiagnosticsSignHint = 'LspDiagnosticsFloatingHint',
|
||||||
|
|
||||||
LspDiagnosticsDefaultInformation = 'Info',
|
LspDiagnosticsDefaultInformation = 'Info',
|
||||||
LspDiagnosticsFloatingInformation = 'InfoMsg',
|
LspDiagnosticsFloatingInformation = 'InfoMsg',
|
||||||
LspDiagnosticsSignInformation = 'InfoMsg',
|
LspDiagnosticsSignInformation = 'LspDiagnosticsFloatingInformation',
|
||||||
|
|
||||||
LspDiagnosticsUnderline = {style={'undercurl', color=white}},
|
|
||||||
LspDiagnosticsUnderlineError = 'CocErrorHighlight',
|
LspDiagnosticsUnderlineError = 'CocErrorHighlight',
|
||||||
LspDiagnosticsUnderlineHint = 'CocHintHighlight',
|
LspDiagnosticsUnderlineHint = 'CocHintHighlight',
|
||||||
LspDiagnosticsUnderlineInfo = 'CocInfoHighlight',
|
LspDiagnosticsUnderlineInfo = 'CocInfoHighlight',
|
||||||
|
@ -660,13 +677,13 @@ local highlight_groups = {
|
||||||
ALEWarningSign = 'WarningMsg',
|
ALEWarningSign = 'WarningMsg',
|
||||||
|
|
||||||
--[[ 4.4.2. coc.nvim ]]
|
--[[ 4.4.2. coc.nvim ]]
|
||||||
CocErrorHighlight = {style={'undercurl', color='red'}},
|
CocErrorHighlight = {style={'undercurl', color='red'}},
|
||||||
CocHintHighlight = {style={'undercurl', color='magenta'}},
|
CocHintHighlight = {style={'undercurl', color='magenta'}},
|
||||||
CocInfoHighlight = {style={'undercurl', color='pink_light'}},
|
CocInfoHighlight = {style={'undercurl', color='pink_light'}},
|
||||||
CocWarningHighlight = {style={'undercurl', color='orange'}},
|
CocWarningHighlight = {style={'undercurl', color='orange'}},
|
||||||
CocErrorSign = 'ALEErrorSign',
|
CocErrorSign = 'ALEErrorSign',
|
||||||
CocHintSign = 'HintMsg',
|
CocHintSign = 'HintMsg',
|
||||||
CocInfoSign = 'InfoMsg',
|
CocInfoSign = 'InfoMsg',
|
||||||
CocWarningSign = 'ALEWarningSign',
|
CocWarningSign = 'ALEWarningSign',
|
||||||
|
|
||||||
--[[ 4.4.2. vim-jumpmotion / vim-easymotion ]]
|
--[[ 4.4.2. vim-jumpmotion / vim-easymotion ]]
|
||||||
|
@ -686,7 +703,7 @@ local highlight_groups = {
|
||||||
|
|
||||||
--[[ 4.4.5. vim-indent-guides ]]
|
--[[ 4.4.5. vim-indent-guides ]]
|
||||||
IndentGuidesOdd = {bg=gray_darker},
|
IndentGuidesOdd = {bg=gray_darker},
|
||||||
IndentGuidesEven = {bg=gray_dark},
|
IndentGuidesEven = {bg=gray},
|
||||||
|
|
||||||
--[[ 4.4.7. NERDTree ]]
|
--[[ 4.4.7. NERDTree ]]
|
||||||
NERDTreeCWD = 'Label',
|
NERDTreeCWD = 'Label',
|
||||||
|
@ -718,13 +735,16 @@ local highlight_groups = {
|
||||||
BufferInactiveSign = {bg=gray_darker, fg=gray_darker},
|
BufferInactiveSign = {bg=gray_darker, fg=gray_darker},
|
||||||
BufferInactiveTarget = 'BufferVisibleTarget',
|
BufferInactiveTarget = 'BufferVisibleTarget',
|
||||||
|
|
||||||
BufferTabpages = {bg=FG, fg=gray_dark, style='bold'},
|
BufferTabpages = {bg=FG, fg=BG, style='bold'},
|
||||||
BufferTabpageFill = 'TabLineFill',
|
BufferTabpageFill = 'TabLineFill',
|
||||||
|
|
||||||
BufferVisible = 'TabLine',
|
BufferVisible = 'TabLine',
|
||||||
BufferVisibleMod = {bg=gray_darker, fg=white, style='italic'},
|
BufferVisibleMod = {bg=gray_darker, fg=white, style='italic'},
|
||||||
BufferVisibleSign = 'BufferVisible',
|
BufferVisibleSign = 'BufferVisible',
|
||||||
BufferVisibleTarget = {bg=gray_darker, fg=white, style='bold'},
|
BufferVisibleTarget = function(self)
|
||||||
|
local parent = self.BufferVisibleMod
|
||||||
|
return {bg=parent.fg, fg=parent.bg, style='bold'}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
--[[ Step 5: Terminal Colors
|
--[[ Step 5: Terminal Colors
|
||||||
|
@ -842,8 +862,7 @@ local terminal_ansi_colors = {
|
||||||
is correctly set up if they want to enjoy the best possible experience.
|
is correctly set up if they want to enjoy the best possible experience.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- Change 'highlite' to the name of your colorscheme as defined in step 1.
|
require(vim.g.colors_name)(
|
||||||
require('highlite')(
|
|
||||||
highlight_group_normal,
|
highlight_group_normal,
|
||||||
highlight_groups,
|
highlight_groups,
|
||||||
terminal_ansi_colors
|
terminal_ansi_colors
|
||||||
|
|
Loading…
Reference in New Issue