From be296480d942eff52f44520ea68ec092e8cce250 Mon Sep 17 00:00:00 2001 From: chilborne Date: Fri, 16 Feb 2024 15:43:10 +0100 Subject: [PATCH] harpoon, multicursor, undotree --- init.lua | 6 ++-- lua/custom/configs/remaps.lua | 3 ++ lua/custom/plugins/harpoon.lua | 50 ++++++++++++++++++++++++++++++ lua/custom/plugins/multicursor.lua | 17 ++++++++++ lua/custom/plugins/undotree.lua | 3 ++ 5 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 lua/custom/plugins/harpoon.lua create mode 100644 lua/custom/plugins/multicursor.lua create mode 100644 lua/custom/plugins/undotree.lua diff --git a/init.lua b/init.lua index 3a44c336..170db484 100755 --- a/init.lua +++ b/init.lua @@ -255,9 +255,9 @@ vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = tr -- Remap for navigating between buffers -vim.keymap.set('n', 'x', 'bd', { silent = true }) -vim.keymap.set('n', 'l', 'bnext', { silent = true }) -vim.keymap.set('n', 'h', 'bprev', { silent = true }) +-- vim.keymap.set('n', 'x', 'bd', { silent = true }) +-- vim.keymap.set('n', 'l', 'bnext', { silent = true }) +-- vim.keymap.set('n', 'h', 'bprev', { silent = true }) -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` diff --git a/lua/custom/configs/remaps.lua b/lua/custom/configs/remaps.lua index 3712c4b4..96ca00f1 100755 --- a/lua/custom/configs/remaps.lua +++ b/lua/custom/configs/remaps.lua @@ -49,3 +49,6 @@ vim.keymap.set("n", "xq", function() require("trouble").toggle("quickfix vim.keymap.set("n", "xl", function() require("trouble").toggle("loclist") end, { desc = 'Trouble [l]oclist' }) vim.keymap.set("n", "xR", function() require("trouble").toggle("lsp_references") end, { desc = 'Trouble [g]o to [R]eferences' }) + +-- undotree +vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..9f526a65 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,50 @@ +return { + "theprimeagen/harpoon", + branch = "harpoon2", + lazy = false, + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon"):setup() + end, + keys = { + { + "h", + function() require("harpoon"):list():append() end, + desc = + "harpoon file", + }, + { + "", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = + "harpoon quick menu", + }, + { + "1", + function() require("harpoon"):list():select(1) end, + desc = + "harpoon to file 1", + }, + { + "2", + function() require("harpoon"):list():select(2) end, + desc = + "harpoon to file 2", + }, + { + "3", + function() require("harpoon"):list():select(3) end, + desc = + "harpoon to file 3", + }, + { + "4", + function() require("harpoon"):list():select(4) end, + desc = + "harpoon to file 4", + }, + }, +} diff --git a/lua/custom/plugins/multicursor.lua b/lua/custom/plugins/multicursor.lua new file mode 100644 index 00000000..a50d9ee0 --- /dev/null +++ b/lua/custom/plugins/multicursor.lua @@ -0,0 +1,17 @@ +return { + "smoka7/multicursors.nvim", + event = "VeryLazy", + dependencies = { + 'smoka7/hydra.nvim', + }, + opts = {}, + cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' }, + keys = { + { + mode = { 'v', 'n' }, + 'm', + 'MCstart', + desc = 'Create a selection for selected text or word under the cursor', + }, + }, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000..4c9b5f58 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,3 @@ +return { + "mbbill/undotree", +}