From 4f4d3225547e6ec06e7675a6c3759d35d0530433 Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 22 Mar 2024 21:13:03 -0300 Subject: [PATCH] Change harpoon for graple in nvim --- .../nvim/lua/aleidk/plugins/bookmarks.lua | 20 +++++++ .../nvim/lua/aleidk/plugins/harpoon.lua | 55 ------------------- .../nvim/lua/aleidk/plugins/key-help.lua | 4 +- .../dot_config/nvim/original_lazy-lock.json | 3 - 4 files changed, 23 insertions(+), 59 deletions(-) create mode 100644 chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua delete mode 100644 chezmoi/dot_config/nvim/lua/aleidk/plugins/harpoon.lua diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua new file mode 100644 index 0000000..c891b2c --- /dev/null +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua @@ -0,0 +1,20 @@ +return { + "cbochs/grapple.nvim", + dependencies = { + { "nvim-tree/nvim-web-devicons", lazy = true }, + }, + enabled = false, + event = { "BufReadPost", "BufNewFile" }, + cmd = "Grapple", + keys = { + { "a", "Grapple toggle", desc = "Toggle bookmark for current file" }, + { "t", "Grapple toggle_tags", desc = "Toggle bookmarks window" }, + { "T", "Grapple toggle_scopes", desc = "Toggle scopes window" }, + { "n", "Grapple cycle forward", desc = "Next bookmark" }, + { "N", "Grapple cycle backward", desc = "Prev bookmark" }, + { "j", "Grapple select index=1", desc = "bookmark 1" }, + { "k", "Grapple select index=2", desc = "bookmark 2" }, + { "l", "Grapple select index=3", desc = "bookmark 3" }, + { "ñ", "Grapple select index=4", desc = "bookmark 4" }, + }, +} diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/harpoon.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/harpoon.lua deleted file mode 100644 index 7871e57..0000000 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/harpoon.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "ThePrimeagen/harpoon", - -- lazy = false, - opts = { - global_settings = { - -- sets the marks upon calling `toggle` on the ui, instead of require `:w`. - save_on_toggle = true, - -- saves the harpoon file upon every change. disabling is unrecommended. - save_on_change = true, - -- sets harpoon to run the command immediately as it's passed to the terminal when calling `sendCommand`. - enter_on_sendcmd = true, - -- closes any tmux windows harpoon that harpoon creates when you close Neovim. - tmux_autoclose_windows = false, - -- filetypes that you want to prevent from adding to the harpoon list menu. - excluded_filetypes = { "harpoon" }, - -- set marks specific to each git branch inside git repository - mark_branch = false, - }, - }, - config = function(_, opts) - require("harpoon").setup(opts) - - local mark = require("harpoon.mark") - local ui = require("harpoon.ui") - local telescope = require("telescope") - - telescope.load_extension("harpoon") - - local function map(key, func, desc) - vim.keymap.set("n", "" .. key, func, { desc = desc }) - end - - map("n", mark.add_file, "Add mark") - - map("t", ui.toggle_quick_menu, "Toogle UI") - - map("j", function() - ui.nav_file(1) - end, "Navigate to file 1") - - map("k", function() - ui.nav_file(2) - end, "Navigate to file 2") - - map("l", function() - ui.nav_file(3) - end, "Navigate to file 3") - - map("ñ", function() - ui.nav_file(4) - end, "Navigate to file 4") - - map("T", "Telescope harpoon marks", "Open marks in telescope") - end, -} diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua index de9be4e..2a7b945 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua @@ -46,7 +46,9 @@ return { miniclue.gen_clues.windows(), miniclue.gen_clues.z(), - { mode = "n", keys = "", desc = "+Harpoon" }, + { mode = "n", keys = "", desc = "+Bookmarks" }, + { mode = "n", keys = "n", postkeys = "" }, + { mode = "n", keys = "N", postkeys = "" }, { mode = "n", keys = "b", desc = "+Buffers" }, { mode = "n", keys = "bh", postkeys = "b" }, { mode = "n", keys = "bl", postkeys = "b" }, diff --git a/chezmoi/dot_config/nvim/original_lazy-lock.json b/chezmoi/dot_config/nvim/original_lazy-lock.json index 2e9fb1a..b8506ef 100644 --- a/chezmoi/dot_config/nvim/original_lazy-lock.json +++ b/chezmoi/dot_config/nvim/original_lazy-lock.json @@ -18,10 +18,7 @@ "diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" }, "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, - "fzf": { "branch": "master", "commit": "ec208af474fa3eadad5779c3d30db6d2db300932" }, - "fzf-lua": { "branch": "main", "commit": "6589bdd872385d120a1eb3cb85e5d15d37621c1d" }, "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" }, - "harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" }, "indent-blankline.nvim": { "branch": "master", "commit": "046e2cf04e08ece927bacbfb87c5b35c0b636546" }, "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, "lazygit.nvim": { "branch": "main", "commit": "de35012036d43bca03628d40d083f7c02a4cda3f" },