Revert "fix(zsh): indicate vi mode in prompt"

This reverts commit a194d840244f86a1a5dde20cb5fd9ab73a381a12.
This commit is contained in:
2025-12-09 15:31:59 +01:00
parent 901df5cef4
commit 730efb4643
2 changed files with 7 additions and 12 deletions
+1 -3
View File
@@ -1,7 +1,6 @@
# vim: set ft=zsh:
function _set_rprompt() {
# shellcheck disable=SC2154
local -a _status=("${pipestatus[@]}")
RPROMPT=""
@@ -49,8 +48,7 @@ setopt PROMPT_SUBST
# https://zsh.sourceforge.io/Doc/Release/Parameters.html
# https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html
# shellcheck disable=SC2016
PROMPT='%(#.%F{red}.%12F)%n@%m%f %1~ ${VI_MODE_INDICATOR:-%(#.#.$)} '
PROMPT='%(#.%F{red}.%12F)%n@%m%f %1~ %(#.#.$) '
PROMPT_START=$'%{\e]133;A\a%}'
PROMPT_END=$'%{\e]133;B\a%}'
export PROMPT=${PROMPT_START}${PROMPT}${PROMPT_END}
+6 -9
View File
@@ -44,21 +44,18 @@ bindkey -a '_' vi-first-non-blank
# shellcheck disable=SC2034
zle_highlight=(region:bg=#323641)
# Vi mode indicator in prompt
# Change cursor shape based on vi mode
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]]; then
VI_MODE_INDICATOR="%F{yellow}N%f"
else
VI_MODE_INDICATOR=""
if [[ ${KEYMAP} == main ]]; then
echo -ne '\e[5 q' # Beam cursor for insert mode
elif [[ ${KEYMAP} == vicmd ]]; then
echo -ne '\e[1 q' # Block cursor for command mode
fi
zle reset-prompt
}
zle -N zle-keymap-select
function zle-line-init {
# shellcheck disable=SC2034
VI_MODE_INDICATOR=""
zle reset-prompt
echo -ne '\e[5 q' # Beam cursor for insert mode
}
zle -N zle-line-init