utility/auto-save: init

This commit is contained in:
Venkatesan Ravi 2025-04-05 02:22:30 +00:00
parent 0fc84ed868
commit d00c7d6afb
5 changed files with 41 additions and 0 deletions

View file

@ -301,6 +301,7 @@
- Add more applicable filetypes to illuminate denylist.
- Disable mini.indentscope for applicable filetypes.
- Enable inlay hints support - `config.vim.lsp.inlayHints`.
- Add [`auto-save-nvim`](https://github.com/pocco81/auto-save.nvim).
[tebuevd](https://github.com/tebuevd):

View file

@ -0,0 +1,17 @@
{lib, ...}: let
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) int;
in {
options.vim.auto-save = {
enable = mkEnableOption "auto-save";
setupOpts = mkPluginSetupOption "auto-save" {
debounce_delay = mkOption {
type = int;
# plugin default is 135, adding an option to setupOpts for example
default = 100;
description = "saves the file at most every `debounce_delay` milliseconds";
};
};
};
}

View file

@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.auto-save;
in {
vim.lazy.plugins."auto-save.nvim" = mkIf cfg.enable {
package = pkgs.vimPlugins.auto-save-nvim;
setupModule = "auto-save";
inherit (cfg) setupOpts;
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./auto-save.nix
./config.nix
];
}

View file

@ -1,5 +1,6 @@
{
imports = [
./auto-save
./binds
./ccc
./diffview