Skip to content

Commit 9cd89fa

Browse files
committed
docs: migration for keys.toml
1 parent bd8abdf commit 9cd89fa

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

docs/src/content/docs/dev/reference/keybindings.mdx

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,111 @@ and if another printable key is sent within 0.25 seconds, it will be counted as
359359
but it exists if you want it
360360

361361
obviously please use kitty keyboard protocol.
362+
363+
## MIGRATION FROM < 0.11.0
364+
365+
as of 0.10.2, this system is not forced, you can continue using the old system, but it will be removed in 0.11.0.
366+
367+
how to migrate:
368+
369+
old syntax will **not be migrated automatically**
370+
<br/>if you chose the default options in setup, you can relaunch setup with `rovr --force-first-launch` and regenerate your config and keybinds
371+
372+
for those who customised their keybinds, you need to look carefully
373+
374+
old keybinds are defined under `[keybinds]` in `config.toml`, and the new system is defined in `keys.toml`. old keybinds are based of a single preset, so to keep using that preset as base, add this to `keys.toml`
375+
376+
```toml
377+
inherit = "base"
378+
```
379+
380+
the new system uses `<key> = <action>`, not `<action> = [<key>]`, so you need to change the syntax. for example, this:
381+
382+
```toml
383+
[keybinds]
384+
"tab_new" = ["n"]
385+
"tab_close" = ["w"]
386+
```
387+
388+
would be
389+
390+
```toml
391+
[main]
392+
"n" = "tab_new"
393+
"w" = "tab_close"
394+
```
395+
396+
for navigation, you can change it from
397+
398+
```toml
399+
[keybinds]
400+
up = ["up", "k"]
401+
down = ["down", "j"]
402+
up_tree = ["left", "h"]
403+
down_tree = ["right", "l", "enter"]
404+
bypass_up_tree = ["H"]
405+
bypass_down_tree = ["L"]
406+
page_up = ["pageup", "ctrl+b"]
407+
page_down = ["pagedown", "ctrl+f"]
408+
home = ["home", "g"]
409+
end = ["end", "G"]
410+
```
411+
412+
to
413+
414+
```toml
415+
[lists]
416+
# you can choose to use cursor(-1)
417+
"up" = { action = "cursor(-1)", desc = "Move up" }
418+
# or alternatively
419+
# "up" = { action = "cursor_down" }
420+
# but cursor(-1) is more consistent with the other actions
421+
# and recommended for flexibility
422+
"k" = "cursor(-1)"
423+
"down" = { action = "cursor(1)", desc = "Move down" }
424+
"j" = "cursor(1)"
425+
"right" = { action = "select", desc = "Select" }
426+
"l" = "select"
427+
"enter" = "select"
428+
"pageup" = { action = "cursor_page(-1)", desc = "Move up one page" }
429+
"ctrl+b" = "cursor_page(-1)"
430+
"pagedown" = { action = "cursor_page(1)", desc = "Move down one page" }
431+
"ctrl+f" = "cursor_page(1)"
432+
"home" = { action = "first", desc = "Move to the first item" }
433+
"g" = "first"
434+
"end" = { action = "last", desc = "Move to the last item" }
435+
"G" = "last"
436+
437+
[scroll]
438+
"up" = "scroll_up"
439+
"k" = "scroll_up"
440+
"down" = "scroll_down"
441+
"j" = "scroll_down"
442+
"pageup" = "scroll_page_up"
443+
"ctrl+b" = "scroll_page_up"
444+
"pagedown" = "scroll_page_down"
445+
"ctrl+f" = "scroll_page_down"
446+
"home" = "scroll_home"
447+
"g" = "scroll_home"
448+
"end" = "scroll_end"
449+
"G" = "scroll_end"
450+
```
451+
452+
for certain screens, for instance `DeleteFiles`, it is simpler
453+
454+
```toml
455+
[keybinds.delete_files]
456+
trash = ["d"]
457+
delete = ["x"]
458+
cancel = ["c", "escape"]
459+
```
460+
to
461+
```toml
462+
[delete_files]
463+
"d" = "trash"
464+
"x" = "delete"
465+
"c" = "cancel"
466+
"escape" = "cancel"
467+
```
468+
469+
this may seem overly verbose, but it allows me to add more flexible actions without needing to change much of the core

0 commit comments

Comments
 (0)