Skip to content

Commit 7c11800

Browse files
author
Stephan Dilly
committed
improved documentation on key bindings overwrites
1 parent 6249491 commit 7c11800

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

KEY_CONFIG.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@ The default keys are based on arrow keys to navigate.
44

55
However popular demand lead to fully customizability of the key bindings.
66

7-
On first start `gitui` will create `key_bindings.ron` file automatically based on the defaults.
8-
This file allows changing every key binding.
7+
Create a `key_bindings.ron` file like this:
8+
```
9+
(
10+
focus_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
11+
focus_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
12+
focus_above: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
13+
focus_below: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
14+
15+
move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
16+
move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
17+
move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
18+
move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
19+
)
20+
```
921

1022
The config file format based on the [Ron file format](https://github.com/ron-rs/ron).
1123
The location of the file depends on your OS:
@@ -14,6 +26,8 @@ The location of the file depends on your OS:
1426
* `$HOME/.config/gitui/key_bindings.ron` (linux)
1527
* `%APPDATA%/gitui/key_bindings.ron` (Windows)
1628

29+
See all possible keys to overwrite in code: [here](https://github.com/extrawurst/gitui/blob/master/src/keys/key_list.rs#L83)
30+
1731
Here is a [vim style key config](vim_style_key_config.ron) with `h`, `j`, `k`, `l` to navigate. Use it to copy the content into `key_bindings.ron` to get vim style key bindings.
1832

1933
# Key Symbols

0 commit comments

Comments
 (0)