harpoon setup

This commit is contained in:
Joel Lau 2024-02-15 23:53:11 +08:00 committed by Joel Lau
parent d7b7899d1f
commit 6e43c7e2d0
No known key found for this signature in database
GPG Key ID: C2A155B2D3A77578
2 changed files with 29 additions and 2 deletions

View File

@ -237,8 +237,34 @@ require('lazy').setup({
-- This is equivalent to:
-- require('Comment').setup({})
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
-- 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', '<leader>ha', mark.add_file, { desc = "[H]arpoon [A]dd" })
-- show menu
vim.keymap.set('n', '<leader>hh', ui.toggle_quick_menu, { desc = "[H]arpoon Menu" })
-- navigation
vim.keymap.set('n', '<leader>h1', function() ui.nav_file(1) end, { desc = "[H]arpoon File [1]" })
vim.keymap.set('n', '<leader>h2', function() ui.nav_file(2) end, { desc = "[H]arpoon File [2]" })
vim.keymap.set('n', '<leader>h3', function() ui.nav_file(3) end, { desc = "[H]arpoon File [3]" })
vim.keymap.set('n', '<leader>h4', function() ui.nav_file(4) end, { desc = "[H]arpoon File [4]" })
vim.keymap.set('n', '<leader>h5', function() ui.nav_file(5) end, { desc = "[H]arpoon File [5]" })
vim.keymap.set('n', '<leader>h6', function() ui.nav_file(6) end, { desc = "[H]arpoon File [6]" })
vim.keymap.set('n', '<leader>h7', function() ui.nav_file(7) end, { desc = "[H]arpoon File [7]" })
vim.keymap.set('n', '<leader>h8', function() ui.nav_file(8) end, { desc = "[H]arpoon File [8]" })
vim.keymap.set('n', '<leader>h9', function() ui.nav_file(9) end, { desc = "[H]arpoon File [9]" })
vim.keymap.set('n', '<leader>h0', function() ui.nav_file(0) end, { desc = "[H]arpoon File [0]" })
end
},
-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:

View File

@ -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" },