Enable nvim-style cursors in zsh by mode
Update bashrc to enforce cursor style
This commit is contained in:
parent
862488f597
commit
3d90957006
2 changed files with 36 additions and 1 deletions
35
.zshrc
35
.zshrc
|
@ -7,6 +7,41 @@ unsetopt beep
|
|||
bindkey -v
|
||||
# End of lines configured by zsh-newuser-install
|
||||
|
||||
# Configure cursor
|
||||
function zle-keymap-select {
|
||||
#RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
|
||||
#RPS2=$RPS1
|
||||
zle reset-prompt
|
||||
|
||||
case $KEYMAP in
|
||||
vicmd)
|
||||
# vim Normal mode
|
||||
echo -ne '\e[1 q'
|
||||
;;
|
||||
viins)
|
||||
# vim Insert mode
|
||||
echo -ne '\e[3 q'
|
||||
;;
|
||||
*)
|
||||
# Default mode
|
||||
echo -ne '\e[3 q'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
zle -N zle-keymap-select
|
||||
|
||||
function zle-line-init {
|
||||
# New prompt. Reset cursor to underline
|
||||
echo -ne '\e[3 q'
|
||||
}
|
||||
zle -N zle-line-init
|
||||
|
||||
function zle-line-finish {
|
||||
# Prompt complete. Reset cursor to underline
|
||||
echo -ne '\e[3 q'
|
||||
}
|
||||
zle -N zle-line-finish
|
||||
|
||||
# SSH completion
|
||||
zstyle ':completion:*:(ssh|scp|ftp|sftp|rsync):*' hosts $hosts
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue