git.fiddlerwoaroof.com
Browse code

refactor(zsh): cleanup and centralize keybindings

Edward Langley authored on 22/03/2023 01:52:16
Showing 3 changed files
... ...
@@ -10,5 +10,3 @@ if [[ -d "$HOME/.zsh_help" ]]; then
10 10
     export HELPDIR="$HOME/.zsh_help"
11 11
 fi
12 12
 alias run-help >/dev/null && unalias run-help
13
-bindkey -v '^_' run-help
14
-
... ...
@@ -1,8 +0,0 @@
1
-autoload -Uz surround
2
-zle -N delete-surround surround
3
-zle -N add-surround surround
4
-zle -N change-surround surround
5
-bindkey -a cs change-surround
6
-bindkey -a ds delete-surround
7
-bindkey -a ys add-surround
8
-bindkey -M visual S add-surround
... ...
@@ -24,6 +24,8 @@ bindkey -M vicmd '^X^e' edit-command-line
24 24
 bindkey -M viins '^I' complete-word
25 25
 bindkey -M viins '^Oc' _correct_word
26 26
 bindkey -M viins '^O?' _complete_debug
27
+bindkey -M viins '^_' run-help
28
+bindkey -M vicmd '^_' run-help
27 29
 
28 30
 # detecting the terminal to get the keybindings right
29 31
 # TODO: check if obsoleted by other things
... ...
@@ -50,3 +52,11 @@ bindkey '[3~' delete-char
50 52
 
51 53
 export KEYTIMEOUT=1
52 54
 
55
+autoload -Uz surround
56
+zle -N delete-surround surround
57
+zle -N add-surround surround
58
+zle -N change-surround surround
59
+bindkey -a cs change-surround
60
+bindkey -a ds delete-surround
61
+bindkey -a ys add-surround
62
+bindkey -M visual S add-surround