nvim icon indicating copy to clipboard operation
nvim copied to clipboard

feat(lualine): color overrides for lualine integration

Open nabellows opened this issue 1 year ago • 4 comments

🎉 First off, thanks for taking the time to contribute! 🎉

Here are some guidelines:

  • Format code using stylua.
  • New plugin integration should be added in alphabetical order:
  • Create a topic branch on your fork for your specific PR.
  • Use conventionalcommits.org's rules for explicit and meaningful commit messages.
  • If it's your first time contributing to a project, then read About pull requests on Github's docs.

Here are some tips:

  • Use vim.g.catppuccin_debug = true to get live config re-loading

nabellows avatar Mar 09 '25 01:03 nabellows

I use this in my personal config to make the lualine colors match the usual Catppuccin theme with Lavender as Normal mode highlight for example. Addresses: https://github.com/catppuccin/nvim/issues/635

image

nabellows avatar Mar 09 '25 01:03 nabellows

What is the status of this PR ?

JAWS-tm avatar Oct 21 '25 21:10 JAWS-tm

Thanks for the review @comfysage, some questions

remove the O.integrations.lualine.all field; there's almost no situation where this is useful and this causes type errors (since all is not a valid flavor).

From my fork and as far as I see still in main, there is an all variant in the CtpFlavors type: https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/types.lua#L7. Similar support exists on O.highlight_overrides and is documented accordingly. Similarly I don't see type errors on my side with lua LSP.

Can you explain this more? I'd be sad to see this go as this is actually my primary/only use case as per my config being as below. It lets me use "lavender" color for both my light/dark schemes (latte vs macchiatto), or whatever flavor I feel like for the day:

        lualine = {
          all = function(colors)
            ---@type CtpIntegrationLualineOverride
            return {
              normal = {
                a = { bg = colors.lavender },
                b = { fg = colors.lavender },
              },
              insert = {
                a = { bg = colors.flamingo },
                b = { fg = colors.flamingo },
              },
            }
          end,
        },

Adding to this, with typical LuaLS + blink + lazydev setup, we can see my type hinting is working happily, even within all:

image image

The other question I left inline to your suggestion is how we want to handle documenting the "config here in catppuccin" ... "and then config in your lualine config". That "and then" documentation was the existing/old documentation that I left in to ensure the user allows lualine to find the lualine theme provided by catppuccin.

nabellows avatar Oct 28 '25 00:10 nabellows

Similar support exists on O.highlight_overrides and is documented accordingly. Similarly I don't see type errors on my side with lua LSP.

in that case it's alright:)

thnx for the lovely work <3


as I had mentioned in the review: just use a lua comment to explain it should be part of the user's lualine config.

comfysage avatar Oct 28 '25 08:10 comfysage