diff --git a/config/default.nix b/config/default.nix index 98a962d..848ef95 100644 --- a/config/default.nix +++ b/config/default.nix @@ -20,6 +20,7 @@ # Editor plugins and configurations ./plugins/editor/buffers.nix ./plugins/editor/commentary.nix + ./plugins/editor/harpoon.nix ./plugins/editor/mini.nix ./plugins/editor/sessions.nix ./plugins/editor/smart-splits.nix diff --git a/config/plugins/editor/harpoon.nix b/config/plugins/editor/harpoon.nix new file mode 100644 index 0000000..a3b9d35 --- /dev/null +++ b/config/plugins/editor/harpoon.nix @@ -0,0 +1,112 @@ +{pkgs, ...}:{ + plugins.harpoon = { + enable = true; + }; + + keymaps = [ + { + mode = ["n"]; + key = "h"; + action = ""; + options = { + desc = "+harpoon"; + }; + } + + { + mode = ["n"]; + key = "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 = "h1"; + action = { + __raw = "function() require'harpoon':list():select(1) end"; + }; + options = { + desc = "Harpoon Mark 1"; + silent = true; + }; + } + + { + mode = ["n"]; + key = "h2"; + action = { + __raw = "function() require'harpoon':list():select(2) end"; + }; + options = { + desc = "Harpoon Mark 2"; + silent = true; + }; + } + + { + mode = ["n"]; + key = "h3"; + action = { + __raw = "function() require'harpoon':list():select(3) end"; + }; + options = { + desc = "Harpoon Mark 3"; + silent = true; + }; + } + + { + mode = ["n"]; + key = "h4"; + action = { + __raw = "function() require'harpoon':list():select(4) end"; + }; + options = { + desc = "Harpoon Mark 4"; + silent = true; + }; + } + + { + mode = ["n"]; + key = "hm"; + action = { + __raw = "function() require'harpoon'.ui:toggle_quick_menu(require'harpoon':list()) end"; + }; + options = { + desc = "Harpoon Menu"; + silent = true; + }; + } + ]; +} diff --git a/config/plugins/git/gitsigns.nix b/config/plugins/git/gitsigns.nix index 1ad36e3..0f363af 100644 --- a/config/plugins/git/gitsigns.nix +++ b/config/plugins/git/gitsigns.nix @@ -63,25 +63,5 @@ desc = "View Blame"; }; } - - { - mode = ["n"]; - key = "[h"; - action = "Gitsigns prev_hunk"; - options = { - silent = true; - desc = "Goto Previous Hunk"; - }; - } - - { - mode = ["n"]; - key = "]h"; - action = "Gitsigns next_hunk"; - options = { - silent = true; - desc = "Goto Next Hunk"; - }; - } ]; }