mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-11 16:05:30 +00:00
Harpoon (branch harpoon2) has been added as a plugin. Set under navigation to allow for more naviation plugins to be added in the future (set telescope under navigation?). Basic options and keybinds are included.
51 lines
1.6 KiB
Nix
51 lines
1.6 KiB
Nix
{
|
|
options,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.lists) optionals;
|
|
inherit (lib.strings) concatStrings;
|
|
inherit (lib.nvim.binds) pushDownDefault mkKeymap;
|
|
|
|
cfg = config.vim.navigation.harpoon;
|
|
|
|
keys = cfg.mappings;
|
|
inherit (options.vim.navigation.harpoon) mappings;
|
|
in {
|
|
config = mkIf cfg.enable {
|
|
vim = {
|
|
startPlugins = ["plenary-nvim"];
|
|
|
|
lazy.plugins.harpoon = {
|
|
package = "harpoon";
|
|
setupModule = "harpoon";
|
|
inherit (cfg) setupOpts;
|
|
|
|
before = ''
|
|
'';
|
|
|
|
after = ''
|
|
local harpoon = require("harpoon")
|
|
harpoon.setup({})
|
|
'';
|
|
|
|
cmd = ["Harpoon"];
|
|
|
|
keys = [
|
|
(mkKeymap "n" keys.markFile "<Cmd>lua require('harpoon'):list():add()<CR>" {desc = mappings.markFile.description;})
|
|
(mkKeymap "n" keys.listMarks "<Cmd>lua require('harpoon').ui:toggle_quick_menu(require('harpoon'):list())<CR>" {desc = mappings.listMarks.description;})
|
|
(mkKeymap "n" keys.file1 "<Cmd>lua require('harpoon'):list():select(1)<CR>" {desc = mappings.file1.description;})
|
|
(mkKeymap "n" keys.file2 "<Cmd>lua require('harpoon'):list():select(2)<CR>" {desc = mappings.file2.description;})
|
|
(mkKeymap "n" keys.file3 "<Cmd>lua require('harpoon'):list():select(3)<CR>" {desc = mappings.file3.description;})
|
|
(mkKeymap "n" keys.file4 "<Cmd>lua require('harpoon'):list():select(4)<CR>" {desc = mappings.file4.description;})
|
|
];
|
|
};
|
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
"<leader>a" = "Harpoon Mark";
|
|
};
|
|
};
|
|
};
|
|
}
|