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
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."<leader>h" = {
action = "<cmd> HopPattern<CR>";
};
vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";
vim.luaConfigRC.hop-nvim = nvim.dag.entryAnywhere ''
require('hop').setup()

View file

@ -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]" "<leader>h";
};
enable = mkEnableOption "Enable Hop.nvim plugin (easy motion)";
};
}