mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 03:29:26 +00:00
Adds additional support for PS prompt context expansion
This commit is contained in:
@ -20,6 +20,13 @@ To enable the auto conversion of .... to ../.., add the following to
|
||||
|
||||
zstyle ':prezto:module:editor' dot-expansion 'yes'
|
||||
|
||||
### PS Context
|
||||
|
||||
To enable the prompt context to be set, add the following to your
|
||||
*zpreztorc*.
|
||||
|
||||
zstyle ':prezto:module:editor' ps-context 'yes'
|
||||
|
||||
Theming
|
||||
-------
|
||||
|
||||
|
@ -103,12 +103,27 @@ function editor-info {
|
||||
fi
|
||||
|
||||
unset REPLY
|
||||
|
||||
zle reset-prompt
|
||||
zle -R
|
||||
zle zle-reset-prompt
|
||||
}
|
||||
zle -N editor-info
|
||||
|
||||
# Reset the prompt based on the current context and
|
||||
# the ps-context option.
|
||||
function zle-reset-prompt {
|
||||
if zstyle -t ':prezto:module:editor' ps-context; then
|
||||
# If we aren't within one of the specified contexts, then we want to reset
|
||||
# the prompt with the appropriate editor_info[keymap] if there is one.
|
||||
if [[ $CONTEXT != (select|cont) ]]; then
|
||||
zle reset-prompt
|
||||
zle -R
|
||||
fi
|
||||
else
|
||||
zle reset-prompt
|
||||
zle -R
|
||||
fi
|
||||
}
|
||||
zle -N zle-reset-prompt
|
||||
|
||||
# Updates editor information when the keymap changes.
|
||||
function zle-keymap-select {
|
||||
zle editor-info
|
||||
|
Reference in New Issue
Block a user