From 58ffe58f2973a6e9a9011ab428d7064b38f81a95 Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Tue, 5 Sep 2023 10:49:31 +0100 Subject: [PATCH] Add harpoon plugin and rebind for harpoon --- .config/nvim/after/plugin/lsp.lua | 2 ++ .config/nvim/lua/sheldonmlee/packer.lua | 3 +++ .config/nvim/lua/sheldonmlee/remap.lua | 30 ++++++++++++++++--------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 965be44..7cced73 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -29,6 +29,8 @@ end) -- (Optional) Configure lua language server for neovim require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) +lsp.skip_server_setup({'ltex'}) + lsp.setup() -- Below commented code is a fallback for when the setup_nvim_cmp() diff --git a/.config/nvim/lua/sheldonmlee/packer.lua b/.config/nvim/lua/sheldonmlee/packer.lua index f1a2276..7533644 100644 --- a/.config/nvim/lua/sheldonmlee/packer.lua +++ b/.config/nvim/lua/sheldonmlee/packer.lua @@ -45,4 +45,7 @@ return require('packer').startup(function(use) } use 'lervag/vimtex' + + use 'nvim-lua/plenary.nvim' + use 'ThePrimeagen/harpoon' end) diff --git a/.config/nvim/lua/sheldonmlee/remap.lua b/.config/nvim/lua/sheldonmlee/remap.lua index cc4ffc3..084fbdf 100644 --- a/.config/nvim/lua/sheldonmlee/remap.lua +++ b/.config/nvim/lua/sheldonmlee/remap.lua @@ -36,14 +36,22 @@ for n = 1, 4 do end end -vim.keymap.set("n", "a", vim.cmd.args) -vim.keymap.set("n", "u", arg_action["argu"]) -vim.keymap.set("n", "an", arg_action["next"]) -vim.keymap.set("n", "ap", arg_action["prev"]) -vim.keymap.set("n", "af", arg_action["first"]) -vim.keymap.set("n", "al", arg_action["last"]) -vim.keymap.set("n", "aa", argu_n[1]) -vim.keymap.set("n", "ra", argu_n[1]) -vim.keymap.set("n", "ar", argu_n[2]) -vim.keymap.set("n", "as", argu_n[3]) -vim.keymap.set("n", "at", argu_n[4]) +--vim.keymap.set("n", "a", vim.cmd.args) +--vim.keymap.set("n", "u", arg_action["argu"]) +--vim.keymap.set("n", "an", arg_action["next"]) +--vim.keymap.set("n", "ap", arg_action["prev"]) +--vim.keymap.set("n", "af", arg_action["first"]) +--vim.keymap.set("n", "al", arg_action["last"]) +--vim.keymap.set("n", "aa", argu_n[1]) +--vim.keymap.set("n", "ra", argu_n[1]) +--vim.keymap.set("n", "ar", argu_n[2]) +--vim.keymap.set("n", "as", argu_n[3]) +--vim.keymap.set("n", "at", argu_n[4]) + +-- Primeagen harpoon +vim.keymap.set("n", "b", function() vim.cmd('lua require("harpoon.ui").toggle_quick_menu()') end) +vim.keymap.set("n", "m", function() vim.cmd('lua require("harpoon.mark").add_file()') end) +vim.keymap.set("n", "a", function() vim.cmd('lua require("harpoon.ui").nav_file(1)') end) +vim.keymap.set("n", "r", function() vim.cmd('lua require("harpoon.ui").nav_file(2)') end) +vim.keymap.set("n", "s", function() vim.cmd('lua require("harpoon.ui").nav_file(3)') end) +vim.keymap.set("n", "t", function() vim.cmd('lua require("harpoon.ui").nav_file(4)') end)