Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visuals/tiny-devicons-auto-colors: init module #451

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/release-notes/rl-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to

[ts-error-translator.nvim]: https://github.com/dmmulroy/ts-error-translator.nvim
[credo]: https://github.com/rrrene/credo
[tiny-devicons-auto-colors]: https://github.com/rachartier/tiny-devicons-auto-colors.nvim

- Add `deno fmt` as the default Markdown formatter. This will be enabled
automatically if you have autoformatting enabled, but can be disabled manually
Expand Down Expand Up @@ -288,6 +289,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
- Add combined nvf configuration (`config.vim`) into the final package's
passthru as `passthru.neovimConfiguration` for easier debugging.

- Add support for [tiny-devicons-auto-colors] under
`vim.visuals.tiny-devicons-auto-colors`

[ppenguin](https://github.com/ppenguin):

- Telescope:
Expand Down
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@
flake = false;
};

plugin-tiny-devicons-auto-colors = {
url = "github:rachartier/tiny-devicons-auto-colors.nvim";
flake = false;
};

plugin-gitsigns-nvim = {
url = "github:lewis6991/gitsigns.nvim";
flake = false;
Expand Down
1 change: 1 addition & 0 deletions modules/plugins/visuals/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ in {
./nvim-cursorline
./nvim-scrollbar
./nvim-web-devicons
./tiny-devicons-auto-colors
];
}
21 changes: 21 additions & 0 deletions modules/plugins/visuals/tiny-devicons-auto-colors/config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;

cfg = config.vim.visuals.tiny-devicons-auto-colors;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["tiny-devicons-auto-colors" "nvim-web-devicons"];

pluginRC.tiny-devicons-auto-colors = entryAnywhere ''
require("tiny-devicons-auto-colors").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./config.nix
./tiny-devicons-auto-colors.nix
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int float;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
options.vim.visuals.tiny-devicons-auto-colors = {
enable = mkEnableOption "alternative nvim-web-devicons icon colors [tiny-devicons-auto-colors]";

setupOpts = mkPluginSetupOption "tiny-devicons-auto-colors" {
factors = {
lightness = mkOption {
type = float;
default = 1.76;
description = "Lightness factor of icons";
};

chroma = mkOption {
type = int;
default = 1;
description = "Chroma factor of icons";
};

hue = mkOption {
type = float;
default = 1.25;
description = "Hue factor of icons";
};

cache = {
enabled = mkEnableOption "caching of icon colors. This will greatly improve performance" // {default = true;};
path = mkOption {
type = luaInline;
default = mkLuaInline "vim.fn.stdpath(\"cache\") .. \"/tiny-devicons-auto-colors-cache.json\"";
description = "Path to the cache file";
};
};
};
};
};
}
Loading