nvf icon indicating copy to clipboard operation
nvf copied to clipboard

[skip ci] theme: Add tinted-vim plugin theming support

Open JamyGolden opened this issue 4 months ago • 6 comments

General

This is a continuation of https://github.com/NotAShelf/nvf/pull/755. Thanks for the comments on that PR. Addressing some of the things mentioned there:

As far as I remember the current plugin doesn't actually support Base24 themes (which is a good improvement over Base16) but I am not a huge fan of adding more Vimscript plugins.

@NotAShelf I've created and stabalised tinted-nvim where we have 2 active maintainers.

What if the user sets a style that is not actually available? ? (basically hasAttr) is not type-safe either. I'm a little conflicted on adding this. Could there be a better plugin or/and a solution?

@NotAShelf in this version the styles aren't dynamic. So when new schemes come along we can just update the list manually.

About the PR

I've added tinted-nvim support for lualine. Info about that here:

  • https://github.com/nvim-lualine/lualine.nvim/pull/1409
  • https://github.com/tinted-theming/tinted-nvim/pull/15

All that needs to be done is to set the lualine theme value to theme = "tinted" with the tinted-nvim plugin loaded and it will use the theme set by tinted-nvim. So to get this working with nvf:

...
    statusline = {
      lualine = {
        enable = true;
        theme = "tinted";
      };
    };

    theme = {
      enable = true;
      name = "tinted-nvim";
      style = "base24-dracula";
    };
...
  • I don't know how to add anything to the manual. I searched for base16 but didn't find anything relevant in the project. nix run .#docs-html -Lv gives me error: unable to execute '/nix/store/6ny8kfmppna5f1iniw27hk0kjhkvlvqm-nvf-manual/bin/nvf-manual': No such file or directory (If this is related to the manual)
  • There are breaking changes here since vim.theme.base16-colors doesn't exist anymore. I'm not sure how to make a migration guide

Sanity Checking

  • [x] I have updated the changelog as per my changes
  • [x] I have tested, and self-reviewed my code
  • [x] My changes fit guidelines found in hacking nvf
  • Style and consistency
    • [x] I ran Alejandra to format my code (nix fmt)
    • [x] My code conforms to the editorconfig configuration of the project
    • [x] My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • [x] My code includes comments in particularly complex areas
    • [] I have added a section in the manual
    • [] (For breaking changes) I have included a migration guide
  • Package(s) built:
    • [x] .#nix (default package)
    • [x] .#maximal
    • [ ] .#docs-html (manual, must build)
    • [x] .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • [x] x86_64-linux
    • [ ] aarch64-linux
    • [ ] x86_64-darwin
    • [ ] aarch64-darwin

Add a :+1: reaction to pull requests you find important.

JamyGolden avatar Aug 09 '25 11:08 JamyGolden

:rocket: Live preview deployed from 4b904de36157035fa3dddf0312a4242e5d0d9bd0

View it here:

Debug Information

Triggered by: JamyGolden

HEAD at: main

Reruns: 1539

github-actions[bot] avatar Aug 09 '25 11:08 github-actions[bot]

@NotAShelf ping

JamyGolden avatar Oct 01 '25 10:10 JamyGolden

Hi, it seems that I've formulated a reply and forgot to send again. Sorry for the delayed response!

My plans for this PR is to hold it until we merge 0.8, and merge it alongside a planned theming refactor. I think the theming module is currently bearing a lot of technical debt, so it will be easier to refactor it and then add more code on it. Thank you for your work so far, but I'm going to have to ask you to be patient for a little more :)

NotAShelf avatar Oct 08 '25 13:10 NotAShelf

Ok thanks, no problem :) I don't mind waiting at all. I'll update once 0.8 is merged.

JamyGolden avatar Oct 08 '25 19:10 JamyGolden

Good news, I've finally completed the theming refactor. It should be up as a PR (to v0.8 branch)) by the end of this week. I would appreciate it if you could refactor PR and consider provider feedback on the new API for theming plugins :)

NotAShelf avatar Oct 31 '25 03:10 NotAShelf

@NotAShelf that's great with the v0.8 branch! Which API for theming plugins has changed? I've looked through ./modules/plugins/theme/* but things seem the same as they were previously, so I'm probably looking in the wrong place.

What is the process on updating documentation in the gh-pages for the new API? (I haven't been able to find this info in the documentation)

JamyGolden avatar Nov 01 '25 21:11 JamyGolden