init feature fidget.nvim

This commit is contained in:
NotAShelf 2023-02-23 17:19:57 +03:00
commit c559fbf028
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1
6 changed files with 68 additions and 0 deletions

View file

@ -48,6 +48,7 @@ inputs: let
smoothScroll.enable = true;
cellularAutomaton.enable = true;
lspkind.enable = true;
nvim-fidget.enable = true;
indentBlankline = {
enable = true;
fillChar = "";

17
flake.lock generated
View file

@ -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",

View file

@ -289,6 +289,11 @@
flake = false;
};
fidget-nvim = {
url = "github:j-hui/fidget.nvim";
flake = false;
};
# Markdown
glow-nvim = {
url = "github:ellisonleao/glow.nvim";

View file

@ -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));

View file

@ -28,6 +28,10 @@ with lib; {
eolChar = mkDefault "";
showCurrContext = mkDefault true;
};
fidget-nvim = {
enable = mkDefault true;
};
};
};
}

View file

@ -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 ""
}
'';
};
}