diff --git a/init.lua b/init.lua index dc316af9..147f3d9d 100644 --- a/init.lua +++ b/init.lua @@ -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', '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 + }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: 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" },