From 226c25d45dce4ebc1c8b285b8e6bd74e9bbc9083 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 21:03:56 +0100 Subject: [PATCH] mini/pairs: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/pairs/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/pairs/default.nix | 6 ++++++ modules/plugins/mini/pairs/pairs.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/pairs/config.nix create mode 100644 modules/plugins/mini/pairs/default.nix create mode 100644 modules/plugins/mini/pairs/pairs.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 59c11377..003c2639 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -82,6 +82,7 @@ - `mini.move` - `mini.notify` - `mini.operators` + - `mini.pairs` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 28e25927..2f01ce02 100644 --- a/flake.lock +++ b/flake.lock @@ -1384,6 +1384,22 @@ "type": "github" } }, + "plugin-mini-pairs": { + "flake": false, + "locked": { + "lastModified": 1728656795, + "narHash": "sha256-PtHxLKU1smVTx655r5SINxuz5CJmZWnBW70T8zJ/oxM=", + "owner": "echasnovski", + "repo": "mini.pairs", + "rev": "7e834c5937d95364cc1740e20d673afe2d034cdb", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.pairs", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2608,6 +2624,7 @@ "plugin-mini-move": "plugin-mini-move", "plugin-mini-notify": "plugin-mini-notify", "plugin-mini-operators": "plugin-mini-operators", + "plugin-mini-pairs": "plugin-mini-pairs", "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 f5ea0e15..01836677 100644 --- a/flake.nix +++ b/flake.nix @@ -885,5 +885,10 @@ url = "github:echasnovski/mini.operators"; flake = false; }; + + plugin-mini-pairs = { + url = "github:echasnovski/mini.pairs"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 0ed41e59..161ae000 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -28,5 +28,6 @@ ./move ./notify ./operators + ./pairs ]; } diff --git a/modules/plugins/mini/pairs/config.nix b/modules/plugins/mini/pairs/config.nix new file mode 100644 index 00000000..ce02dee0 --- /dev/null +++ b/modules/plugins/mini/pairs/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.pairs; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-pairs"]; + + pluginRC.mini-pairs = entryAnywhere '' + require("mini.pairs").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/pairs/default.nix b/modules/plugins/mini/pairs/default.nix new file mode 100644 index 00000000..a0563bb0 --- /dev/null +++ b/modules/plugins/mini/pairs/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./pairs.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/pairs/pairs.nix b/modules/plugins/mini/pairs/pairs.nix new file mode 100644 index 00000000..db43027b --- /dev/null +++ b/modules/plugins/mini/pairs/pairs.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.pairs = { + enable = mkEnableOption "mini.pairs"; + setupOpts = mkPluginSetupOption "mini.pairs" {}; + }; +}