editor: Fix Home and End in vicmd mode

Fixes #1160
main
Kaleb Elwert 7 years ago
parent 485ad9e704
commit 79927ac73a

@ -322,18 +322,24 @@ for keymap in $unbound_keys; do
bindkey -M viins "${keymap}" _prezto-zle-noop
bindkey -M vicmd "${keymap}" _prezto-zle-noop
done
# Ctrl + Left and Ctrl + Right bindings to forward/backward word
# Keybinds for all keymaps
for keymap in 'emacs' 'viins' 'vicmd'; do
bindkey -M "$keymap" "$key_info[Home]" beginning-of-line
bindkey -M "$keymap" "$key_info[End]" end-of-line
done
# Keybinds for all vi keymaps
for keymap in viins vicmd; do
# Ctrl + Left and Ctrl + Right bindings to forward/backward word
for key in "${(s: :)key_info[ControlLeft]}"
bindkey -M "$keymap" "$key" vi-backward-word
for key in "${(s: :)key_info[ControlRight]}"
bindkey -M "$keymap" "$key" vi-forward-word
done
# Keybinds for emacs and vi insert mode
for keymap in 'emacs' 'viins'; do
bindkey -M "$keymap" "$key_info[Home]" beginning-of-line
bindkey -M "$keymap" "$key_info[End]" end-of-line
bindkey -M "$keymap" "$key_info[Insert]" overwrite-mode
bindkey -M "$keymap" "$key_info[Delete]" delete-char
bindkey -M "$keymap" "$key_info[Backspace]" backward-delete-char

Loading…
Cancel
Save