1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-16 02:41:13 +00:00

editor: Fix Home and End in vicmd mode

Fixes #1160
This commit is contained in:
Kaleb Elwert 2017-11-10 11:06:50 -08:00
parent 485ad9e704
commit 79927ac73a

View File

@ -322,18 +322,24 @@ for keymap in $unbound_keys; do
bindkey -M viins "${keymap}" _prezto-zle-noop bindkey -M viins "${keymap}" _prezto-zle-noop
bindkey -M vicmd "${keymap}" _prezto-zle-noop bindkey -M vicmd "${keymap}" _prezto-zle-noop
done 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 for keymap in viins vicmd; do
# Ctrl + Left and Ctrl + Right bindings to forward/backward word
for key in "${(s: :)key_info[ControlLeft]}" for key in "${(s: :)key_info[ControlLeft]}"
bindkey -M "$keymap" "$key" vi-backward-word bindkey -M "$keymap" "$key" vi-backward-word
for key in "${(s: :)key_info[ControlRight]}" for key in "${(s: :)key_info[ControlRight]}"
bindkey -M "$keymap" "$key" vi-forward-word bindkey -M "$keymap" "$key" vi-forward-word
done done
# Keybinds for emacs and vi insert mode
for keymap in 'emacs' 'viins'; do 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[Insert]" overwrite-mode
bindkey -M "$keymap" "$key_info[Delete]" delete-char bindkey -M "$keymap" "$key_info[Delete]" delete-char
bindkey -M "$keymap" "$key_info[Backspace]" backward-delete-char bindkey -M "$keymap" "$key_info[Backspace]" backward-delete-char