From 4b4423af91d2ba6600752cb64e28dfb8749e5f07 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 19:32:56 +0100 Subject: [PATCH] mini/diff: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/diff/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/diff/default.nix | 6 ++++++ modules/plugins/mini/diff/diff.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/diff/config.nix create mode 100644 modules/plugins/mini/diff/default.nix create mode 100644 modules/plugins/mini/diff/diff.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index ea0f7d50..54ce0492 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -65,6 +65,7 @@ - `mini.colors` - `mini.comment` - `mini.completion` + - `mini.diff` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 86ca362b..37011895 100644 --- a/flake.lock +++ b/flake.lock @@ -1112,6 +1112,22 @@ "type": "github" } }, + "plugin-mini-diff": { + "flake": false, + "locked": { + "lastModified": 1735324663, + "narHash": "sha256-dRvW/1lfVShiHmRU0mQA5g5xDyQ0EVtVLLZ0y6WSedg=", + "owner": "echasnovski", + "repo": "mini.diff", + "rev": "00f072250061ef498f91ed226918c9ec31a416a4", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.diff", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2319,6 +2335,7 @@ "plugin-mini-colors": "plugin-mini-colors", "plugin-mini-comment": "plugin-mini-comment", "plugin-mini-completion": "plugin-mini-completion", + "plugin-mini-diff": "plugin-mini-diff", "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 87b54693..36ca93c5 100644 --- a/flake.nix +++ b/flake.nix @@ -800,5 +800,10 @@ url = "github:echasnovski/mini.completion"; flake = false; }; + + plugin-mini-diff = { + url = "github:echasnovski/mini.diff"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 0564a46a..b8e665bf 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -11,5 +11,6 @@ ./colors ./comment ./completion + ./diff ]; } diff --git a/modules/plugins/mini/diff/config.nix b/modules/plugins/mini/diff/config.nix new file mode 100644 index 00000000..6c5969f6 --- /dev/null +++ b/modules/plugins/mini/diff/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.diff; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-diff"]; + + pluginRC.mini-diff = entryAnywhere '' + require("mini.diff").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/diff/default.nix b/modules/plugins/mini/diff/default.nix new file mode 100644 index 00000000..c77c8c67 --- /dev/null +++ b/modules/plugins/mini/diff/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./diff.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/diff/diff.nix b/modules/plugins/mini/diff/diff.nix new file mode 100644 index 00000000..8438cec9 --- /dev/null +++ b/modules/plugins/mini/diff/diff.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.diff = { + enable = mkEnableOption "mini.diff"; + setupOpts = mkPluginSetupOption "mini.diff" {}; + }; +}