add harpoon plugin

This commit is contained in:
Schistos Tega 2024-06-02 20:36:08 +03:00
parent b15c51b398
commit 7c53ce5bef
2 changed files with 23 additions and 0 deletions

View File

@ -326,6 +326,7 @@ require('lazy').setup({
-- Useful for getting pretty icons, but requires a Nerd Font. -- Useful for getting pretty icons, but requires a Nerd Font.
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
{ 'ThePrimeagen/harpoon' },
}, },
config = function() config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that -- Telescope is a fuzzy finder that comes with a lot of different things that
@ -369,6 +370,7 @@ require('lazy').setup({
-- Enable Telescope extensions if they are installed -- Enable Telescope extensions if they are installed
pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'ui-select') pcall(require('telescope').load_extension, 'ui-select')
pcall(require('telescope').load_extension, 'harpoon')
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
local builtin = require 'telescope.builtin' local builtin = require 'telescope.builtin'

View File

@ -0,0 +1,21 @@
local mark = require 'harpoon.mark'
local ui = require 'harpoon.ui'
vim.keymap.set('n', '<leader>a', mark.add_file, { desc = '[A]dd harpoon mark' })
vim.keymap.set('n', '<leader>sm', require('telescope').extensions.harpoon.marks, { desc = '[S]earch harpoon [M]' })
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu)
vim.keymap.set('n', '<A-h>', function()
ui.nav_file(1)
end)
vim.keymap.set('n', '<A-j>', function()
ui.nav_file(2)
end)
vim.keymap.set('n', '<A-k>', function()
ui.nav_file(3)
end)
vim.keymap.set('n', '<A-l>', function()
ui.nav_file(4)
end)
return {}