Skip to content

Share we add link option for custom highlight? #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ require('onedark').setup {
["@keyword"] = {fg = '$green'},
["@string"] = {fg = '$bright_orange', bg = '#00ff00', fmt = 'bold'},
["@function"] = {fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic'},
["@function.builtin"] = {fg = '#0059ff'}
["@function.builtin"] = {fg = '#0059ff'},
WinSeparator = { link = "VertSplit" },
}
}
```
Expand Down
20 changes: 15 additions & 5 deletions lua/onedark/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ hl.plugins.cmp = {
CmpItemKind = { fg = c.purple, fmt = cfg.cmp_itemkind_reverse and "reverse" },
}

hl.plugins.blink = {
BlinkCmpMenu = colors.LightGrey,
BlinkCmpKind = { fg = c.purple, fmt = cfg.cmp_itemkind_reverse and "reverse" },
}

hl.plugins.coc = {
CocErrorSign = hl.plugins.lsp.DiagnosticError,
CocHintSign = hl.plugins.lsp.DiagnosticHint,
Expand Down Expand Up @@ -904,6 +909,7 @@ function M.setup()
-- define cmp and aerial kind highlights with lsp_kind_icons_color
for kind, color in pairs(lsp_kind_icons_color) do
hl.plugins.cmp["CmpItemKind" .. kind] = { fg = color, fmt = cfg.cmp_itemkind_reverse and "reverse" }
hl.plugins.cmp["BlinkCmpKind" .. kind] = { fg = color, fmt = cfg.cmp_itemkind_reverse and "reverse" }
hl.plugins.outline["Aerial" .. kind .. "Icon"] = { fg = color }
hl.plugins.navic["NavicIcons" .. kind] = { fg = color }
end
Expand Down Expand Up @@ -934,11 +940,15 @@ function M.setup()
end

for group_name, group_settings in pairs(vim.g.onedark_config.highlights) do
vim.api.nvim_command(string.format("highlight %s %s %s %s %s", group_name,
replace_color("guifg", group_settings.fg),
replace_color("guibg", group_settings.bg),
replace_color("guisp", group_settings.sp),
replace_color("gui", group_settings.fmt)))
if group_settings.link == nil then
vim.api.nvim_command(string.format("highlight %s %s %s %s %s", group_name,
replace_color("guifg", group_settings.fg),
replace_color("guibg", group_settings.bg),
replace_color("guisp", group_settings.sp),
replace_color("gui", group_settings.fmt)))
else
vim.api.nvim_set_hl(0, group_name, { link = group_settings.link })
end
end
end

Expand Down