Closed agingorange closed 1 year ago
Hi there! This is the correct way of doing it, but you may not be seeing much because the colours aren't changing a lot with this example. palette.bg0
is the standard background colour for the theme and sp
controls the colour of special characters (e.g. underlines). If you want to change the colour of the cursor line, changing the background to a different colour will make it more apparent:
require("everforest").setup({
on_highlights = function (hl, palette)
hl.CursorLine = { fg = palette.none, bg = palette.bg2 }
end
})
Alternatively, you can keep the sp
colour and add a separate style like underlines:
require("everforest").setup({
on_highlights = function (hl, palette)
hl.CursorLine = { fg = palette.none, bg = palette.bg0, sp = palette.red, underline = true }
end
})
Thanks for coming back to me!
I must've done something else wrong. This is all the code for the Lazy plugin manager. I've tried backgrounds and colors without success. What am I missing?
{
"neanias/everforest-nvim",
version = false,
lazy = false,
priority = 1000,
config = function()
require("everforest").setup({
on_highlights = function(hl, palette)
hl.CursorLine = { fg = palette.none, bg = palette.yellow }
end
})
require("everforest").load()
end,
},
I tested this locally and can't reproduce your problem, but could you try this snippet instead?
{
"neanias/everforest-nvim",
version = false,
lazy = false,
priority = 1000,
config = function()
local everforest = require("everforest")
everforest.setup({
on_highlights = function(hl, palette)
hl.CursorLine = { fg = palette.none, bg = palette.yellow }
end
})
everforest.load()
end,
},
Man, I'm so sorry. When I switched to Lazy, I forgot to enable the cursorline. :(
For completeness' sake, here's the code:
{
"neanias/everforest-nvim",
version = false,
lazy = false,
priority = 1000,
config = function()
require("everforest").setup({
on_highlights = function(hl, palette)
hl.CursorLine = { fg = palette.none, bg = palette.bg1 }
end
})
end,
init = function()
vim.opt.cursorline = true
vim.o.background = "dark"
vim.cmd.colorscheme("everforest")
end,
},
Again, I do apologize.
Haha, no problem! Before this, I wasn't as clear on how sp
styling actually worked, so this has been a learning opportunity for me too. Glad it's fixed now!
Oh, a quick note: the CursorLine
highlight is { fg = palette.none, bg = palette.bg1 }
, so you can leave your custom highlight out and use the default one if you prefer
So basically, what you're saying is, I sent us on a journey without a destination. Thanks! 🤣
I learnt something about highlights so I'm happy with that 😅
I tried several variations of this:
What's the correct way of doing this?