mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
Add different cursors for normal and insert mode
This commit is contained in:
parent
2ff9560ad3
commit
dfd12c1f8c
1 changed files with 12 additions and 1 deletions
|
|
@ -1,15 +1,26 @@
|
|||
# Updates editor information when the keymap changes.
|
||||
# Updates editor information when the keymap changes, and changes the cursor.
|
||||
function zle-keymap-select() {
|
||||
if [[ $KEYMAP == vicmd ]]; then
|
||||
echo -ne '\e[1 q'
|
||||
elif [[ $KEYMAP == main ]] || [[ $KEYMAP == viins ]] || [[ $KEYMAP = '' ]]; then
|
||||
echo -ne '\e[5 q'
|
||||
fi
|
||||
zle reset-prompt
|
||||
zle -R
|
||||
}
|
||||
|
||||
# Changes the cursor at a new line.
|
||||
function zle-line-init() {
|
||||
echo -ne '\e[5 q'
|
||||
}
|
||||
|
||||
# Ensure that the prompt is redrawn when the terminal size changes.
|
||||
TRAPWINCH() {
|
||||
zle && zle -R
|
||||
}
|
||||
|
||||
zle -N zle-keymap-select
|
||||
zle -N zle-line-init
|
||||
zle -N edit-command-line
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue