blob: 303e91c7bef675588112a43185ffba644ff22850 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# Change cursor shape for different vi modes.
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]]
[[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]]
[[ ${KEYMAP} == viins ]]
[[ ${KEYMAP} = '' ]]
[[ $1 = 'beam' ]]; then
echo -ne '\e[5 q'
fi
}
# Prompt called purs
function zle-line-init zle-keymap-select {
PROMPT=`$HOME/.local/src/purs/target/release/purs prompt -k "$KEYMAP" -r "$?" --venv "${${VIRTUAL_ENV:t}%-*}"`
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
autoload -Uz add-zsh-hook
function _prompt_purs_precmd() {
/$HOME/.local/src/purs/target/release/purs precmd
}
add-zsh-hook precmd _prompt_purs_precmd
|