mirror of
https://github.com/Lissy93/dotfiles.git
synced 2024-11-24 16:33:14 +01:00
25 lines
522 B
Bash
25 lines
522 B
Bash
|
|
# 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
|