mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
feat: add hop keybindings
This commit is contained in:
parent
cd98cc29f1
commit
d5eb3e87ed
2 changed files with 12 additions and 12 deletions
|
@ -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()
|
||||||
|
|
|
@ -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)";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue