Add key bindings for gitui
dblume

dblume commited on 2022-11-27 00:19:07
Showing 3 changed files, with 16 additions and 2 deletions.

... ...
@@ -0,0 +1,13 @@
1
+(
2
+    focus_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
3
+    focus_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
4
+    focus_above: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
5
+    focus_below: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
6
+    
7
+    move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
8
+    move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
9
+    move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
10
+    move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
11
+
12
+    open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
13
+)
... ...
@@ -57,6 +57,7 @@ See [config.dlma.com](http://config.dlma.com) for more.
57 57
 7. .ssh/config, for a [fix for CVE-2016-0777](https://news.ycombinator.com/item?id=10901588). (Or upgrade to OpenSSH 7.1p2 released Jan 14, 2016 from http://www.openssh.com.)
58 58
 8. .ripgreprc, for ripgrep, or [rc](https://github.com/BurntSushi/ripgrep/).
59 59
 9. .gdbinit
60
+10. .config/gitui/key\_bindings.ron, for vim key bindings in [gitui](https://github.com/extrawurst/gitui).
60 61
 
61 62
 #### Optional manual steps for fresh setups
62 63
 
... ...
@@ -5,7 +5,7 @@ declare -r SCRIPT_NAME=$(basename "$BASH_SOURCE")
5 5
 declare -r backup_dir=$HOME/backup_of_dotfiles_$(date "+%Y-%m-%d_%H%M%S")
6 6
 declare -a dotfiles=(".bashrc" ".bash_profile" ".vimrc" ".editrc" ".gitconfig"
7 7
                      ".gitignore" ".inputrc" ".tmux.conf" ".ssh/config" ".ripgreprc"
8
-                     ".gdbinit")
8
+                     ".gdbinit" ".config/gitui/key_bindings.ron")
9 9
 declare -i DRY_RUN=0
10 10
 
11 11
 ## exit the shell (with status 2) after printing the message
... ...
@@ -55,7 +55,7 @@ do
55 55
         fi
56 56
     else
57 57
         echo "$i" will be added to HOME.
58
-        ((DRY_RUN==0)) && cp "$i" $HOME/"$i"
58
+        ((DRY_RUN==0)) && mkdir -p $HOME/$(dirname "$i") && cp "$i" $HOME/"$i"
59 59
     fi
60 60
 done
61 61
 
62 62