NotAShelf / nvf

A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS.
https://notashelf.github.io/nvf/
MIT License
209 stars 28 forks source link

Colorizer not attaching to buffers #433

Open Jappie3 opened 4 hours ago

Jappie3 commented 4 hours ago

⚠️ Please verify that this bug has NOT been reported before.

Description

Colorizer does not attach when opening a buffer, when running :ColorizerAttachToBuffer it correctly highlights colors

👟 Reproduction steps

minimal reproducible example:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nvf.url = "github:notashelf/nvf";
  };

  outputs = {
    self,
    nixpkgs,
    ...
  } @ inputs: {
    packages."x86_64-linux" = {
      default =
        (inputs.nvf.lib.neovimConfiguration {
          modules = [
            {
              config.vim.theme.enable = true;
              config.vim.ui.colorizer.enable = true;
            }
          ];
          inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
        })
        .neovim;
    };
  };
}
nix run

type 'green' or 'red' -> no color highlighting run :ColorizerAttachToBuffer -> color highlighting

👀 Expected behavior

Colorizer should work without explicitly attaching it to the buffer

😓 Actual Behavior

It did not attach to the buffer

💻 Metadata

📝 Relevant log output

no clue how to get nvim logs tbh
NotAShelf commented 3 hours ago

nvf does not enable the names feature for colorizer by default. You will need to enable it manually in colorizer.setupOpts. See: https://github.com/NotAShelf/nvf/blob/main/modules/plugins/ui/colorizer/colorizer.nix

Jappie3 commented 3 hours ago

even adding colorizer.setupOpts.names = true;:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nvf.url = "github:notashelf/nvf";
  };

  outputs = {
    self,
    nixpkgs,
    ...
  } @ inputs: {
    packages."x86_64-linux" = {
      default =
        (inputs.nvf.lib.neovimConfiguration {
          modules = [
            {
              config.vim.theme.enable = true;
              config.vim.ui.colorizer = {
                enable = true;
                setupOpts.names = true;
              };
            }
          ];
          inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
        })
        .neovim;
    };
  };
}

it still does not attach to the buffer automatically, I manually have to run :ColorizerAttachToBuffer

NotAShelf commented 3 hours ago

That is unusual, I'll take a look shortly.

Jappie3 commented 2 hours ago

also color highlighting by name (e.g. 'blue', 'green') worked with the first flake example I posted... so either my system config (where it is enabled) is leaking (which could also mean that there's some incompatibility) or something weird is happening...