From cd71c38c1ad1af12494b44250cbf1bbb509bb6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=B0=B8=E6=98=A5?= Date: Wed, 16 Jul 2025 16:09:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9Awhichkey=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoload/tui/core/plug.vim | 1 - layers/plug/init.vim | 1 + layers/plug/whichkey.vim | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 layers/plug/whichkey.vim diff --git a/autoload/tui/core/plug.vim b/autoload/tui/core/plug.vim index 293c53e..fe2a731 100644 --- a/autoload/tui/core/plug.vim +++ b/autoload/tui/core/plug.vim @@ -169,7 +169,6 @@ export def Install() title: 'Plugins - ' .. tui#core#cached#Get('tui.plug.home'), minwidth: minwidth, callback: (_, index) => { - echo index if index > 0 var plug_id = tui_plug_ids[index - 1] var plug_info = tui_plug_registed[plug_id] diff --git a/layers/plug/init.vim b/layers/plug/init.vim index 4aa7e73..6bef8d0 100644 --- a/layers/plug/init.vim +++ b/layers/plug/init.vim @@ -6,3 +6,4 @@ TuiLayer plug.nerdtree TuiLayer plug.poplar +TuiLayer plug.whichkey diff --git a/layers/plug/whichkey.vim b/layers/plug/whichkey.vim new file mode 100644 index 0000000..e4c1cbd --- /dev/null +++ b/layers/plug/whichkey.vim @@ -0,0 +1,20 @@ +vim9script + +const g:which_key_map = { + f: { + name: 'File', + o: ['Poplar', 'open'] + }, + v: { + name: 'View', + f: [":NERDTreeToggle", "nerdtree"] + } +} + +tui#core#plug#Regist('liuchengxu/vim-which-key', { + config: () => { + which_key#register('', "g:which_key_map") + nnoremap :WhichKey '' + } +}) +