From 87c3853ae7e2945c1a418721c8b3734a8e8e4256 Mon Sep 17 00:00:00 2001 From: Joel Lau Date: Thu, 15 Feb 2024 23:53:11 +0800 Subject: [PATCH] harpoon setup --- init.lua | 26 ++++++++++++++++++++++++++ lazy-lock.json | 1 + 2 files changed, 27 insertions(+) diff --git a/init.lua b/init.lua index 233f7ff4..f89f5e2e 100644 --- a/init.lua +++ b/init.lua @@ -75,6 +75,32 @@ require('lazy').setup({ -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', + { + 'ThePrimeagen/harpoon', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local ui = require('harpoon.ui') + local mark = require('harpoon.mark') + + -- mark page + vim.keymap.set('n', 'ha', mark.add_file, { desc = "[H]arpoon [A]dd" }) + + -- show menu + vim.keymap.set('n', 'hh', ui.toggle_quick_menu, { desc = "[H]arpoon Menu" }) + + -- navigation + vim.keymap.set('n', 'h1', function() ui.nav_file(1) end, { desc = "[H]arpoon File [1]" }) + vim.keymap.set('n', 'h2', function() ui.nav_file(2) end, { desc = "[H]arpoon File [2]" }) + vim.keymap.set('n', 'h3', function() ui.nav_file(3) end, { desc = "[H]arpoon File [3]" }) + vim.keymap.set('n', 'h4', function() ui.nav_file(4) end, { desc = "[H]arpoon File [4]" }) + vim.keymap.set('n', 'h5', function() ui.nav_file(5) end, { desc = "[H]arpoon File [5]" }) + vim.keymap.set('n', 'h6', function() ui.nav_file(6) end, { desc = "[H]arpoon File [6]" }) + vim.keymap.set('n', 'h7', function() ui.nav_file(7) end, { desc = "[H]arpoon File [7]" }) + vim.keymap.set('n', 'h8', function() ui.nav_file(8) end, { desc = "[H]arpoon File [8]" }) + vim.keymap.set('n', 'h9', function() ui.nav_file(9) end, { desc = "[H]arpoon File [9]" }) + vim.keymap.set('n', 'h0', function() ui.nav_file(0) end, { desc = "[H]arpoon File [0]" }) + end + }, -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. diff --git a/lazy-lock.json b/lazy-lock.json index f8cc984e..2db5e885 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -7,6 +7,7 @@ "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" }, "friendly-snippets": { "branch": "main", "commit": "5cc1f45c6aac699ad008fb85f6ae03236062667d" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "kanagawa.nvim": { "branch": "master", "commit": "ab41956c4559c3eb21e713fcdf54cda1cb6d5f40" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },