remove items from harpoon using dropdown menu

This commit is contained in:
2024-03-23 17:11:00 -04:00
parent e385d07117
commit 679708c6a3

View File

@ -28,21 +28,25 @@ function M.switcher()
end)
-- remove harpoon item
-- TODO:
-- select items, and open buffer
vim.keymap.set("n", "<C-v>", function()
vim.keymap.set("i", "<C-a>", function()
if action_state.get_selected_entry() then
actions.close(prompt_bufnr)
vim.cmd("vsplit "..action_state.get_selected_entry()[1])
for i, v in ipairs(filepaths) do
if v == action_state.get_selected_entry()[1] then
harpoon:list():removeAt(i)
actions.close(prompt_bufnr)
M.switcher()
end
end
end
end)
vim.keymap.set({ "n", "i" }, "<C-s>", function()
-- select items, and open buffer
vim.keymap.set("i", "<C-s>", function()
if action_state.get_selected_entry() then
actions.close(prompt_bufnr)
vim.cmd("split "..action_state.get_selected_entry()[1])
end
end)
end, { buffer = true, remap = true })
actions.select_default:replace(function()
if action_state.get_selected_entry() then
actions.close(prompt_bufnr)