-
Hello, I am desperately trying to the set the background color of the status line in the middle, where no components are set (between I have tried to call this code (once the vim.api.nvim_set_hl(0, "StatusLine", {
force = true,
bg = "<my color>",
fg = "<my color>",
})
vim.api.nvim_set_hl(0, "StatusLineNC", {
force = true,
bg = "<my color>",
fg = "<my color>",
}) Unfortunately it doesn't seem to do anything. The color is still the same. It's like the colors don't seem to be overriding the colors of the theme. Thank you very much in advance for any help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
StatusLine and StatusLineNC are the highlight groups for the default statusline of Neovim. For lualine if you do |
Beta Was this translation helpful? Give feedback.
-
Dunno if you figured it out but that seems impossible to me too. EDIT: Ok I got it 😁 Using lazy .. (I'm also using the distro hence why opts) return {
"nvim-lualine/lualine.nvim",
opts = function(_, opts)
opts.options = opts.options or {}
-- Override specific highlights after the theme is set
local custom_horizon = require("lualine.themes.horizon")
local bright_pink = "#FF1493"
-- Set pink background for all available modes
custom_horizon.normal.c.bg = bright_pink
custom_horizon.insert.c.bg = bright_pink
custom_horizon.visual.c.bg = bright_pink
custom_horizon.replace.c.bg = bright_pink
custom_horizon.command.c.bg = bright_pink
custom_horizon.inactive.c.bg = bright_pink
if custom_horizon.terminal then
custom_horizon.terminal.c.bg = bright_pink
end
if custom_horizon.select then
custom_horizon.select.c.bg = bright_pink
end
opts.options.theme = custom_horizon
return opts
end,
} Set to pink for testing purpose. So you can load a theme by requiring its module, access the tables, changes their values. |
Beta Was this translation helpful? Give feedback.
StatusLine and StatusLineNC are the highlight groups for the default statusline of Neovim. For lualine if you do
:hi lualine<TAB>
it should show all the highlight groups associated with lualine. Hope this helps.