From fca63ede6c94f617ac2edb2539b76c51bf6f87c3 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 20:26:09 +0100 Subject: [PATCH] mini/hipatterns: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/hipatterns/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/hipatterns/default.nix | 6 ++++++ .../plugins/mini/hipatterns/hipatterns.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/hipatterns/config.nix create mode 100644 modules/plugins/mini/hipatterns/default.nix create mode 100644 modules/plugins/mini/hipatterns/hipatterns.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index a2bc984e..25fa9b5f 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -71,6 +71,7 @@ - `mini.files` - `mini.fuzzy` - `mini.git` + - `mini.hipatterns` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 5feff935..1fc26c13 100644 --- a/flake.lock +++ b/flake.lock @@ -1208,6 +1208,22 @@ "type": "github" } }, + "plugin-mini-hipatterns": { + "flake": false, + "locked": { + "lastModified": 1733141274, + "narHash": "sha256-zJ8OMzfcBh9NtSg2FHDjB5DFX9C2qZRo8t8lc097sCI=", + "owner": "echasnovski", + "repo": "mini.hipatterns", + "rev": "f34975103a38b3f608219a1324cdfc58ea660b8b", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.hipatterns", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2421,6 +2437,7 @@ "plugin-mini-files": "plugin-mini-files", "plugin-mini-fuzzy": "plugin-mini-fuzzy", "plugin-mini-git": "plugin-mini-git", + "plugin-mini-hipatterns": "plugin-mini-hipatterns", "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 519fc5dd..c2bc4ade 100644 --- a/flake.nix +++ b/flake.nix @@ -830,5 +830,10 @@ url = "github:echasnovski/mini-git"; flake = false; }; + + plugin-mini-hipatterns = { + url = "github:echasnovski/mini.hipatterns"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index df37de8e..bc18dbbc 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -17,5 +17,6 @@ ./files ./fuzzy ./git + ./hipatterns ]; } diff --git a/modules/plugins/mini/hipatterns/config.nix b/modules/plugins/mini/hipatterns/config.nix new file mode 100644 index 00000000..37876778 --- /dev/null +++ b/modules/plugins/mini/hipatterns/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.hipatterns; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-hipatterns"]; + + pluginRC.mini-hipatterns = entryAnywhere '' + require("mini.hipatterns").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/hipatterns/default.nix b/modules/plugins/mini/hipatterns/default.nix new file mode 100644 index 00000000..29cd9d7f --- /dev/null +++ b/modules/plugins/mini/hipatterns/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./hipatterns.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/hipatterns/hipatterns.nix b/modules/plugins/mini/hipatterns/hipatterns.nix new file mode 100644 index 00000000..31921a89 --- /dev/null +++ b/modules/plugins/mini/hipatterns/hipatterns.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.hipatterns = { + enable = mkEnableOption "mini.hipatterns"; + setupOpts = mkPluginSetupOption "mini.hipatterns" {}; + }; +}