diff --git a/extra.nix b/extra.nix index fdaca8d8..40af2bc8 100644 --- a/extra.nix +++ b/extra.nix @@ -48,6 +48,7 @@ inputs: let smoothScroll.enable = true; cellularAutomaton.enable = true; lspkind.enable = true; + nvim-fidget.enable = true; indentBlankline = { enable = true; fillChar = ""; diff --git a/flake.lock b/flake.lock index 5b539cee..a96a1e84 100644 --- a/flake.lock +++ b/flake.lock @@ -305,6 +305,22 @@ "type": "github" } }, + "fidget-nvim": { + "flake": false, + "locked": { + "lastModified": 1676661245, + "narHash": "sha256-f49AwromG0rHZ5i1q4i6GJgLNtusa8QpciljL0dgSJo=", + "owner": "j-hui", + "repo": "fidget.nvim", + "rev": "688b4fec4517650e29c3e63cfbb6e498b3112ba1", + "type": "github" + }, + "original": { + "owner": "j-hui", + "repo": "fidget.nvim", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -1082,6 +1098,7 @@ "crates-nvim": "crates-nvim", "dashboard-nvim": "dashboard-nvim", "dressing-nvim": "dressing-nvim", + "fidget-nvim": "fidget-nvim", "flake-parts": "flake-parts", "flake-utils": "flake-utils", "gesture-nvim": "gesture-nvim", diff --git a/flake.nix b/flake.nix index 36a224f9..778509b9 100644 --- a/flake.nix +++ b/flake.nix @@ -289,6 +289,11 @@ flake = false; }; + fidget-nvim = { + url = "github:j-hui/fidget.nvim"; + flake = false; + }; + # Markdown glow-nvim = { url = "github:ellisonleao/glow.nvim"; diff --git a/lib/types-plugin.nix b/lib/types-plugin.nix index 646f4eb8..7e863f8f 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 7231c86e..6fd532df 100644 --- a/modules/visuals/config.nix +++ b/modules/visuals/config.nix @@ -28,6 +28,10 @@ with lib; { eolChar = mkDefault "↴"; showCurrContext = mkDefault true; }; + + fidget-nvim = { + enable = mkDefault true; + }; }; }; } diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index a186378c..b5aa3349 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -52,6 +52,12 @@ in { }; }; + fidget-nvim.enable = { + type = types.bool; + description = "a UI for nvim-lsp's progress handler"; + default = true; + }; + indentBlankline = { enable = mkOption { type = types.bool; @@ -119,6 +125,11 @@ in { then "cellular-automaton" else null ) + ( + if cfg.fidget-nvim.enable + then "fidget-nvim" + else null + ) ]; vim.luaConfigRC.visuals = nvim.dag.entryAnywhere '' @@ -210,6 +221,35 @@ in { '' else "" } + ${ + if cfg.fidget-nvim.enable + then '' + -- TODO: make those configurable + require"fidget".setup{ + text = { + spinner = "pipe", -- animation shown when tasks are ongoing + done = "✔", -- character shown when all tasks are complete + commenced = "Started", -- message shown when task starts + completed = "Completed", -- message shown when task completes + }, + align = { + bottom = true, -- align fidgets along bottom edge of buffer + right = true, -- align fidgets along right edge of buffer + }, + timer = { + spinner_rate = 125, -- frame rate of spinner animation, in ms + fidget_decay = 2000, -- how long to keep around empty fidget, in ms + task_decay = 1000, -- how long to keep around completed task, in ms + }, + window = { + relative = "win", -- where to anchor, either "win" or "editor" + blend = 100, -- &winblend for the window + zindex = nil, -- the zindex value for the window + border = "none", -- style of border for the fidget window + }, + '' + else "" + } ''; }; }