Fix to restore bindings after switching to vi-mode
the vi-mode plugin destroys any bindings made before it is sourced due to the
'bindkey -v' call to switch to using vi-mode. This patch saves the bindings
before invoking 'bindkey -v' then rebinds them afterwards, this fixes a number
of outstanding issues due to people using vi-mode and having things in oh-my-zsh
break due to the bindings being destroyed
Diff
1diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
2index c47ab72114562251e4ca75f1395dcaea1abe2002..d29eb1dda85de0b8aa9416643166c5f4081d468b 100644
3--- a/plugins/vi-mode/vi-mode.plugin.zsh
4+++ b/plugins/vi-mode/vi-mode.plugin.zsh
5@@ -5,7 +5,12 @@ function zle-line-init zle-keymap-select {
6 zle -N zle-line-init
7 zle -N zle-keymap-select
8 9+#changing mode clobbers the keybinds, so store the keybinds before and execute
10+#them after
11+binds=`bindkey -L`
12 bindkey -v
13+for bind in ${(@f)binds}; do eval $bind; done
14+unset binds
1516 # if mode indicator wasn't setup by theme, define default
17 if [[ "$MODE_INDICATOR" == "" ]]; then