Add harpoon plugin and rebind for harpoon

This commit is contained in:
Sheldon Lee 2023-09-05 10:49:31 +01:00
parent b68239d658
commit 58ffe58f29
3 changed files with 24 additions and 11 deletions

View File

@ -29,6 +29,8 @@ end)
-- (Optional) Configure lua language server for neovim -- (Optional) Configure lua language server for neovim
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
lsp.skip_server_setup({'ltex'})
lsp.setup() lsp.setup()
-- Below commented code is a fallback for when the setup_nvim_cmp() -- Below commented code is a fallback for when the setup_nvim_cmp()

View File

@ -45,4 +45,7 @@ return require('packer').startup(function(use)
} }
use 'lervag/vimtex' use 'lervag/vimtex'
use 'nvim-lua/plenary.nvim'
use 'ThePrimeagen/harpoon'
end) end)

View File

@ -36,14 +36,22 @@ for n = 1, 4 do
end end
end end
vim.keymap.set("n", "<leader>a", vim.cmd.args) --vim.keymap.set("n", "<leader>a", vim.cmd.args)
vim.keymap.set("n", "<leader>u", arg_action["argu"]) --vim.keymap.set("n", "<leader>u", arg_action["argu"])
vim.keymap.set("n", "<leader>an", arg_action["next"]) --vim.keymap.set("n", "<leader>an", arg_action["next"])
vim.keymap.set("n", "<leader>ap", arg_action["prev"]) --vim.keymap.set("n", "<leader>ap", arg_action["prev"])
vim.keymap.set("n", "<leader>af", arg_action["first"]) --vim.keymap.set("n", "<leader>af", arg_action["first"])
vim.keymap.set("n", "<leader>al", arg_action["last"]) --vim.keymap.set("n", "<leader>al", arg_action["last"])
vim.keymap.set("n", "<leader>aa", argu_n[1]) --vim.keymap.set("n", "<leader>aa", argu_n[1])
vim.keymap.set("n", "<leader>ra", argu_n[1]) --vim.keymap.set("n", "<leader>ra", argu_n[1])
vim.keymap.set("n", "<leader>ar", argu_n[2]) --vim.keymap.set("n", "<leader>ar", argu_n[2])
vim.keymap.set("n", "<leader>as", argu_n[3]) --vim.keymap.set("n", "<leader>as", argu_n[3])
vim.keymap.set("n", "<leader>at", argu_n[4]) --vim.keymap.set("n", "<leader>at", argu_n[4])
-- Primeagen harpoon
vim.keymap.set("n", "<leader>b", function() vim.cmd('lua require("harpoon.ui").toggle_quick_menu()') end)
vim.keymap.set("n", "<leader>m", function() vim.cmd('lua require("harpoon.mark").add_file()') end)
vim.keymap.set("n", "<leader>a", function() vim.cmd('lua require("harpoon.ui").nav_file(1)') end)
vim.keymap.set("n", "<leader>r", function() vim.cmd('lua require("harpoon.ui").nav_file(2)') end)
vim.keymap.set("n", "<leader>s", function() vim.cmd('lua require("harpoon.ui").nav_file(3)') end)
vim.keymap.set("n", "<leader>t", function() vim.cmd('lua require("harpoon.ui").nav_file(4)') end)