From 52bc5f23ee4851a5d4c51d21c6e12972954e370a Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 21:12:03 +0100 Subject: [PATCH] mini/splitjoin: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/splitjoin/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/splitjoin/default.nix | 6 ++++++ modules/plugins/mini/splitjoin/splitjoin.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/splitjoin/config.nix create mode 100644 modules/plugins/mini/splitjoin/default.nix create mode 100644 modules/plugins/mini/splitjoin/splitjoin.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 7d8d29a5..eb019afa 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -86,6 +86,7 @@ - `mini.pick` - `mini.sessions` - `mini.snippets` + - `mini.splitjoin` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index bd5abc35..b74f5905 100644 --- a/flake.lock +++ b/flake.lock @@ -1448,6 +1448,22 @@ "type": "github" } }, + "plugin-mini-splitjoin": { + "flake": false, + "locked": { + "lastModified": 1719822504, + "narHash": "sha256-LDIbh5KfupTI4zkYOlLmVCd3DuZRhx5lTASN53VG34g=", + "owner": "echasnovski", + "repo": "mini.splitjoin", + "rev": "3e92f6764e770ba392325cad3a4497adcada695f", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.splitjoin", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2676,6 +2692,7 @@ "plugin-mini-pick": "plugin-mini-pick", "plugin-mini-sessions": "plugin-mini-sessions", "plugin-mini-snippets": "plugin-mini-snippets", + "plugin-mini-splitjoin": "plugin-mini-splitjoin", "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 742ed211..be51c405 100644 --- a/flake.nix +++ b/flake.nix @@ -905,5 +905,10 @@ url = "github:echasnovski/mini.snippets"; flake = false; }; + + plugin-mini-splitjoin = { + url = "github:echasnovski/mini.splitjoin"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index aab04a89..92bd13ce 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -32,5 +32,6 @@ ./pick ./sessions ./snippets + ./splitjoin ]; } diff --git a/modules/plugins/mini/splitjoin/config.nix b/modules/plugins/mini/splitjoin/config.nix new file mode 100644 index 00000000..b4b93f3f --- /dev/null +++ b/modules/plugins/mini/splitjoin/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.splitjoin; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-splitjoin"]; + + pluginRC.mini-splitjoin = entryAnywhere '' + require("mini.splitjoin").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/splitjoin/default.nix b/modules/plugins/mini/splitjoin/default.nix new file mode 100644 index 00000000..0560f936 --- /dev/null +++ b/modules/plugins/mini/splitjoin/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./splitjoin.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/splitjoin/splitjoin.nix b/modules/plugins/mini/splitjoin/splitjoin.nix new file mode 100644 index 00000000..ae4f9420 --- /dev/null +++ b/modules/plugins/mini/splitjoin/splitjoin.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.splitjoin = { + enable = mkEnableOption "mini.splitjoin"; + setupOpts = mkPluginSetupOption "mini.splitjoin" {}; + }; +}