feat: add leap.nvim

This commit is contained in:
NotAShelf 2023-04-05 02:14:13 +03:00
parent b76eb174f1
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

@ -141,7 +141,10 @@ inputs: let
icon-picker.enable = true;
venn-nvim.enable = false; # FIXME throws an error when its commands are ran manually
diffview-nvim.enable = true;
motion = {
hop.enable = true;
leap.enable = true;
};
};
vim.notes = {

View file

@ -560,6 +560,22 @@
"type": "github"
}
},
"leap-nvim": {
"flake": false,
"locked": {
"lastModified": 1678823512,
"narHash": "sha256-bzmsib8Qr2Whu1FqHzvrsIfSKf/CFutsaM3Sz8gaTLo=",
"owner": "ggandor",
"repo": "leap.nvim",
"rev": "f74473d23ebf60957e0db3ff8172349a82e5a442",
"type": "github"
},
"original": {
"owner": "ggandor",
"repo": "leap.nvim",
"type": "github"
}
},
"lsp-signature": {
"flake": false,
"locked": {
@ -1298,6 +1314,7 @@
"icon-picker-nvim": "icon-picker-nvim",
"indent-blankline": "indent-blankline",
"kommentary": "kommentary",
"leap-nvim": "leap-nvim",
"lsp-signature": "lsp-signature",
"lspkind": "lspkind",
"lspsaga": "lspsaga",
@ -1346,6 +1363,7 @@
"trouble": "trouble",
"venn-nvim": "venn-nvim",
"vim-markdown": "vim-markdown",
"vim-repeat": "vim-repeat",
"vim-startify": "vim-startify",
"vim-vsnip": "vim-vsnip",
"which-key": "which-key",
@ -1641,6 +1659,22 @@
"type": "github"
}
},
"vim-repeat": {
"flake": false,
"locked": {
"lastModified": 1611544268,
"narHash": "sha256-8rfZa3uKXB3TRCqaDHZ6DfzNbm7WaYnLvmTNzYtnKHg=",
"owner": "tpope",
"repo": "vim-repeat",
"rev": "24afe922e6a05891756ecf331f39a1f6743d3d5a",
"type": "github"
},
"original": {
"owner": "tpope",
"repo": "vim-repeat",
"type": "github"
}
},
"vim-startify": {
"flake": false,
"locked": {

View file

@ -401,6 +401,11 @@
flake = false;
};
leap-nvim = {
url = "github:ggandor/leap.nvim";
flake = false;
};
# Note-taking
obsidian-nvim = {
url = "github:epwalsh/obsidian.nvim";
@ -476,5 +481,10 @@
url = "github:MunifTanjim/nui.nvim";
flake = false;
};
vim-repeat = {
url = "github:tpope/vim-repeat";
flake = false;
};
};
}

View file

@ -74,7 +74,9 @@ with lib; let
"todo-comments"
"flutter-tools"
"hop-nvim"
"leap-nvim"
"modes-nvim"
"vim-repeat"
];
# You can either use the name of the plugin or a package.
pluginsType = with types;

View file

@ -2,12 +2,12 @@ _: {
imports = [
./binds
./gestures
./motion
./telescope
./colorizer
./icon-picker
./telescope
./venn
./diffview
./hop
];
}

View file

@ -0,0 +1,6 @@
_: {
imports = [
./hop
./leap
];
}

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)";
};
}