From 2d9f0214307cc6bafb7963227903cc5264837228 Mon Sep 17 00:00:00 2001 From: Heitor Augusto <44377258+HeitorAugustoLN@users.noreply.github.com> Date: Sun, 2 Nov 2025 00:04:21 -0300 Subject: [PATCH] plugins/mini-comment: init --- plugins/by-name/mini-comment/default.nix | 26 ++++++++++++++++ .../plugins/by-name/mini-comment/default.nix | 30 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 plugins/by-name/mini-comment/default.nix create mode 100644 tests/test-sources/plugins/by-name/mini-comment/default.nix diff --git a/plugins/by-name/mini-comment/default.nix b/plugins/by-name/mini-comment/default.nix new file mode 100644 index 00000000..56e4f4c9 --- /dev/null +++ b/plugins/by-name/mini-comment/default.nix @@ -0,0 +1,26 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "mini-comment"; + moduleName = "mini.comment"; + + maintainers = [ lib.maintainers.HeitorAugustoLN ]; + + settingsExample = { + options = { + custom_commentstring = lib.nixvim.nestedLiteralLua "nil"; + ignore_blank_line = false; + start_of_line = false; + pad_comment_parts = true; + }; + mappings = { + comment = "gc"; + comment_line = "gcc"; + comment_visual = "gc"; + textobject = "gc"; + }; + hooks = { + pre = lib.nixvim.nestedLiteralLua "function() end"; + post = lib.nixvim.nestedLiteralLua "function() end"; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/mini-comment/default.nix b/tests/test-sources/plugins/by-name/mini-comment/default.nix new file mode 100644 index 00000000..00ea43ee --- /dev/null +++ b/tests/test-sources/plugins/by-name/mini-comment/default.nix @@ -0,0 +1,30 @@ +{ lib, ... }: +{ + empty = { + plugins.mini-comment.enable = true; + }; + + defaults = { + plugins.mini-comment = { + enable = true; + settings = { + options = { + custom_commentstring = lib.nixvim.mkRaw "nil"; + ignore_blank_line = false; + start_of_line = false; + pad_comment_parts = true; + }; + mappings = { + comment = "gc"; + comment_line = "gcc"; + comment_visual = "gc"; + textobject = "gc"; + }; + hooks = { + pre = lib.nixvim.mkRaw "function() end"; + post = lib.nixvim.mkRaw "function() end"; + }; + }; + }; + }; +}