From debeefec8fd735a6f975c4270aa5b9970706894a Mon Sep 17 00:00:00 2001 From: 434b <17012133+0xricksanchez@users.noreply.github.com> Date: Sun, 16 Apr 2023 12:49:33 +0200 Subject: [PATCH] feat: add harpoon (#140) --- lua/astrocommunity/motion/harpoon/README.md | 5 +++ lua/astrocommunity/motion/harpoon/harpoon.lua | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lua/astrocommunity/motion/harpoon/README.md create mode 100644 lua/astrocommunity/motion/harpoon/harpoon.lua diff --git a/lua/astrocommunity/motion/harpoon/README.md b/lua/astrocommunity/motion/harpoon/README.md new file mode 100644 index 000000000..af3807696 --- /dev/null +++ b/lua/astrocommunity/motion/harpoon/README.md @@ -0,0 +1,5 @@ +# Harpoon + +**Repository:** + +Getting you where you want with the fewest keystrokes. diff --git a/lua/astrocommunity/motion/harpoon/harpoon.lua b/lua/astrocommunity/motion/harpoon/harpoon.lua new file mode 100644 index 000000000..bce4667f6 --- /dev/null +++ b/lua/astrocommunity/motion/harpoon/harpoon.lua @@ -0,0 +1,33 @@ +local prefix = "" +return { + "ThePrimeagen/harpoon", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + }, + cmd = { "Harpoon" }, + keys = { + { prefix, desc = "Harpoon" }, + { prefix .. "a", function() require("harpoon.mark").add_file() end, desc = "Add file" }, + { prefix .. "e", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Toggle quick menu" }, + { prefix .. "h", function() require("harpoon.ui").nav_next() end, desc = "Goto previous mark" }, + { prefix .. "l", function() require("harpoon.ui").nav_prev() end, desc = "Goto next mark" }, + { prefix .. "m", "Telescope harpoon marks", desc = "Show marks in Telescope" }, + { + prefix .. "t", + function() + local num = tonumber(vim.fn.input "GoTo terminal window number: ") + require("harpoon.term").gotoTerminal(num) + end, + desc = "Goto to terminal window", + }, + { + prefix .. "j", + function() + local num = tonumber(vim.fn.input "GoTo Tmux window number: ") + require("harpoon.tmux").gotoTerminal(num) + end, + desc = "Goto to TMUX tmux window", + }, + }, +}