feat: add leap.nvim

This commit is contained in:
NotAShelf 2023-04-05 02:14:13 +03:00
commit d6cb8d9aba
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
9 changed files with 108 additions and 2 deletions

View file

@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.vim.utility.motion.leap;
in {
config = mkIf cfg.enable {
vim.startPlugins = [
"leap-nvim"
"vim-repeat"
];
vim.nnoremap = {
"<leader>h" = "<cmd> HopPattern<CR>";
};
vim.luaConfigRC.leap-nvim = nvim.dag.entryAnywhere ''
require('leap').add_default_mappings()
-- TODO: register custom keybinds
-- require('leap').leap {
-- opts = {
-- labels = {}
-- }
-- }
'';
};
}

View file

@ -0,0 +1,8 @@
_: {
imports = [
./leap.nix
./config.nix
];
}

View file

@ -0,0 +1,13 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.vim.utility.motion.leap;
in {
options.vim.utility.motion.leap = {
enable = mkEnableOption "Enable leap.nvim plugin (easy motion)";
};
}