Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
17 changes: 17 additions & 0 deletions modules/plugins/utility/auto-save/auto-save.nix
Original file line number Diff line number Diff line change
@@ -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";
};
};
};
}
16 changes: 16 additions & 0 deletions modules/plugins/utility/auto-save/config.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
6 changes: 6 additions & 0 deletions modules/plugins/utility/auto-save/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./auto-save.nix
./config.nix
];
}
1 change: 1 addition & 0 deletions modules/plugins/utility/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
imports = [
./auto-save
./binds
./ccc
./diffview
Expand Down