diff --git a/modules/utility/motion/hop/config.nix b/modules/utility/motion/hop/config.nix index b2b1a8e..a5aa92c 100644 --- a/modules/utility/motion/hop/config.nix +++ b/modules/utility/motion/hop/config.nix @@ -5,13 +5,16 @@ }: with lib; let cfg = config.vim.utility.motion.hop; + + self = import ./hop.nix {inherit lib;}; + + mappingDefinitions = self.options.vim.utility.motion.hop.mappings; + mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; in { config = mkIf cfg.enable { vim.startPlugins = ["hop-nvim"]; - vim.maps.normal."h" = { - action = " HopPattern"; - }; + vim.maps.normal = mkSetBinding mappings.hop " HopPattern"; vim.luaConfigRC.hop-nvim = nvim.dag.entryAnywhere '' require('hop').setup() diff --git a/modules/utility/motion/hop/hop.nix b/modules/utility/motion/hop/hop.nix index d3e3c2f..c57dc7a 100644 --- a/modules/utility/motion/hop/hop.nix +++ b/modules/utility/motion/hop/hop.nix @@ -1,13 +1,10 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.vim.utility.motion.hop; -in { +{lib, ...}: +with lib; { options.vim.utility.motion.hop = { + mappings = { + hop = mkMappingOption "Jump to occurences [hop.nvim]" "h"; + }; + enable = mkEnableOption "Enable Hop.nvim plugin (easy motion)"; }; }