remove items from harpoon using dropdown menu
This commit is contained in:
@ -28,21 +28,25 @@ function M.switcher()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- remove harpoon item
|
-- remove harpoon item
|
||||||
-- TODO:
|
vim.keymap.set("i", "<C-a>", function()
|
||||||
|
|
||||||
-- select items, and open buffer
|
|
||||||
vim.keymap.set("n", "<C-v>", function()
|
|
||||||
if action_state.get_selected_entry() then
|
if action_state.get_selected_entry() then
|
||||||
actions.close(prompt_bufnr)
|
for i, v in ipairs(filepaths) do
|
||||||
vim.cmd("vsplit "..action_state.get_selected_entry()[1])
|
if v == action_state.get_selected_entry()[1] then
|
||||||
|
harpoon:list():removeAt(i)
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
M.switcher()
|
||||||
|
end
|
||||||
|
end
|
||||||
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
|
if action_state.get_selected_entry() then
|
||||||
actions.close(prompt_bufnr)
|
actions.close(prompt_bufnr)
|
||||||
vim.cmd("split "..action_state.get_selected_entry()[1])
|
vim.cmd("split "..action_state.get_selected_entry()[1])
|
||||||
end
|
end
|
||||||
end)
|
end, { buffer = true, remap = true })
|
||||||
actions.select_default:replace(function()
|
actions.select_default:replace(function()
|
||||||
if action_state.get_selected_entry() then
|
if action_state.get_selected_entry() then
|
||||||
actions.close(prompt_bufnr)
|
actions.close(prompt_bufnr)
|
||||||
|
Reference in New Issue
Block a user