mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +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
|
||||
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()
|
||||
|
|
|
@ -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)";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue