Removed harpoon
This commit is contained in:
@@ -34,6 +34,22 @@ end, { desc = "Toggle inline diagnostics" })
|
||||
vim.keymap.set("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
vim.keymap.set("n", "[b", "<cmd>bprevious<cr>", { desc = "Previous buffer" })
|
||||
|
||||
-- Go to buffer controlls 1-9
|
||||
for i = 1, 9 do
|
||||
vim.keymap.set("n", "<leader>" .. i, function()
|
||||
local bufs = vim.fn.getbufinfo({ buflisted = 1 })
|
||||
if bufs[i] then
|
||||
vim.api.nvim_set_current_buf(bufs[i].bufnr)
|
||||
end
|
||||
end, { desc = "Go to buffer " .. i })
|
||||
end
|
||||
-- Delete current buffer (without closing window)
|
||||
vim.keymap.set("n", "<leader>bd", function()
|
||||
local current = vim.api.nvim_get_current_buf()
|
||||
vim.cmd("bnext")
|
||||
vim.cmd("bdelete " .. current)
|
||||
end, { desc = "Delete buffer" })
|
||||
|
||||
-- Toggle terminal in a bottom split
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
vim.cmd("botright split | resize 15 | terminal")
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2", -- IMPORTANT: use maintained version
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
harpoon:setup()
|
||||
|
||||
|
||||
|
||||
-- Add current file
|
||||
vim.keymap.set("n", "<leader>ha", function()
|
||||
harpoon:list():add()
|
||||
end, { desc = "Harpoon add file" })
|
||||
|
||||
-- Toggle quick menu
|
||||
vim.keymap.set("n", "<leader>hm", function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end, { desc = "Harpoon menu" })
|
||||
|
||||
-- Remove current file from harpoon
|
||||
vim.keymap.set("n", "<leader>hr", function()
|
||||
require("harpoon"):list():remove()
|
||||
end, { desc = "Harpoon: remove file" })
|
||||
|
||||
-- Jump to files
|
||||
vim.keymap.set("n", "<leader>1", function()
|
||||
harpoon:list():select(1)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>2", function()
|
||||
harpoon:list():select(2)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>3", function()
|
||||
harpoon:list():select(3)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>4", function()
|
||||
harpoon:list():select(4)
|
||||
end)
|
||||
|
||||
-- Optional: cycle
|
||||
vim.keymap.set("n", "<C-S-P>", function()
|
||||
harpoon:list():prev()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<C-S-N>", function()
|
||||
harpoon:list():next()
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user