mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-07 10:59:55 +01:00
neovim(harpoon): allow symbols instead of numbers
This commit is contained in:
parent
a44510ee09
commit
eae1c39468
1 changed files with 21 additions and 2 deletions
|
|
@ -26,10 +26,29 @@ return {
|
||||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end, { desc = '[Harpoon] Third file' })
|
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end, { desc = '[Harpoon] Third file' })
|
||||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end, { desc = '[Harpoon] Fourth file' })
|
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end, { desc = '[Harpoon] Fourth file' })
|
||||||
vim.keymap.set("n", "<C-]>", function()
|
vim.keymap.set("n", "<C-]>", function()
|
||||||
|
local dict = {
|
||||||
|
["!"] = 1,
|
||||||
|
["@"] = 2,
|
||||||
|
["#"] = 3,
|
||||||
|
["$"] = 4,
|
||||||
|
["%"] = 5,
|
||||||
|
["^"] = 6,
|
||||||
|
["&"] = 7,
|
||||||
|
["*"] = 8,
|
||||||
|
["("] = 9,
|
||||||
|
[")"] = 10,
|
||||||
|
}
|
||||||
|
|
||||||
local input = vim.fn.input("File number > ")
|
local input = vim.fn.input("File number > ")
|
||||||
local file_number = tonumber(input, 10)
|
local file_number = tonumber(input, 10)
|
||||||
if not file_number then return print(input .. " is not a valid number") end
|
if not file_number and dict[input] == nil then
|
||||||
harpoon:list():select(file_number)
|
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' })
|
end, { desc = '[Harpoon] File by number' })
|
||||||
|
|
||||||
-- Set
|
-- Set
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue