diff --git a/lazy-lock.json b/lazy-lock.json index b49a799..ddfbad5 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,6 +3,7 @@ "catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" }, "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "80c0130c5f16b551865a69e832f1feadeedb5fbe" }, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2444b8e..2673e4f 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -3,7 +3,7 @@ vim.keymap.set("n", "w", ":w") vim.keymap.set("n", "q", ":q") -- Clear search highlight -vim.keymap.set("n", "h", ":nohlsearch") +vim.keymap.set("n", "c", ":nohlsearch") -- Better window navigation vim.keymap.set("n", "", "h") diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index cbfc225..28b657d 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -20,6 +20,7 @@ vim.opt.rtp:prepend(lazypath) local plugins = { require("plugins.colorschemes"), -- theme require("plugins.editing"), -- editing + require("plugins.harpoon"), -- harpoon require("plugins.lsp"), -- LSP require("plugins.telescope"), -- fuzzy finder require("plugins.treesitter"), -- syntax tree diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..10d674a --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,23 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { + "nvim-lua/plenary.nvim", + }, + + -- lazy = false, -- load immediately + + config = function() + local harpoon = require("harpoon") + + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():add() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "h", function() harpoon:list():select(1) end) + vim.keymap.set("n", "j", function() harpoon:list():select(2) end) + vim.keymap.set("n", "k", function() harpoon:list():select(3) end) + vim.keymap.set("n", "l", function() harpoon:list():select(4) end) + end, +}