From be7d94960538ebb5a0d89dec0b6db841ef435ee9 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 20:35:56 +0100 Subject: [PATCH] mini/indentscope: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/indentscope/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/indentscope/default.nix | 6 ++++++ .../plugins/mini/indentscope/indentscope.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/indentscope/config.nix create mode 100644 modules/plugins/mini/indentscope/default.nix create mode 100644 modules/plugins/mini/indentscope/indentscope.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index e9c1300d..b87f6431 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -74,6 +74,7 @@ - `mini.hipatterns` - `mini.hues` - `mini.icons` + - `mini.indentscope` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 13ed65d9..a8d4c17d 100644 --- a/flake.lock +++ b/flake.lock @@ -1256,6 +1256,22 @@ "type": "github" } }, + "plugin-mini-indentscope": { + "flake": false, + "locked": { + "lastModified": 1737036220, + "narHash": "sha256-Mrzc7oHXxyEGqdE003qiC9unScyb7i5A6+l8Do7yxws=", + "owner": "echasnovski", + "repo": "mini.indentscope", + "rev": "613df2830d7faeae7483ba2e736683154b95921e", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.indentscope", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2472,6 +2488,7 @@ "plugin-mini-hipatterns": "plugin-mini-hipatterns", "plugin-mini-hues": "plugin-mini-hues", "plugin-mini-icons": "plugin-mini-icons", + "plugin-mini-indentscope": "plugin-mini-indentscope", "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 cb820687..cefd3a24 100644 --- a/flake.nix +++ b/flake.nix @@ -845,5 +845,10 @@ url = "github:echasnovski/mini.icons"; flake = false; }; + + plugin-mini-indentscope = { + url = "github:echasnovski/mini.indentscope"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 23b12820..73ff0951 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -20,5 +20,6 @@ ./hipatterns ./hues ./icons + ./indentscope ]; } diff --git a/modules/plugins/mini/indentscope/config.nix b/modules/plugins/mini/indentscope/config.nix new file mode 100644 index 00000000..2e6ec03d --- /dev/null +++ b/modules/plugins/mini/indentscope/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.indentscope; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-indentscope"]; + + pluginRC.mini-indentscope = entryAnywhere '' + require("mini.indentscope").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/indentscope/default.nix b/modules/plugins/mini/indentscope/default.nix new file mode 100644 index 00000000..487c248c --- /dev/null +++ b/modules/plugins/mini/indentscope/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./indentscope.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/indentscope/indentscope.nix b/modules/plugins/mini/indentscope/indentscope.nix new file mode 100644 index 00000000..8307a88c --- /dev/null +++ b/modules/plugins/mini/indentscope/indentscope.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.indentscope = { + enable = mkEnableOption "mini.indentscope"; + setupOpts = mkPluginSetupOption "mini.indentscope" {}; + }; +}