From 1ca943f99b31cbcbe72544811cc348fe65b0b843 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 1 Aug 2024 18:49:22 +0800 Subject: [PATCH] docs: new keymap style --- docs/configuration/keymap.md | 18 +++++++++--------- docs/installation.md | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/configuration/keymap.md b/docs/configuration/keymap.md index 832053ad..f650bdaf 100644 --- a/docs/configuration/keymap.md +++ b/docs/configuration/keymap.md @@ -26,10 +26,10 @@ Since Yazi selects the first matching key to run, prepend always has a higher pr ```toml [manager] prepend_keymap = [ - { on = [ "" ], run = 'my-fev-command1', desc = "Just for test!" }, + { on = "", run = 'my-fev-command1', desc = "Just for test!" }, ] append_keymap = [ - { on = [ "" ], run = 'my-fev-command2', desc = "Just for test!" }, + { on = [ "g", "a" ], run = 'my-fev-command2', desc = "Just for test!" }, ] ``` @@ -37,16 +37,16 @@ Or in another different style: ```toml [[manager.prepend_keymap]] -on = [ "" ] +on = "" run = 'my-fev-command1' desc = "Just for test!" [[manager.prepend_keymap]] -on = [ "" ] +on = [ "g", "a" ] run = 'my-fev-command2' [[manager.append_keymap]] -on = [ "" ] +on = "c" run = 'my-fev-command3' ``` @@ -55,11 +55,11 @@ But keep in mind that you can only choose one of them, and it cannot be a combin ```toml [manager] prepend_keymap = [ - { on = [ "" ], run = 'my-fev-command1', desc = "Just for test!" }, + { on = "", run = 'my-fev-command1', desc = "Just for test!" }, ] [[manager.prepend_keymap]] -on = [ "" ] +on = [ "g", "a" ] run = 'my-fev-command2' desc = "Just for test!" ``` @@ -70,8 +70,8 @@ When you don't need any default and want to fully customize your keybindings, us [manager] keymap = [ # This will override all default keybindings, and just keep the two below. - { on = [ "" ], run = 'my-fev-command1', desc = "Just for test!" }, - { on = [ "" ], run = 'my-fev-command2', desc = "Just for test!" }, + { on = "", run = 'my-fev-command1', desc = "Just for test!" }, + { on = [ "g", "a" ], run = 'my-fev-command2', desc = "Just for test!" }, ] ``` diff --git a/docs/installation.md b/docs/installation.md index 6735bce9..e40846f0 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -113,7 +113,7 @@ in { keymap = { manager.prepend_keymap = [ { - on = ["T"]; + on = "T"; run = "plugin --sync max-preview"; desc = "Maximize or restore the preview pane"; }