feat: add hop keybindings

This commit is contained in:
n3oney 2023-05-02 21:58:06 +02:00
parent cd98cc29f1
commit d5eb3e87ed
No known key found for this signature in database
GPG key ID: C786693DE727850E
2 changed files with 12 additions and 12 deletions

View file

@ -5,13 +5,16 @@
}: }:
with lib; let with lib; let
cfg = config.vim.utility.motion.hop; 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 { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = ["hop-nvim"]; vim.startPlugins = ["hop-nvim"];
vim.maps.normal."<leader>h" = { vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";
action = "<cmd> HopPattern<CR>";
};
vim.luaConfigRC.hop-nvim = nvim.dag.entryAnywhere '' vim.luaConfigRC.hop-nvim = nvim.dag.entryAnywhere ''
require('hop').setup() require('hop').setup()

View file

@ -1,13 +1,10 @@
{ {lib, ...}:
config, with lib; {
lib,
pkgs,
...
}:
with lib; let
cfg = config.vim.utility.motion.hop;
in {
options.vim.utility.motion.hop = { options.vim.utility.motion.hop = {
mappings = {
hop = mkMappingOption "Jump to occurences [hop.nvim]" "<leader>h";
};
enable = mkEnableOption "Enable Hop.nvim plugin (easy motion)"; enable = mkEnableOption "Enable Hop.nvim plugin (easy motion)";
}; };
} }