mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 03:29:26 +00:00
committed by
Sorin Ionescu
parent
5232191cbe
commit
fb9a20591f
@ -8,36 +8,36 @@
|
||||
# To enable key bindings, add the following to zshrc, and replace 'map' with
|
||||
# 'emacs' or 'vi.
|
||||
#
|
||||
# zstyle ':omz:module:editor' keymap 'map'
|
||||
# zstyle ':prezto:module:editor' keymap 'map'
|
||||
#
|
||||
# To enable the auto conversion of .... to ../.., add the following to zshrc.
|
||||
#
|
||||
# zstyle ':omz:module:editor' dot-expansion 'yes'
|
||||
# zstyle ':prezto:module:editor' dot-expansion 'yes'
|
||||
#
|
||||
# To indicate when the editor is in the primary keymap (emacs or viins), add
|
||||
# the following to your theme prompt setup function.
|
||||
#
|
||||
# zstyle ':omz:module:editor:keymap' primary '>>>'
|
||||
# zstyle ':prezto:module:editor:keymap' primary '>>>'
|
||||
#
|
||||
# To indicate when the editor is in the primary keymap (emacs or viins) insert
|
||||
# mode, add the following to your theme prompt setup function.
|
||||
#
|
||||
# zstyle ':omz:module:editor:keymap:primary' insert 'I'
|
||||
# zstyle ':prezto:module:editor:keymap:primary' insert 'I'
|
||||
#
|
||||
# To indicate when the editor is in the primary keymap (emacs or viins)
|
||||
# overwrite mode, add the following to your theme prompt setup function.
|
||||
#
|
||||
# zstyle ':omz:module:editor:keymap:primary' overwrite 'O'
|
||||
# zstyle ':prezto:module:editor:keymap:primary' overwrite 'O'
|
||||
#
|
||||
# To indicate when the editor is in the alternate keymap (vicmd), add the
|
||||
# following to your theme prompt setup function.
|
||||
#
|
||||
# zstyle ':omz:module:editor:keymap' alternate '<<<'
|
||||
# zstyle ':prezto:module:editor:keymap' alternate '<<<'
|
||||
#
|
||||
# To indicate when the editor is completing, add the following to your theme
|
||||
# prompt setup function.
|
||||
#
|
||||
# zstyle ':omz:module:editor' completing '...'
|
||||
# zstyle ':prezto:module:editor' completing '...'
|
||||
#
|
||||
|
||||
# Return if requirements are not found.
|
||||
@ -96,7 +96,7 @@ key_info=(
|
||||
# Do not bind any keys if there are empty values in $key_info.
|
||||
for key in "$key_info[@]"; do
|
||||
if [[ -z "$key" ]]; then
|
||||
print "omz: one or more keys are non-bindable" >&2
|
||||
print "prezto: one or more keys are non-bindable" >&2
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
@ -112,17 +112,17 @@ function editor-info {
|
||||
typeset -gA editor_info
|
||||
|
||||
if [[ "$KEYMAP" == 'vicmd' ]]; then
|
||||
zstyle -s ':omz:module:editor:keymap' alternate 'REPLY'
|
||||
zstyle -s ':prezto:module:editor:keymap' alternate 'REPLY'
|
||||
editor_info[keymap]="$REPLY"
|
||||
else
|
||||
zstyle -s ':omz:module:editor:keymap' primary 'REPLY'
|
||||
zstyle -s ':prezto:module:editor:keymap' primary 'REPLY'
|
||||
editor_info[keymap]="$REPLY"
|
||||
|
||||
if [[ "$ZLE_STATE" == *overwrite* ]]; then
|
||||
zstyle -s ':omz:module:editor:keymap:primary' overwrite 'REPLY'
|
||||
zstyle -s ':prezto:module:editor:keymap:primary' overwrite 'REPLY'
|
||||
editor_info[overwrite]="$REPLY"
|
||||
else
|
||||
zstyle -s ':omz:module:editor:keymap:primary' insert 'REPLY'
|
||||
zstyle -s ':prezto:module:editor:keymap:primary' insert 'REPLY'
|
||||
editor_info[overwrite]="$REPLY"
|
||||
fi
|
||||
fi
|
||||
@ -199,7 +199,7 @@ zle -N expand-dot-to-parent-directory-path
|
||||
# Displays an indicator when completing.
|
||||
function expand-or-complete-with-indicator {
|
||||
local indicator
|
||||
zstyle -s ':omz:module:editor' completing 'indicator'
|
||||
zstyle -s ':prezto:module:editor' completing 'indicator'
|
||||
print -Pn "$indicator"
|
||||
zle expand-or-complete
|
||||
zle redisplay
|
||||
@ -313,7 +313,7 @@ for keymap in 'emacs' 'viins'; do
|
||||
bindkey -M "$keymap" "$key_info[Control]I" expand-or-complete
|
||||
|
||||
# Expand .... to ../..
|
||||
if zstyle -t ':omz:module:editor' dot-expansion; then
|
||||
if zstyle -t ':prezto:module:editor' dot-expansion; then
|
||||
bindkey -M "$keymap" "." expand-dot-to-parent-directory-path
|
||||
fi
|
||||
|
||||
@ -326,7 +326,7 @@ for keymap in 'emacs' 'viins'; do
|
||||
done
|
||||
|
||||
# Do not expand .... to ../.. during incremental search.
|
||||
if zstyle -t ':omz:module:editor' dot-expansion; then
|
||||
if zstyle -t ':prezto:module:editor' dot-expansion; then
|
||||
bindkey -M isearch . self-insert 2> /dev/null
|
||||
fi
|
||||
|
||||
@ -335,13 +335,13 @@ fi
|
||||
#
|
||||
|
||||
# Set the key layout.
|
||||
zstyle -s ':omz:module:editor' keymap 'keymap'
|
||||
zstyle -s ':prezto:module:editor' keymap 'keymap'
|
||||
if [[ "$keymap" == (emacs|) ]]; then
|
||||
bindkey -e
|
||||
elif [[ "$keymap" == vi ]]; then
|
||||
bindkey -v
|
||||
else
|
||||
print "omz: invalid keymap: $keymap" >&2
|
||||
print "prezto: invalid keymap: $keymap" >&2
|
||||
fi
|
||||
|
||||
unset key{map,}
|
||||
|
Reference in New Issue
Block a user