-
Notifications
You must be signed in to change notification settings - Fork 1
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
Help with highlighting statuscol/status column icon background #16
Comments
I've tried playing with |
Hi there! You can also check this issue for more info: #13 But basically you're right, Try that first, but this may not work if those sign columns have another highlight names |
Thanks for the reply, I’ve tried linking the highlight groups like you suggested:
but it doesn’t change anything unfortunately, it looks like they have a different highlight group like you said. Is there a way I could debug what hi light group they’re using? I tried reading the source code for both plugins but i couldn’t figure it out lol |
Think I’ve figured it out, i need to set the custom segments and the custom sign defined things to the same hl group as well |
@rasulomaroff I can't get only the current line to be highlighted, the custom columns are permanently set in 1 colour and I don't understand it: I've tried setting all the hl groups to "CursorLine", "CursorLineNr" , tried creating a custom hl group and tried to adjust that in my own preset but nothing works. This is the custom preset:
|
@Ajaymamtora Is it highlighted for you even when the only highlight group that is applied by
Could you also please share your config for reactive and statuscol plugins, if not able to track the issue? I'll take a look at it when I have times |
It did but I had linked those highlight groups (no matter what I did it didn't work while linked), when I unlink them I can control them properly, thanks After a lot more playing about it looks like to get this to work properly you have to ensure you don't declare a hl group in the custom segments. Also this bit in the readme causes the preset to basically not work: skip = function()
return vim.api.nvim_buf_get_option(0, 'buftype') == ''
end, Here's a working config for statuscol: function config.statuscol()
local builtin = require("statuscol.builtin")
local opts = {
setopt = true,
thousands = false,
relculright = true,
foldfunc = "builtin",
ft_ignore = { "Outline", "terminal", "toggleterm", "qf", "Trouble", "help", "neo-tree", "oil" },
bt_ignore = { "terminal", "help", "nofile", "prompt", "toggleterm", "qf", "Trouble" },
segments = {
{
text = {
function(args)
return builtin.foldfunc(args)
end,
},
condition = { builtin.not_empty, true, },
click = "v:lua.ScFa",
},
{
sign = {
name = { "Dap" },
maxwidth = 1,
colwidth = 1,
auto = true,
fillchar = " ",
},
condition = { builtin.not_empty },
click = "v:lua.ScSa",
},
{
sign = {
namespace = { "diagnostic" },
maxwidth = 1,
colwidth = 1,
auto = true,
fillchar = " ",
},
condition = { builtin.not_empty },
click = "v:lua.ScSa",
},
{
text = { " " },
},
{
sign = {
name = { ".*" },
namespace = { ".*" },
maxwidth = 2,
colwidth = 2,
auto = true,
fillchar = " ",
},
click = "v:lua.ScSa",
},
{
text = { builtin.lnumfunc },
},
{
text = { " " },
},
{
sign = {
namespace = { "gitsigns" },
maxwidth = 1,
colwidth = 1,
auto = false,
wrap = true,
fillchar = " ",
},
},
},
clickmod = "c",
clickhandlers = {
Lnum = builtin.lnum_click,
FoldClose = builtin.foldclose_click,
FoldOpen = builtin.foldopen_click,
FoldOther = builtin.foldother_click,
DapBreakpointRejected = builtin.toggle_breakpoint,
DapBreakpoint = builtin.toggle_breakpoint,
DapBreakpointCondition = builtin.toggle_breakpoint,
DiagnosticSignError = builtin.diagnostic_click,
DiagnosticSignHint = builtin.diagnostic_click,
DiagnosticSignInfo = builtin.diagnostic_click,
DiagnosticSignWarn = builtin.diagnostic_click,
GitSignsTopdelete = builtin.gitsigns_click,
GitSignsUntracked = builtin.gitsigns_click,
GitSignsAdd = builtin.gitsigns_click,
GitSignsChange = builtin.gitsigns_click,
GitSignsChangedelete = builtin.gitsigns_click,
GitSignsDelete = builtin.gitsigns_click,
gitsigns_extmark_signs_ = builtin.gitsigns_click,
LightBulbSign = function(args)
vim.lsp.buf.code_action()
end,
},
}
require("statuscol").setup(opts)
end
reactive config: function config.reactive()
local opts = {
builtin = {
cursorline = false,
cursor = false,
modemsg = false
},
load = { 'mypreset' }, -- you can also use a string
}
require('reactive').setup(opts)
end reactive preset at /lua/reactive/presets/mypreset.lua (based on the builtin cursor line preset) local function set_highlight(groups, color)
local result = {}
for _, group in ipairs(groups) do
result[group] = { bg = color }
end
return result
end
local common_highlight_groups = {
"CursorLine",
"CursorLineSign",
"CursorLineFold",
"CursorLineNr",
"DapBreakpoint",
"DapRejected",
"DapLogPoint",
"DapStopped",
"DiagnosticSignError",
"DiagnosticSignWarn",
"DiagnosticSignInfo",
"DiagnosticSignHint",
}
local common_highlight = set_highlight(common_highlight_groups, "#fff000")
return {
name = "mypreset",
init = function()
vim.opt.cursorline = true
end,
static = {
winhl = {
inactive = {
CursorLine = { bg = '#202020' },
CursorLineNr = { fg = '#b0b0b0', bg = '#202020' },
},
},
},
modes = {
no = {
operators = {
[{ "gu", "gU", "g~", "~" }] = {
winhl = {
CursorLine = { bg = "#334155" },
CursorLineNr = { fg = "#cbd5e1", bg = "#334155" },
},
},
c = {
winhl = {
CursorLine = { bg = "#162044" },
CursorLineNr = { fg = "#93c5fd", bg = "#162044" },
},
},
d = {
winhl = {
CursorLine = { bg = "#350808" },
CursorLineNr = { fg = "#fca5a5", bg = "#350808" },
},
},
y = {
winhl = {
CursorLine = { bg = "#422006" },
CursorLineNr = { fg = "#fdba74", bg = "#422006" },
},
},
},
},
i = {
winhl = {
CursorLine = { bg = "#012828" },
CursorLineNr = { fg = "#5eead4", bg = "#012828" },
},
},
c = {
winhl = {
CursorLine = { bg = "#202020" },
CursorLineNr = { fg = "#ffffff", bg = "#303030" },
},
},
n = {
winhl = common_highlight,
},
[{ "v", "V", "\x16" }] = {
winhl = {
CursorLineNr = { fg = "#d8b4fe" },
Visual = { bg = "#3b0764" },
},
},
[{ "s", "S", "\x13" }] = {
winhl = {
CursorLineNr = { fg = "#c4b5fd" },
Visual = { bg = "#2e1065" },
},
},
R = {
winhl = {
CursorLine = { bg = "#083344" },
CursorLineNr = { fg = "#67e8f9", bg = "#083344" },
},
},
},
}
|
Hi @Ajaymamtora, I had some time to check the issue and again it seems like there's nothing wrong with neither of plugins. Those highlights were linked to Regarding the skip function. I also checked that and it works properly. Whenever |
When I use statuscol.nvim to define extra columns, the extra ones are highlighted:
https://github.com/luukvbaal/statuscol.nvim
I've just used the default setup and am unsure how I'd go about setting these highlights?
This is my statuscol config:
Its the components defines with
sign = {..
that don't get highlightedAny help would be much appreciated
The text was updated successfully, but these errors were encountered: