neovim
neovim copied to clipboard
Added new themes for lualine
A couple of things here:
- Moved the variants part of
/lua/rose-pine/palettes.lua
to another file-
palettes.lua
now importsvariants.lua
- I understand that it's annoying to jump around ten times, but it's not breaking!
-
- Moved the lualine theme generators to a new file under
/lua/lualine/generate.lua
- This removes repeated code across the new themes
- Created new theme files
-
rose-pine-moon
- Likerose-pine
, but always uses the moon variant -
rose-pine-main
- (etc...) main variant -
rose-pine-dawn
- (etc...) dawn variant -
rose-pine-alt-moon
- Likerose-pine-alt
, but always uses the moon variant -
rose-pine-alt-main
- (etc...) main variant -
rose-pine-alt-dawn
- (etc...) dawn variant
-
Why? I just prefer a dark status line.
Hey there! Appreciate the contribution—I do have some reservations, however. I think I'd prefer not having the variants pulled into a new file. Would it work/make sense to instead use local p = require("rose-pine.palette").moon
to grab a specific variant's palette?
That's news to me!
Sorry, I'm not too familiar with Lua, so I'm happy to make those changes. I was under the impression that rose-pine.pallete
only returned the theme set in the config
I just checked, and yes, my suspicions are correct. require("rose-pine.palette")
only returns the palette as set by the config. require("rose-pine.palette").moon
returns nil
.
I suppose I can embed the other variants in the returned object, under p._variants.moon
or something like that. Let me know if that's good with you.
This all looks great, thank you! I do want to personally test everything before merging so it may be a few days :)
Side note, I know you started this to be able to have a dark statusline in dawn (or perhaps light statusline in main/moon)—perhaps we could also add matching inverse themes, e.g. using text
as the background.
Here's an example of an inverse theme for dawn:
-- rose-pine-inv.lua
-- (not a huge fan of this filename but it matches our 'alt' suffix)
local p = require("rose-pine.palette")
return {
normal = {
a = { bg = p.rose, fg = p.base, gui = "bold" },
b = { bg = p.overlay, fg = p.rose },
c = { bg = p.text, fg = p.base },
},
insert = {
a = { bg = p.foam, fg = p.base, gui = "bold" },
b = { bg = p.overlay, fg = p.foam },
c = { bg = p.text, fg = p.base },
},
visual = {
a = { bg = p.iris, fg = p.base, gui = "bold" },
b = { bg = p.overlay, fg = p.iris },
c = { bg = p.text, fg = p.base },
},
replace = {
a = { bg = p.pine, fg = p.base, gui = "bold" },
b = { bg = p.overlay, fg = p.pine },
c = { bg = p.text, fg = p.base },
},
command = {
a = { bg = p.love, fg = p.base, gui = "bold" },
b = { bg = p.overlay, fg = p.love },
c = { bg = p.text, fg = p.base },
},
inactive = {
a = { bg = p.muted, fg = p.overlay, gui = "bold" },
b = { bg = p.muted, fg = p.overlay },
c = { bg = p.muted, fg = p.base },
},
}
At this point, I think we should find a way to do the following:
{
theme = require("rose-pine.plugins.lualine").inverse.moon
}
Of course, passing "rose-pine", "rose-pine-alt", and "rose-pine-inv" will all work as expected. There are just too many names to keep track of and update. In this very example, we'd need to create three new files just for inv
. And what happens when we add a new theme beyond Dawn, Moon and Main?
This latest commit creates a grey and inverse theme.
The grey theme follows your general idea, and looks like this:
The inverse theme actually chooses the opposite theme; main and moon will select normal:dawn, and dawn will select normal:moon.
I'm actually a big fan of the grey theme, and already switched to it.
I like the grey, perhaps it would be better named "neutral"? As for the inverse, I think I prefer utilising the variant's palette only if possible.
Thank you for the iterations/changes :)
Edit: Or even renaming "grey" to "highlight" since it is using our highlight colours
The inverse is specifically designed to pull the opposite color without much thought. Believe me, I tried to make a dark bar, but the colors get very difficult to see at smaller font sizes (I use 8px). Grey, or neutral, strikes a nice balance.
I renamed grey to neutral. As far as inverse, I think having an opposite theme statusline is fine for the short term although ideally we would have a true inverse of the current variant's palette. That shouldn't block this PR, it only makes me question the naming. Either way not a huge deal and having this seems better than not :)
Thanks again!