fix(zsh): indicate vi mode in prompt

This commit is contained in:
2025-10-22 11:54:45 +02:00
parent e2b9de241d
commit 0f72c8a7d7
2 changed files with 12 additions and 7 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
# vim: set ft=zsh:
function _set_rprompt() {
# shellcheck disable=SC2154
local -a _status=("${pipestatus[@]}")
RPROMPT=""
@@ -48,7 +49,8 @@ setopt PROMPT_SUBST
# https://zsh.sourceforge.io/Doc/Release/Parameters.html
# https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html
PROMPT='%(#.%F{red}.%12F)%n@%m%f %1~ %(#.#.$) '
# shellcheck disable=SC2016
PROMPT='%(#.%F{red}.%12F)%n@%m%f %1~ ${VI_MODE_INDICATOR:-%(#.#.$)} '
PROMPT_START=$'%{\e]133;A\a%}'
PROMPT_END=$'%{\e]133;B\a%}'
export PROMPT=${PROMPT_START}${PROMPT}${PROMPT_END}