Improved vim key bindings for GitUI
dblume

dblume commited on 2022-11-27 18:47:05
Showing 1 changed files, with 37 additions and 1 deletions.

... ...
@@ -1,13 +1,49 @@
1
+// bit for modifiers
2
+// bits: 0  None 
3
+// bits: 1  SHIFT
4
+// bits: 2  CONTROL
5
+//
6
+// Note:
7
+// If the default key layout is lower case,
8
+// and you want to use `Shift + q` to trigger the exit event,
9
+// the setting should like this `exit: Some(( code: Char('Q'), modifiers: ( bits: 1,),)),`
10
+// The Char should be upper case, and the shift modified bit should be set to 1.
11
+//
12
+// Note:
13
+// find `KeysList` type in src/keys/key_list.rs for all possible keys.
14
+// every key not overwritten via the config file will use the default specified there
1 15
 (
2 16
     focus_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
3 17
     focus_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
4 18
     focus_above: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
5 19
     focus_below: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
6 20
 
21
+    open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
22
+
7 23
     move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
8 24
     move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
9 25
     move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
10 26
     move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
27
+    popup_up: Some(( code: Char('p'), modifiers: ( bits: 2,),)),
28
+    popup_down: Some(( code: Char('n'), modifiers: ( bits: 2,),)),
29
+    page_up: Some(( code: Char('b'), modifiers: ( bits: 2,),)),
30
+    page_down: Some(( code: Char('f'), modifiers: ( bits: 2,),)),
31
+    home: Some(( code: Char('g'), modifiers: ( bits: 0,),)),
32
+    end: Some(( code: Char('G'), modifiers: ( bits: 1,),)),
33
+    shift_up: Some(( code: Char('K'), modifiers: ( bits: 1,),)),
34
+    shift_down: Some(( code: Char('J'), modifiers: ( bits: 1,),)),
11 35
 
12
-    open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
36
+    edit_file: Some(( code: Char('I'), modifiers: ( bits: 1,),)),
37
+
38
+    status_reset_item: Some(( code: Char('U'), modifiers: ( bits: 1,),)),
39
+
40
+    diff_reset_lines: Some(( code: Char('u'), modifiers: ( bits: 0,),)),
41
+    diff_stage_lines: Some(( code: Char('s'), modifiers: ( bits: 0,),)),
42
+
43
+    stashing_save: Some(( code: Char('w'), modifiers: ( bits: 0,),)),
44
+    stashing_toggle_index: Some(( code: Char('m'), modifiers: ( bits: 0,),)),
45
+
46
+    stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
47
+
48
+    abort_merge: Some(( code: Char('M'), modifiers: ( bits: 1,),)),
13 49
 )
14 50