rose-pine / neovim

Soho vibes for Neovim
MIT License
2.25k stars 144 forks source link

Added new themes for lualine #267

Closed VoxelPrismatic closed 4 months ago

VoxelPrismatic commented 5 months ago

A couple of things here:

  1. Moved the variants part of /lua/rose-pine/palettes.lua to another file
    • palettes.lua now imports variants.lua
    • I understand that it's annoying to jump around ten times, but it's not breaking!
  2. Moved the lualine theme generators to a new file under /lua/lualine/generate.lua
    • This removes repeated code across the new themes
  3. Created new theme files
    1. rose-pine-moon - Like rose-pine, but always uses the moon variant
    2. rose-pine-main - (etc...) main variant
    3. rose-pine-dawn - (etc...) dawn variant
    4. rose-pine-alt-moon - Like rose-pine-alt, but always uses the moon variant
    5. rose-pine-alt-main - (etc...) main variant
    6. rose-pine-alt-dawn - (etc...) dawn variant

Why? I just prefer a dark status line. image

mvllow commented 5 months ago

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?

VoxelPrismatic commented 5 months ago

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

VoxelPrismatic commented 5 months ago

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.

mvllow commented 5 months ago

This all looks great, thank you! I do want to personally test everything before merging so it may be a few days :)

mvllow commented 4 months ago

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:

Screenshot of Rosé Pine Dawn using a darker lualine theme within Neovim

-- 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 },
    },
}
VoxelPrismatic commented 4 months ago

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?

VoxelPrismatic commented 4 months ago

This latest commit creates a grey and inverse theme. The grey theme follows your general idea, and looks like this: image

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.

mvllow commented 4 months ago

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

VoxelPrismatic commented 4 months ago

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.

mvllow commented 4 months ago

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!