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

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