diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index d15e5609..59c11377 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -81,6 +81,7 @@ - `mini.misc` - `mini.move` - `mini.notify` + - `mini.operators` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 6a35b799..28e25927 100644 --- a/flake.lock +++ b/flake.lock @@ -1368,6 +1368,22 @@ "type": "github" } }, + "plugin-mini-operators": { + "flake": false, + "locked": { + "lastModified": 1731776514, + "narHash": "sha256-+Zhy0AhuMPSHnM6dqbV45Aa7dS7XJ4mpfcHApSbuy8A=", + "owner": "echasnovski", + "repo": "mini.operators", + "rev": "7cb4dc66c51a3d736d347bbc517dc73dc7d28888", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.operators", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2591,6 +2607,7 @@ "plugin-mini-misc": "plugin-mini-misc", "plugin-mini-move": "plugin-mini-move", "plugin-mini-notify": "plugin-mini-notify", + "plugin-mini-operators": "plugin-mini-operators", "plugin-minimap-vim": "plugin-minimap-vim", "plugin-modes-nvim": "plugin-modes-nvim", "plugin-neo-tree-nvim": "plugin-neo-tree-nvim", diff --git a/flake.nix b/flake.nix index 368fc4f7..f5ea0e15 100644 --- a/flake.nix +++ b/flake.nix @@ -880,5 +880,10 @@ url = "github:echasnovski/mini.notify"; flake = false; }; + + plugin-mini-operators = { + url = "github:echasnovski/mini.operators"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 315d3b0c..0ed41e59 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -27,5 +27,6 @@ ./misc ./move ./notify + ./operators ]; } diff --git a/modules/plugins/mini/operators/config.nix b/modules/plugins/mini/operators/config.nix new file mode 100644 index 00000000..bb374377 --- /dev/null +++ b/modules/plugins/mini/operators/config.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.mini.operators; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-operators"]; + + pluginRC.mini-operators = entryAnywhere '' + require("mini.operators").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/operators/default.nix b/modules/plugins/mini/operators/default.nix new file mode 100644 index 00000000..1c77bc65 --- /dev/null +++ b/modules/plugins/mini/operators/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./operators.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/operators/operators.nix b/modules/plugins/mini/operators/operators.nix new file mode 100644 index 00000000..c60ad6b5 --- /dev/null +++ b/modules/plugins/mini/operators/operators.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.operators = { + enable = mkEnableOption "mini.operators"; + setupOpts = mkPluginSetupOption "mini.operators" {}; + }; +}