|
|
@ -45,6 +45,10 @@ if [[ "$TERM" == 'dumb' ]]; then |
|
|
|
return 1 |
|
|
|
return 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# Options |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
# Beep on error in line editor. |
|
|
|
# Beep on error in line editor. |
|
|
|
setopt BEEP |
|
|
|
setopt BEEP |
|
|
|
|
|
|
|
|
|
|
@ -52,6 +56,10 @@ setopt BEEP |
|
|
|
autoload -Uz edit-command-line |
|
|
|
autoload -Uz edit-command-line |
|
|
|
zle -N edit-command-line |
|
|
|
zle -N edit-command-line |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# Variables |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
# Use human-friendly identifiers. |
|
|
|
# Use human-friendly identifiers. |
|
|
|
zmodload zsh/terminfo |
|
|
|
zmodload zsh/terminfo |
|
|
|
typeset -gA key_info |
|
|
|
typeset -gA key_info |
|
|
@ -93,6 +101,10 @@ for key in "$key_info[@]"; do |
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# Functions |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
# Displays editor information. |
|
|
|
# Displays editor information. |
|
|
|
function editor-info { |
|
|
|
function editor-info { |
|
|
|
# Clean up previous $editor_info. |
|
|
|
# Clean up previous $editor_info. |
|
|
@ -191,7 +203,10 @@ zle -N prepend-sudo |
|
|
|
# Reset to default key bindings. |
|
|
|
# Reset to default key bindings. |
|
|
|
bindkey -d |
|
|
|
bindkey -d |
|
|
|
|
|
|
|
|
|
|
|
# Emacs key bindings. |
|
|
|
# |
|
|
|
|
|
|
|
# Emacs Key Bindings |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
for key ("$key_info[Escape]"{B,b}) bindkey -M emacs "$key" emacs-backward-word |
|
|
|
for key ("$key_info[Escape]"{B,b}) bindkey -M emacs "$key" emacs-backward-word |
|
|
|
for key ("$key_info[Escape]"{F,f}) bindkey -M emacs "$key" emacs-forward-word |
|
|
|
for key ("$key_info[Escape]"{F,f}) bindkey -M emacs "$key" emacs-forward-word |
|
|
|
bindkey -M emacs "$key_info[Escape]$key_info[Left]" emacs-backward-word |
|
|
|
bindkey -M emacs "$key_info[Escape]$key_info[Left]" emacs-backward-word |
|
|
@ -220,7 +235,9 @@ if (( $+widgets[history-incremental-pattern-search-backward] )); then |
|
|
|
history-incremental-pattern-search-forward |
|
|
|
history-incremental-pattern-search-forward |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Vi key bindings. |
|
|
|
# |
|
|
|
|
|
|
|
# Vi Key Bindings |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
# Edit command in an external editor. |
|
|
|
# Edit command in an external editor. |
|
|
|
bindkey -M vicmd "v" edit-command-line |
|
|
|
bindkey -M vicmd "v" edit-command-line |
|
|
@ -241,7 +258,10 @@ else |
|
|
|
bindkey -M vicmd "/" history-incremental-search-forward |
|
|
|
bindkey -M vicmd "/" history-incremental-search-forward |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Emacs and Vi key bindings. |
|
|
|
# |
|
|
|
|
|
|
|
# Emacs and Vi Key Bindings |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
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[Home]" beginning-of-line |
|
|
|
bindkey -M "$keymap" "$key_info[End]" end-of-line |
|
|
|
bindkey -M "$keymap" "$key_info[End]" end-of-line |
|
|
@ -295,6 +315,10 @@ if zstyle -t ':omz:module:editor' dot-expansion; then |
|
|
|
bindkey -M isearch . self-insert 2> /dev/null |
|
|
|
bindkey -M isearch . self-insert 2> /dev/null |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# Layout |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
# Set the key layout. |
|
|
|
# Set the key layout. |
|
|
|
zstyle -s ':omz:module:editor' keymap 'keymap' |
|
|
|
zstyle -s ':omz:module:editor' keymap 'keymap' |
|
|
|
if [[ "$keymap" == (emacs|) ]]; then |
|
|
|
if [[ "$keymap" == (emacs|) ]]; then |
|
|
|