Skip to content

Commit

Permalink
docs: new keymap style
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Aug 1, 2024
1 parent 4f655be commit 1ca943f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions docs/configuration/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ Since Yazi selects the first matching key to run, prepend always has a higher pr
```toml
[manager]
prepend_keymap = [
{ on = [ "<C-a>" ], run = 'my-fev-command1', desc = "Just for test!" },
{ on = "<C-a>", run = 'my-fev-command1', desc = "Just for test!" },
]
append_keymap = [
{ on = [ "<C-b>" ], run = 'my-fev-command2', desc = "Just for test!" },
{ on = [ "g", "a" ], run = 'my-fev-command2', desc = "Just for test!" },
]
```

Or in another different style:

```toml
[[manager.prepend_keymap]]
on = [ "<C-a>" ]
on = "<C-a>"
run = 'my-fev-command1'
desc = "Just for test!"

[[manager.prepend_keymap]]
on = [ "<C-b>" ]
on = [ "g", "a" ]
run = 'my-fev-command2'

[[manager.append_keymap]]
on = [ "<C-c>" ]
on = "c"
run = 'my-fev-command3'
```

Expand All @@ -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 = [ "<C-a>" ], run = 'my-fev-command1', desc = "Just for test!" },
{ on = "<C-a>", run = 'my-fev-command1', desc = "Just for test!" },
]

[[manager.prepend_keymap]]
on = [ "<C-b>" ]
on = [ "g", "a" ]
run = 'my-fev-command2'
desc = "Just for test!"
```
Expand All @@ -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 = [ "<C-a>" ], run = 'my-fev-command1', desc = "Just for test!" },
{ on = [ "<C-b>" ], run = 'my-fev-command2', desc = "Just for test!" },
{ on = "<C-a>", run = 'my-fev-command1', desc = "Just for test!" },
{ on = [ "g", "a" ], run = 'my-fev-command2', desc = "Just for test!" },
]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down

0 comments on commit 1ca943f

Please sign in to comment.