Clean up zsh scripts; Remove cursor styles, as it is pretty buggy with other shells than TRUE xterm

This commit is contained in:
David Holland 2019-10-23 14:59:33 +00:00
parent c7fa14d370
commit 8bc5819a7b
Signed by: DustVoice
GPG key ID: 47068995A14EDCA9
2 changed files with 0 additions and 61 deletions

View file

@ -1,49 +0,0 @@
bindkey -v
terminfo_down_sc=$terminfo[cud1]$terminfo[cud1]$terminfo[cuu1]$terminfo[cuu1]$terminfo[sc]$terminfo[cud1]$terminfo[cud1]
#terminfo_down_sc=$terminfo[cud1]$terminfo[cuu1]$terminfo[sc]$terminfo[cud1]
function insert-mode () { echo "%S%F{cyan} -- INSERT -- %f%s" }
function normal-mode () { echo "%S%F{green} -- NORMAL -- %f%s" }
precmd () {
PS1="%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%F{magenta}%n%f@%F{yellow}%m%f %F{green}%~%f %(!.#.$) "
}
function zle-keymap-select () {
VI_KEYMAP=$KEYMAP
case ${VI_KEYMAP} in
(vicmd) VI_MODE="$(normal-mode)" ;;
(main|viins) VI_MODE="$(insert-mode)" ;;
(*) VI_MODE="$(insert-mode)" ;;
esac
[[ -n "$VI_MODE_KEEP_CURSOR" ]] || if [[ "$VI_KEYMAP" == "vicmd" ]]; then
print -n '\e[1 q'
else
print -n '\e[5 q'
fi
PS1="%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%F{magenta}%n%f@%F{yellow}%m%f %B%F{cyan}%~%f%b %(!.#.$) "
zle reset-prompt
zle -R
}
function zle-line-init() {
zle -K viins
}
preexec () { print -rn -- $terminfo[el]; }
zle -N zle-line-init
zle -N zle-keymap-select
function _vi_mode_reset_cursor() {
[[ -n "$VI_MODE_KEEP_CURSOR" ]] || print -n '\e[1 q'
}
autoload -U add-zsh-hook
add-zsh-hook preexec _vi_mode_reset_cursor
export KEYTIMEOUT=1

12
.zshrc
View file

@ -24,12 +24,6 @@ function zle-keymap-select () {
(*) VI_MODE="$(insert-mode)" ;;
esac
[[ -n "$VI_MODE_KEEP_CURSOR" ]] || if [[ "$VI_KEYMAP" == "vicmd" ]]; then
print -n '\e[1 q'
else
print -n '\e[5 q'
fi
PS1="%{$terminfo_down_sc$VI_MODE$terminfo[rc]%}%F{magenta}%n%f@%F{yellow}%m%f %B%F{cyan}%~%f%b %(!.#.$) "
zle reset-prompt
@ -45,12 +39,6 @@ preexec () { print -rn -- $terminfo[el]; }
zle -N zle-line-init
zle -N zle-keymap-select
function _vi_mode_reset_cursor() {
[[ -n "$VI_MODE_KEEP_CURSOR" ]] || print -n '\e[1 q'
}
autoload -U add-zsh-hook
add-zsh-hook preexec _vi_mode_reset_cursor
export KEYTIMEOUT=1
alias ll='ls -alF'