From 95b322a5220744a5cac725e62fa4e612851edbc2 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 15 Sep 2024 17:01:50 -0500 Subject: [PATCH] plugins/helpview: init --- plugins/by-name/helpview/default.nix | 56 +++++++++++++++++++ .../plugins/by-name/helpview/default.nix | 25 +++++++++ 2 files changed, 81 insertions(+) create mode 100644 plugins/by-name/helpview/default.nix create mode 100644 tests/test-sources/plugins/by-name/helpview/default.nix diff --git a/plugins/by-name/helpview/default.nix b/plugins/by-name/helpview/default.nix new file mode 100644 index 00000000..f8168c50 --- /dev/null +++ b/plugins/by-name/helpview/default.nix @@ -0,0 +1,56 @@ +{ + lib, + ... +}: +let + inherit (lib.nixvim) defaultNullOpts; + inherit (lib) types; +in +lib.nixvim.neovim-plugin.mkNeovimPlugin { + name = "helpview"; + originalName = "helpview.nvim"; + package = "helpview-nvim"; + + maintainers = [ lib.maintainers.khaneliman ]; + + description = '' + Decorations for vimdoc/help files in Neovim + + Supports a vast amount of rendering customization. + Refer to the plugin's [documentation](https://github.com/OXY2DEV/helpview.nvim/wiki) for more details. + ''; + + settingsOptions = { + buf_ignore = defaultNullOpts.mkListOf types.str [ ] '' + Buftypes to disable helpview-nvim. + ''; + + mode = + defaultNullOpts.mkListOf types.str + [ + "n" + "c" + ] + '' + Modes where preview is enabled. + ''; + + hybrid_modes = defaultNullOpts.mkListOf types.str null '' + Modes where hybrid mode is enabled. + ''; + + callback = { + on_enable = defaultNullOpts.mkLuaFn null '' + Action to perform when markview is enabled. + ''; + + on_disable = defaultNullOpts.mkLuaFn null '' + Action to perform when markview is disabled. + ''; + + on_mode_change = defaultNullOpts.mkLuaFn null '' + Action to perform when mode is changed, while the plugin is enabled. + ''; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/helpview/default.nix b/tests/test-sources/plugins/by-name/helpview/default.nix new file mode 100644 index 00000000..d8ced103 --- /dev/null +++ b/tests/test-sources/plugins/by-name/helpview/default.nix @@ -0,0 +1,25 @@ +{ + empty = { + plugins.helpview.enable = true; + }; + + defaults = { + plugins.helpview = { + enable = true; + + settings = { + buf_ignore = null; + mode = [ + "n" + "c" + ]; + hybrid_modes = null; + callback = { + on_enable = null; + on_disable = null; + on_mode_change = null; + }; + }; + }; + }; +}