From ed2ce4bd0241c1e24e53bc3465517a4823492569 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 16 Mar 2025 20:11:11 +0300 Subject: [PATCH] modules: clean up descriptions for colorizer & surround; add lazyload events to surround --- modules/plugins/ui/colorizer/colorizer.nix | 20 +++++++++++-------- modules/plugins/utility/surround/config.nix | 3 ++- modules/plugins/utility/surround/surround.nix | 14 +++++++++---- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/modules/plugins/ui/colorizer/colorizer.nix b/modules/plugins/ui/colorizer/colorizer.nix index 313097e7..1cee089f 100644 --- a/modules/plugins/ui/colorizer/colorizer.nix +++ b/modules/plugins/ui/colorizer/colorizer.nix @@ -102,11 +102,7 @@ in { setupOpts = mkPluginSetupOption "colorizer" { filetypes = mkOption { - description = '' - Filetypes to enable on and their option overrides. - - "*" means enable on all filetypes. Filetypes prefixed with "!" are disabled. - ''; + type = attrsOf settingSubmodule; default = {}; example = { "*" = {}; @@ -115,13 +111,21 @@ in { AARRGGBB = false; }; }; - type = attrsOf settingSubmodule; + description = '' + Filetypes to enable on and their option overrides. + + `"*"` means enable on all filetypes. Filetypes prefixed with `"!"` are disabled. + ''; }; user_default_options = mkOption { - description = "Default options"; - default = {}; type = settingSubmodule; + default = {}; + description = '' + `user_default_options` is the second parameter to nvim-colorizer's setup function. + + Anything set here is the inverse of the previous setup configuration. + ''; }; }; }; diff --git a/modules/plugins/utility/surround/config.nix b/modules/plugins/utility/surround/config.nix index 31b4033d..63a1f8d7 100644 --- a/modules/plugins/utility/surround/config.nix +++ b/modules/plugins/utility/surround/config.nix @@ -14,10 +14,11 @@ in { vim = { lazy.plugins.nvim-surround = { package = "nvim-surround"; - setupModule = "nvim-surround"; inherit (cfg) setupOpts; + event = ["BufReadPre" "BufNewFile"]; + keys = [ (mkLznKey "i" cfg.setupOpts.keymaps.insert) (mkLznKey "i" cfg.setupOpts.keymaps.insert_line) diff --git a/modules/plugins/utility/surround/surround.nix b/modules/plugins/utility/surround/surround.nix index 96ff5efb..475c283f 100644 --- a/modules/plugins/utility/surround/surround.nix +++ b/modules/plugins/utility/surround/surround.nix @@ -37,9 +37,13 @@ in { type = bool; default = false; description = '' - nvim-surround: add/change/delete surrounding delimiter pairs with ease. - Note that the default mappings deviate from upstream to avoid conflicts - with nvim-leap. + Whether to enable nvim-surround, Neovim plugin to add/change/delete + surrounding delimiter pairs with ease. + + ::: {.note} + The default mappings deviate from upstream to avoid conflicts with nvim-leap. + You may change thsoe in your configuration if you do not use nvim-leap + ::: ''; }; setupOpts = mkPluginSetupOption "nvim-surround" { @@ -61,7 +65,9 @@ in { useVendoredKeybindings = mkOption { type = bool; default = true; - description = "Use alternative set of keybindings that avoids conflicts with other popular plugins, e.g. nvim-leap"; + description = '' + Use alternative set of keybindings that avoids conflicts with other popular plugins, e.g. nvim-leap + ''; }; }; }