mirror of
https://github.com/Lissy93/dotfiles.git
synced 2025-01-23 04:18:34 +01:00
🖱 Change cursor, depending on insert or nomal mode
This commit is contained in:
parent
b7153083cb
commit
ae2d451a37
24
zsh/lib/cursor.zsh
Normal file
24
zsh/lib/cursor.zsh
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
# See https://ttssh2.osdn.jp/manual/4/en/usage/tips/vim.html for cursor shapes
|
||||
|
||||
cursor_block='\e[2 q'
|
||||
cursor_beam='\e[6 q'
|
||||
|
||||
function zle-keymap-select {
|
||||
if [[ ${KEYMAP} == vicmd ]] ||
|
||||
[[ $1 = 'block' ]]; then
|
||||
echo -ne $cursor_block
|
||||
elif [[ ${KEYMAP} == main ]] ||
|
||||
[[ ${KEYMAP} == viins ]] ||
|
||||
[[ ${KEYMAP} = '' ]] ||
|
||||
[[ $1 = 'beam' ]]; then
|
||||
echo -ne $cursor_beam
|
||||
fi
|
||||
}
|
||||
|
||||
zle-line-init() {
|
||||
echo -ne $cursor_beam
|
||||
}
|
||||
|
||||
zle -N zle-keymap-select
|
||||
zle -N zle-line-init
|
Loading…
Reference in New Issue
Block a user