diff --git a/modules/dotfiles/nvim/lua/thegeneralist/lazy/harpoon.lua b/modules/dotfiles/nvim/lua/thegeneralist/lazy/harpoon.lua index 92ae3b1..248ccbd 100644 --- a/modules/dotfiles/nvim/lua/thegeneralist/lazy/harpoon.lua +++ b/modules/dotfiles/nvim/lua/thegeneralist/lazy/harpoon.lua @@ -26,10 +26,29 @@ return { vim.keymap.set("n", "", function() harpoon:list():select(3) end, { desc = '[Harpoon] Third file' }) vim.keymap.set("n", "", function() harpoon:list():select(4) end, { desc = '[Harpoon] Fourth file' }) vim.keymap.set("n", "", function() + local dict = { + ["!"] = 1, + ["@"] = 2, + ["#"] = 3, + ["$"] = 4, + ["%"] = 5, + ["^"] = 6, + ["&"] = 7, + ["*"] = 8, + ["("] = 9, + [")"] = 10, + } + local input = vim.fn.input("File number > ") local file_number = tonumber(input, 10) - if not file_number then return print(input .. " is not a valid number") end - harpoon:list():select(file_number) + if not file_number and dict[input] == nil then + return print(input .. " is not a valid number") + end + if file_number then + harpoon:list():select(file_number) + else + harpoon:list():select(dict[input]) + end end, { desc = '[Harpoon] File by number' }) -- Set