Skip to content

Commit

Permalink
Fix to restore bindings after switching to vi-mode
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jimhester committed Sep 20, 2012
1 parent 921d2f4 commit b609aa0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/vi-mode/vi-mode.plugin.zsh
Expand Up @@ -5,7 +5,12 @@ function zle-line-init zle-keymap-select {
zle -N zle-line-init
zle -N zle-keymap-select

#changing mode clobbers the keybinds, so store the keybinds before and execute
#them after
binds=`bindkey -L`
bindkey -v
for bind in ${(@f)binds}; do eval $bind; done
unset binds

# if mode indicator wasn't setup by theme, define default
if [[ "$MODE_INDICATOR" == "" ]]; then
Expand Down

0 comments on commit b609aa0

Please sign in to comment.