From ad4b86b8a3b6121b6277b34936ce25d49602bed1 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 23 Nov 2023 11:54:55 +0000 Subject: [PATCH] revert(nvim): update Harpoon mappings This reverts commit e05aadef340b3a243e6f40c8e5b9378c82dcce86. --- config/neovim/after/plugin/harpoon.lua | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/config/neovim/after/plugin/harpoon.lua b/config/neovim/after/plugin/harpoon.lua index 6f69b91..883bdf3 100644 --- a/config/neovim/after/plugin/harpoon.lua +++ b/config/neovim/after/plugin/harpoon.lua @@ -1,18 +1,23 @@ -require("harpoon").setup {} +local status_ok, harpoon = pcall(require, "harpoon") +if not status_ok then + return +end local nmap = require("opdavies.keymap").nmap -local mark = require "harpoon.mark" -local ui = require "harpoon.ui" +harpoon.setup {} -nmap { "", ui.toggle_quick_menu } -nmap { "a", mark.add_file } +nmap { "", require("harpoon.ui").toggle_quick_menu } +nmap { "", require("harpoon.mark").add_file } -for key, letter in ipairs { "h", "j", "k", "l" } do +nmap { "hl", require("harpoon.ui").toggle_quick_menu } +nmap { "hm", require("harpoon.mark").add_file } + +for i = 1, 5 do nmap { - string.format("", letter), + string.format("%s", i), function() - ui.nav_file(key) + require("harpoon.ui").nav_file(i) end, } end