From db7aa9416138129357e9f9c113f747cbec4fe7eb Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 28 Feb 2023 13:00:38 +0300 Subject: [PATCH] feat: add fidget.nvim to visual plugins --- extra.nix | 1 + lib/types-plugin.nix | 1 + modules/visuals/config.nix | 17 +++++++++++++++++ modules/visuals/visuals.nix | 21 +++++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/extra.nix b/extra.nix index fdaca8d..af04257 100644 --- a/extra.nix +++ b/extra.nix @@ -47,6 +47,7 @@ inputs: let scrollBar.enable = true; smoothScroll.enable = true; cellularAutomaton.enable = true; + fidget-nvim.enable = true; lspkind.enable = true; indentBlankline = { enable = true; diff --git a/lib/types-plugin.nix b/lib/types-plugin.nix index 646f4eb..7e863f8 100644 --- a/lib/types-plugin.nix +++ b/lib/types-plugin.nix @@ -69,6 +69,7 @@ with lib; let "comment-nvim" "kommentary" "mind-nvim" + "fidget-nvim" ]; # You can either use the name of the plugin or a package. pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package)); diff --git a/modules/visuals/config.nix b/modules/visuals/config.nix index 1835d46..b1824fa 100644 --- a/modules/visuals/config.nix +++ b/modules/visuals/config.nix @@ -44,6 +44,11 @@ in { then "cellular-automaton" else null ) + ( + if cfg.fidget-nvim.enable + then "fidget-nvim" + else null + ) ]; vim.luaConfigRC.visuals = nvim.dag.entryAnywhere '' @@ -135,6 +140,18 @@ in { '' else "" } + ${ + if cfg.fidget-nvim.enable + then '' + require"fidget".setup{ + align = { + bottom = ${boolToString cfg.fidget-nvim.align.bottom}, + right = ${boolToString cfg.fidget-nvim.align.right}, + } + } + '' + else "" + } ''; }; } diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index 6b3a121..43e48df 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -45,6 +45,27 @@ in { default = false; }; + fidget-nvim = { + enable = mkOption { + type = types.bool; + description = "enable nvim LSP UI element [fidget-nvim]"; + default = false; + }; + align = { + bottom = mkOption { + type = types.bool; + description = "align to bottom"; + default = true; + }; + + right = mkOption { + type = types.bool; + description = "align to right"; + default = true; + }; + }; + }; + cursorWordline = { enable = mkOption { type = types.bool;