From c6672c5a42110cce262fb69d576be506134af026 Mon Sep 17 00:00:00 2001 From: BBBoy01 <1156678002@qq.com> Date: Sat, 13 Apr 2024 14:38:28 +0800 Subject: [PATCH] feat: update harpoon keymaps --- lua/plugins/editor.lua | 43 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 04430d7..4c20870 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -252,35 +252,7 @@ return { :find() end - return { - { - '', - function() - harpoon:list():select(1) - end, - desc = 'Harpoon buffer 1', - }, - { - '', - function() - harpoon:list():select(2) - end, - desc = 'Harpoon buffer 2', - }, - { - '', - function() - harpoon:list():select(3) - end, - desc = 'Harpoon buffer 3', - }, - { - '', - function() - harpoon:list():select(4) - end, - desc = 'Harpoon buffer 4', - }, + local keys = { { '', function() @@ -298,7 +270,7 @@ return { { '', function() - harpoon:list():append() + harpoon:list():add() end, desc = 'Harpoon add current buffer', }, @@ -317,6 +289,17 @@ return { desc = 'Harpoon list telescope', }, } + + for i = 1, 5 do + table.insert(keys, { + '' .. i, + function() + require('harpoon'):list():select(i) + end, + desc = 'Harpoon to File ' .. i, + }) + end + return keys end, },