mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
vi-mode: Allow an insert mode indicator to be set.
Set INS_MODE_INDICATOR to set what will be shown in the prompt during insert mode.
This commit is contained in:
parent
3913106b2e
commit
748557076d
1 changed files with 8 additions and 2 deletions
|
|
@ -26,13 +26,19 @@ bindkey -v
|
||||||
autoload -Uz edit-command-line
|
autoload -Uz edit-command-line
|
||||||
bindkey -M vicmd 'v' edit-command-line
|
bindkey -M vicmd 'v' edit-command-line
|
||||||
|
|
||||||
# if mode indicator wasn't setup by theme, define default
|
# if command mode indicator wasn't setup by theme, define default
|
||||||
if [[ "$MODE_INDICATOR" == "" ]]; then
|
if [[ "$MODE_INDICATOR" == "" ]]; then
|
||||||
MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
|
MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if insert mode indicator wasn't setup by theme, define an empty default
|
||||||
|
# to preserve existing behaviour
|
||||||
|
if [[ "$INS_MODE_INDICATOR" == "" ]]; then
|
||||||
|
INS_MODE_INDICATOR=""
|
||||||
|
fi
|
||||||
|
|
||||||
function vi_mode_prompt_info() {
|
function vi_mode_prompt_info() {
|
||||||
echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
|
echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/$INS_MODE_INDICATOR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# define right prompt, if it wasn't defined by a theme
|
# define right prompt, if it wasn't defined by a theme
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue