diff --git a/config/neovim/after/plugin/harpoon.lua b/config/neovim/after/plugin/harpoon.lua index 883bdf3..6f69b91 100644 --- a/config/neovim/after/plugin/harpoon.lua +++ b/config/neovim/after/plugin/harpoon.lua @@ -1,23 +1,18 @@ -local status_ok, harpoon = pcall(require, "harpoon") -if not status_ok then - return -end +require("harpoon").setup {} local nmap = require("opdavies.keymap").nmap -harpoon.setup {} +local mark = require "harpoon.mark" +local ui = require "harpoon.ui" -nmap { "", require("harpoon.ui").toggle_quick_menu } -nmap { "", require("harpoon.mark").add_file } +nmap { "", ui.toggle_quick_menu } +nmap { "a", mark.add_file } -nmap { "hl", require("harpoon.ui").toggle_quick_menu } -nmap { "hm", require("harpoon.mark").add_file } - -for i = 1, 5 do +for key, letter in ipairs { "h", "j", "k", "l" } do nmap { - string.format("%s", i), + string.format("", letter), function() - require("harpoon.ui").nav_file(i) + ui.nav_file(key) end, } end