Replies: 7 comments 16 replies
-
Something like this should do the trick, depends on your highlight groups.
See |
Beta Was this translation helpful? Give feedback.
-
Sweet, managed to get this working, using Lua.
Here's what it looks like: Just need to get the virtual text plugin to adopt the same background color. |
Beta Was this translation helpful? Give feedback.
-
@kaykhan You can try something like this:
|
Beta Was this translation helpful? Give feedback.
-
I can't change the color aswell I just put 🔴 this inside of text it appears with as look as is |
Beta Was this translation helpful? Give feedback.
-
Since some colorschemes might clear the user-defined colors. Here is a improved version of solution.
|
Beta Was this translation helpful? Give feedback.
-
After switching to using plugin management with lazy.nvim, no method of setting colors works now with any color scheme. Before I was using that UPDATE: Actually, since update to neovim v0.9.5 it's not working at all even with plug.vim. I'll try older nvim. UPDATE 2: OK, my bad, something else is wrong with my set up. Even nvim v0.9.4 isn't working. I'll try to narrow it down. UPDATE 3: OK, I see what's going on. Setting of the colorscheme should happen after that autocmd is defined, otherwise it won't work. Though, lazy.nvim recommends setting of the colorscheme to have highest priority. I suppose that's not really suitable for this case. I just split that autocmd into a separate module from the plugin configuration to make sure it works and load it before lazy.nvim itself. |
Beta Was this translation helpful? Give feedback.
-
Another small update. I managed to enforce the settings with autocmd without explicitly setting colorscheme. The trick was to use augroup and -- augroup to be able to trigger the autocommand explicitly for the first time
vim.api.nvim_create_augroup("dap_colors", {})
-- autocmd to enforce colors settings on any color scheme change
vim.api.nvim_create_autocmd("ColorScheme", {
group = "dap_colors",
pattern = "*",
desc = "Set DAP marker colors and prevent color theme from resetting them",
callback = function()
-- Reuse current SignColumn background (except for DapStoppedLine)
local sign_column_hl = vim.api.nvim_get_hl(0, { name = 'SignColumn' })
-- if bg or ctermbg aren't found, use bg = 'bg' (which means current Normal) and ctermbg = 'Black'
-- convert to 6 digit hex value starting with #
local sign_column_bg = (sign_column_hl.bg ~= nil) and ('#%06x'):format(sign_column_hl.bg) or 'bg'
local sign_column_ctermbg = (sign_column_hl.ctermbg ~= nil) and sign_column_hl.ctermbg or 'Black'
vim.api.nvim_set_hl(0, 'DapStopped', { fg = '#00ff00', bg = sign_column_bg, ctermbg = sign_column_ctermbg })
vim.api.nvim_set_hl(0, 'DapStoppedLine', { bg = '#2e4d3d', ctermbg = 'Green' })
vim.api.nvim_set_hl(0, 'DapBreakpoint', { fg = '#c23127', bg = sign_column_bg, ctermbg = sign_column_ctermbg })
vim.api.nvim_set_hl(0, 'DapBreakpointRejected', { fg = '#888ca6', bg = sign_column_bg, ctermbg = sign_column_ctermbg })
vim.api.nvim_set_hl(0, 'DapLogPoint', { fg = '#61afef', bg = sign_column_bg, ctermbg = sign_column_ctermbg })
end
})
-- executing the settings explicitly for the first time
vim.api.nvim_exec_autocmds("ColorScheme", { group = "dap_colors" }) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to change the sign of breakpoint, and I have changed the sign, but don't how to change it color.

I want to make the sign of breakpoint in the picture into red.
Beta Was this translation helpful? Give feedback.
All reactions