-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(highlights): reset hlgroups on ColorScheme
- Loading branch information
bekaboo
committed
Jun 5, 2023
1 parent
ca6741c
commit befe881
Showing
1 changed file
with
81 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,90 @@ | ||
---Initialize highlight groups for dropbar | ||
local function init() | ||
-- stylua: ignore start | ||
local hlgroups = { | ||
DropBarIconKindArray = { link = 'Array' }, | ||
DropBarIconKindBoolean = { link = 'Boolean' }, | ||
DropBarIconKindBreakStatement = { link = 'Error' }, | ||
DropBarIconKindCall = { link = 'Function' }, | ||
DropBarIconKindCaseStatement = { link = 'Conditional' }, | ||
DropBarIconKindClass = { link = 'CmpItemKindClass' }, | ||
DropBarIconKindConstant = { link = 'Constant' }, | ||
DropBarIconKindConstructor = { link = 'CmpItemKindConstructor' }, | ||
DropBarIconKindContinueStatement = { link = 'Repeat' }, | ||
DropBarIconKindDeclaration = { link = 'CmpItemKindSnippet' }, | ||
DropBarIconKindDelete = { link = 'Error' }, | ||
DropBarIconKindDoStatement = { link = 'Repeat' }, | ||
DropBarIconKindElseStatement = { link = 'Conditional' }, | ||
DropBarIconKindEnum = { link = 'CmpItemKindEnum' }, | ||
DropBarIconKindEnumMember = { link = 'CmpItemKindEnumMember' }, | ||
DropBarIconKindEvent = { link = 'CmpItemKindEvent' }, | ||
DropBarIconKindField = { link = 'CmpItemKindField' }, | ||
DropBarIconKindFile = { link = 'NormalFloat' }, | ||
DropBarIconKindFolder = { link = 'Directory' }, | ||
DropBarIconKindForStatement = { link = 'Repeat' }, | ||
DropBarIconKindFunction = { link = 'Function' }, | ||
DropBarIconKindIdentifier = { link = 'CmpItemKindVariable' }, | ||
DropBarIconKindIfStatement = { link = 'Conditional' }, | ||
DropBarIconKindInterface = { link = 'CmpItemKindInterface' }, | ||
DropBarIconKindKeyword = { link = 'Keyword' }, | ||
DropBarIconKindList = { link = 'SpecialChar' }, | ||
DropBarIconKindMacro = { link = 'Macro' }, | ||
DropBarIconKindMarkdownH1 = { link = 'markdownH1' }, | ||
DropBarIconKindMarkdownH2 = { link = 'markdownH2' }, | ||
DropBarIconKindMarkdownH3 = { link = 'markdownH3' }, | ||
DropBarIconKindMarkdownH4 = { link = 'markdownH4' }, | ||
DropBarIconKindMarkdownH5 = { link = 'markdownH5' }, | ||
DropBarIconKindMarkdownH6 = { link = 'markdownH6' }, | ||
DropBarIconKindMethod = { link = 'CmpItemKindMethod' }, | ||
DropBarIconKindModule = { link = 'CmpItemKindModule' }, | ||
DropBarIconKindNamespace = { link = 'NameSpace' }, | ||
DropBarIconKindNull = { link = 'Constant' }, | ||
DropBarIconKindNumber = { link = 'Number' }, | ||
DropBarIconKindObject = { link = 'Statement' }, | ||
DropBarIconKindOperator = { link = 'Operator' }, | ||
DropBarIconKindPackage = { link = 'CmpItemKindModule' }, | ||
DropBarIconKindProperty = { link = 'CmpItemKindProperty' }, | ||
DropBarIconKindReference = { link = 'CmpItemKindReference' }, | ||
DropBarIconKindRepeat = { link = 'Repeat' }, | ||
DropBarIconKindScope = { link = 'NameSpace' }, | ||
DropBarIconKindSpecifier = { link = 'Specifier' }, | ||
DropBarIconKindStatement = { link = 'Statement' }, | ||
DropBarIconKindString = { link = 'String' }, | ||
DropBarIconKindStruct = { link = 'CmpItemKindStruct' }, | ||
DropBarIconKindSwitchStatement = { link = 'Conditional' }, | ||
DropBarIconKindType = { link = 'CmpItemKindClass' }, | ||
DropBarIconKindTypeParameter = { link = 'CmpItemKindTypeParameter' }, | ||
DropBarIconKindUnit = { link = 'CmpItemKindUnit' }, | ||
DropBarIconKindValue = { link = 'Number' }, | ||
DropBarIconKindVariable = { link = 'CmpItemKindVariable' }, | ||
DropBarIconKindWhileStatement = { link = 'Repeat' }, | ||
DropBarIconUIIndicator = { link = 'SpecialChar' }, | ||
DropBarIconUIPickPivot = { link = 'Error' }, | ||
DropBarIconUISeparator = { link = 'SpecialChar' }, | ||
DropBarIconUISeparatorMenu = { link = 'DropBarIconUISeparator' }, | ||
DropBarMenuCurrentContext = { link = 'PmenuSel' }, | ||
DropBarMenuHoverEntry = { link = 'Visual' }, | ||
DropBarMenuHoverIcon = { reverse = true }, | ||
DropBarMenuHoverSymbol = { bold = true }, | ||
} | ||
-- stylua: ignore end | ||
-- stylua: ignore start | ||
local hlgroups = { | ||
DropBarIconKindArray = { link = 'Array' }, | ||
DropBarIconKindBoolean = { link = 'Boolean' }, | ||
DropBarIconKindBreakStatement = { link = 'Error' }, | ||
DropBarIconKindCall = { link = 'Function' }, | ||
DropBarIconKindCaseStatement = { link = 'Conditional' }, | ||
DropBarIconKindClass = { link = 'CmpItemKindClass' }, | ||
DropBarIconKindConstant = { link = 'Constant' }, | ||
DropBarIconKindConstructor = { link = 'CmpItemKindConstructor' }, | ||
DropBarIconKindContinueStatement = { link = 'Repeat' }, | ||
DropBarIconKindDeclaration = { link = 'CmpItemKindSnippet' }, | ||
DropBarIconKindDelete = { link = 'Error' }, | ||
DropBarIconKindDoStatement = { link = 'Repeat' }, | ||
DropBarIconKindElseStatement = { link = 'Conditional' }, | ||
DropBarIconKindEnum = { link = 'CmpItemKindEnum' }, | ||
DropBarIconKindEnumMember = { link = 'CmpItemKindEnumMember' }, | ||
DropBarIconKindEvent = { link = 'CmpItemKindEvent' }, | ||
DropBarIconKindField = { link = 'CmpItemKindField' }, | ||
DropBarIconKindFile = { link = 'NormalFloat' }, | ||
DropBarIconKindFolder = { link = 'Directory' }, | ||
DropBarIconKindForStatement = { link = 'Repeat' }, | ||
DropBarIconKindFunction = { link = 'Function' }, | ||
DropBarIconKindIdentifier = { link = 'CmpItemKindVariable' }, | ||
DropBarIconKindIfStatement = { link = 'Conditional' }, | ||
DropBarIconKindInterface = { link = 'CmpItemKindInterface' }, | ||
DropBarIconKindKeyword = { link = 'Keyword' }, | ||
DropBarIconKindList = { link = 'SpecialChar' }, | ||
DropBarIconKindMacro = { link = 'Macro' }, | ||
DropBarIconKindMarkdownH1 = { link = 'markdownH1' }, | ||
DropBarIconKindMarkdownH2 = { link = 'markdownH2' }, | ||
DropBarIconKindMarkdownH3 = { link = 'markdownH3' }, | ||
DropBarIconKindMarkdownH4 = { link = 'markdownH4' }, | ||
DropBarIconKindMarkdownH5 = { link = 'markdownH5' }, | ||
DropBarIconKindMarkdownH6 = { link = 'markdownH6' }, | ||
DropBarIconKindMethod = { link = 'CmpItemKindMethod' }, | ||
DropBarIconKindModule = { link = 'CmpItemKindModule' }, | ||
DropBarIconKindNamespace = { link = 'NameSpace' }, | ||
DropBarIconKindNull = { link = 'Constant' }, | ||
DropBarIconKindNumber = { link = 'Number' }, | ||
DropBarIconKindObject = { link = 'Statement' }, | ||
DropBarIconKindOperator = { link = 'Operator' }, | ||
DropBarIconKindPackage = { link = 'CmpItemKindModule' }, | ||
DropBarIconKindProperty = { link = 'CmpItemKindProperty' }, | ||
DropBarIconKindReference = { link = 'CmpItemKindReference' }, | ||
DropBarIconKindRepeat = { link = 'Repeat' }, | ||
DropBarIconKindScope = { link = 'NameSpace' }, | ||
DropBarIconKindSpecifier = { link = 'Specifier' }, | ||
DropBarIconKindStatement = { link = 'Statement' }, | ||
DropBarIconKindString = { link = 'String' }, | ||
DropBarIconKindStruct = { link = 'CmpItemKindStruct' }, | ||
DropBarIconKindSwitchStatement = { link = 'Conditional' }, | ||
DropBarIconKindType = { link = 'CmpItemKindClass' }, | ||
DropBarIconKindTypeParameter = { link = 'CmpItemKindTypeParameter' }, | ||
DropBarIconKindUnit = { link = 'CmpItemKindUnit' }, | ||
DropBarIconKindValue = { link = 'Number' }, | ||
DropBarIconKindVariable = { link = 'CmpItemKindVariable' }, | ||
DropBarIconKindWhileStatement = { link = 'Repeat' }, | ||
DropBarIconUIIndicator = { link = 'SpecialChar' }, | ||
DropBarIconUIPickPivot = { link = 'Error' }, | ||
DropBarIconUISeparator = { link = 'SpecialChar' }, | ||
DropBarIconUISeparatorMenu = { link = 'DropBarIconUISeparator' }, | ||
DropBarMenuCurrentContext = { link = 'PmenuSel' }, | ||
DropBarMenuHoverEntry = { link = 'Visual' }, | ||
DropBarMenuHoverIcon = { reverse = true }, | ||
DropBarMenuHoverSymbol = { bold = true }, | ||
} | ||
-- stylua: ignore end | ||
|
||
---Set winbar highlight groups | ||
---@return nil | ||
local function set_hlgroups() | ||
for hl_name, hl_settings in pairs(hlgroups) do | ||
hl_settings.default = true | ||
vim.api.nvim_set_hl(0, hl_name, hl_settings) | ||
end | ||
end | ||
|
||
---Initialize highlight groups for dropbar | ||
local function init() | ||
set_hlgroups() | ||
vim.api.nvim_create_autocmd('ColorScheme', { | ||
group = vim.api.nvim_create_augroup('DropBarHlGroups', {}), | ||
callback = set_hlgroups, | ||
}) | ||
end | ||
|
||
return { | ||
init = init, | ||
} |