From 8809ecd689071dc2eb39aebd45ea3576fd0360e4 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 21:18:42 +0100 Subject: [PATCH] mini/surround: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/surround/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/surround/default.nix | 6 ++++++ modules/plugins/mini/surround/surround.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/surround/config.nix create mode 100644 modules/plugins/mini/surround/default.nix create mode 100644 modules/plugins/mini/surround/surround.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 54ff3b0c..0c38c1ad 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -89,6 +89,7 @@ - `mini.splitjoin` - `mini.starter` - `mini.statusline` + - `mini.surround` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index cd751c01..3c754e31 100644 --- a/flake.lock +++ b/flake.lock @@ -1496,6 +1496,22 @@ "type": "github" } }, + "plugin-mini-surround": { + "flake": false, + "locked": { + "lastModified": 1733662812, + "narHash": "sha256-okWJlG0KOdg1ShvkIIMnPSoOzGd7K84eDcp5kx6eVP8=", + "owner": "echasnovski", + "repo": "mini.surround", + "rev": "aa5e245829dd12d8ff0c96ef11da28681d6049aa", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.surround", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2727,6 +2743,7 @@ "plugin-mini-splitjoin": "plugin-mini-splitjoin", "plugin-mini-starter": "plugin-mini-starter", "plugin-mini-statusline": "plugin-mini-statusline", + "plugin-mini-surround": "plugin-mini-surround", "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 83a9d88a..0c030c5f 100644 --- a/flake.nix +++ b/flake.nix @@ -920,5 +920,10 @@ url = "github:echasnovski/mini.statusline"; flake = false; }; + + plugin-mini-surround = { + url = "github:echasnovski/mini.surround"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index d68660fd..0acb6344 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -35,5 +35,6 @@ ./splitjoin ./starter ./statusline + ./surround ]; } diff --git a/modules/plugins/mini/surround/config.nix b/modules/plugins/mini/surround/config.nix new file mode 100644 index 00000000..a0264685 --- /dev/null +++ b/modules/plugins/mini/surround/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.surround; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-surround"]; + + pluginRC.mini-surround = entryAnywhere '' + require("mini.surround").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/surround/default.nix b/modules/plugins/mini/surround/default.nix new file mode 100644 index 00000000..95d7a2f5 --- /dev/null +++ b/modules/plugins/mini/surround/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./surround.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/surround/surround.nix b/modules/plugins/mini/surround/surround.nix new file mode 100644 index 00000000..f4c1c199 --- /dev/null +++ b/modules/plugins/mini/surround/surround.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.surround = { + enable = mkEnableOption "mini.surround"; + setupOpts = mkPluginSetupOption "mini.surround" {}; + }; +}