mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
add vi-mode cursor mode indicator
Bar for insert mode, block for normal mode. what do you think? :)
This commit is contained in:
parent
b94d9e26e5
commit
f5b734105b
1 changed files with 14 additions and 0 deletions
|
|
@ -48,3 +48,17 @@ function vi_mode_prompt_info() {
|
||||||
if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
|
if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
|
||||||
RPS1='$(vi_mode_prompt_info)'
|
RPS1='$(vi_mode_prompt_info)'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# vi-mode cursor indicator
|
||||||
|
echo -ne "\e[6 q" # vertical bar
|
||||||
|
zle-keymap-select () {
|
||||||
|
if [ "$TERM" = "rxvt-unicode-256color" ]; then
|
||||||
|
if [ $KEYMAP = vicmd ]; then
|
||||||
|
# the command mode for vi
|
||||||
|
echo -ne "\e[2 q" # block
|
||||||
|
else
|
||||||
|
# the insert mode for vi
|
||||||
|
echo -ne "\e[6 q" # bar
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue