diff --git a/lazy-lock.json b/lazy-lock.json index 81b86f8..47327c0 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,7 +6,6 @@ "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "gitsigns.nvim": { "branch": "main", "commit": "31217271a7314c343606acb4072a94a039a19fb5" }, - "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, @@ -16,7 +15,7 @@ "nvim": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, - "nvim-lspconfig": { "branch": "master", "commit": "d1597791f8196519439b3a036b59b09023981e1d" }, + "nvim-lspconfig": { "branch": "master", "commit": "f4e9d367d4e067d7a5fabc9fd3f1349b291eb718" }, "nvim-tree.lua": { "branch": "master", "commit": "a0db8bf7d6488b1dcd9cb5b0dfd6684a1e14f769" }, "nvim-treesitter": { "branch": "main", "commit": "9f2dad22ef8bb14fd1e0a3aa8859cdc88170668b" }, "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2f95129..3b54324 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -34,6 +34,22 @@ end, { desc = "Toggle inline diagnostics" }) vim.keymap.set("n", "]b", "bnext", { desc = "Next buffer" }) vim.keymap.set("n", "[b", "bprevious", { desc = "Previous buffer" }) +-- Go to buffer controlls 1-9 +for i = 1, 9 do + vim.keymap.set("n", "" .. 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", "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", "tt", function() vim.cmd("botright split | resize 15 | terminal") diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua deleted file mode 100644 index a7a7f05..0000000 --- a/lua/plugins/harpoon.lua +++ /dev/null @@ -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", "ha", function() - harpoon:list():add() - end, { desc = "Harpoon add file" }) - - -- Toggle quick menu - vim.keymap.set("n", "hm", function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end, { desc = "Harpoon menu" }) - - -- Remove current file from harpoon - vim.keymap.set("n", "hr", function() - require("harpoon"):list():remove() - end, { desc = "Harpoon: remove file" }) - - -- Jump to files - vim.keymap.set("n", "1", function() - harpoon:list():select(1) - end) - - vim.keymap.set("n", "2", function() - harpoon:list():select(2) - end) - - vim.keymap.set("n", "3", function() - harpoon:list():select(3) - end) - - vim.keymap.set("n", "4", function() - harpoon:list():select(4) - end) - - -- Optional: cycle - vim.keymap.set("n", "", function() - harpoon:list():prev() - end) - - vim.keymap.set("n", "", function() - harpoon:list():next() - end) - end, - }, -}