Skip to content

Commit

Permalink
harpoon: override mappings to delete without prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Apr 5, 2024
1 parent e3861d6 commit 0268c6a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions modules/harpoon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,33 @@ in
require('harpoon'):setup()
${writeIf tele.enable ''
vim.keymap.set("n", "<leader>hl", function() require("telescope").extensions.harpoon.marks() end, { desc = "List" })
local themes = require("telescope.themes")
local hm_actions = require("telescope._extensions.harpoon_marks.actions")
vim.keymap.set(
"n",
"<leader>hl",
function()
require("telescope").extensions.harpoon.marks(themes.get_dropdown({
previewer = false,
layout_config = { width = 0.6 },
path_display = { truncate = 10 },
attach_mappings = function(_, map)
map("i", "<c-d>", hm_actions.delete_mark_selections)
map("n", "<c-d>", hm_actions.delete_mark_selections)
return true
end,
}))
end,
{ desc = "List" }
)
''}
${writeIf keys.enable ''
wk.register({
["<leader>h"] = {
name = "Harpoon",
a = { "<cmd>lua require('harpoon'):list():append()<CR>", "Add" },
a = { "<cmd>lua require('harpoon'):list():add()<CR>", "Add" },
d = { "<cmd>lua require('harpoon'):list():remove()<CR>", "Del" },
},
})
Expand Down

0 comments on commit 0268c6a

Please sign in to comment.