install and setup harpoon

This commit is contained in:
♥ Minnie ♥ 2025-06-24 20:51:02 +08:00
parent 4a6499f52c
commit df5f771f07
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
3 changed files with 113 additions and 20 deletions

View file

@ -20,6 +20,7 @@
# Editor plugins and configurations # Editor plugins and configurations
./plugins/editor/buffers.nix ./plugins/editor/buffers.nix
./plugins/editor/commentary.nix ./plugins/editor/commentary.nix
./plugins/editor/harpoon.nix
./plugins/editor/mini.nix ./plugins/editor/mini.nix
./plugins/editor/sessions.nix ./plugins/editor/sessions.nix
./plugins/editor/smart-splits.nix ./plugins/editor/smart-splits.nix

View file

@ -0,0 +1,112 @@
{pkgs, ...}:{
plugins.harpoon = {
enable = true;
};
keymaps = [
{
mode = ["n"];
key = "<leader>h";
action = "<NOP>";
options = {
desc = "+harpoon";
};
}
{
mode = ["n"];
key = "<leader>ha";
action = {
__raw = "function() require'harpoon':list():add() end";
};
options = {
desc = "Harpoon Add";
silent = true;
};
}
{
mode = ["n"];
key = "]h";
action = {
__raw = "function() require'harpoon':list():next() end";
};
options = {
desc = "Harpoon Next Mark";
silent = true;
};
}
{
mode = ["n"];
key = "[h";
action = {
__raw = "function() require'harpoon':list():prev() end";
};
options = {
desc = "Harpoon Previous Mark";
silent = true;
};
}
{
mode = ["n"];
key = "<leader>h1";
action = {
__raw = "function() require'harpoon':list():select(1) end";
};
options = {
desc = "Harpoon Mark 1";
silent = true;
};
}
{
mode = ["n"];
key = "<leader>h2";
action = {
__raw = "function() require'harpoon':list():select(2) end";
};
options = {
desc = "Harpoon Mark 2";
silent = true;
};
}
{
mode = ["n"];
key = "<leader>h3";
action = {
__raw = "function() require'harpoon':list():select(3) end";
};
options = {
desc = "Harpoon Mark 3";
silent = true;
};
}
{
mode = ["n"];
key = "<leader>h4";
action = {
__raw = "function() require'harpoon':list():select(4) end";
};
options = {
desc = "Harpoon Mark 4";
silent = true;
};
}
{
mode = ["n"];
key = "<leader>hm";
action = {
__raw = "function() require'harpoon'.ui:toggle_quick_menu(require'harpoon':list()) end";
};
options = {
desc = "Harpoon Menu";
silent = true;
};
}
];
}

View file

@ -63,25 +63,5 @@
desc = "View Blame"; desc = "View Blame";
}; };
} }
{
mode = ["n"];
key = "[h";
action = "<cmd>Gitsigns prev_hunk<cr>";
options = {
silent = true;
desc = "Goto Previous Hunk";
};
}
{
mode = ["n"];
key = "]h";
action = "<cmd>Gitsigns next_hunk<cr>";
options = {
silent = true;
desc = "Goto Next Hunk";
};
}
]; ];
} }