From 8bc5819a7bf567dc09e46edaa4fe0864445f3f88 Mon Sep 17 00:00:00 2001 From: DustVoice Date: Wed, 23 Oct 2019 14:59:33 +0000 Subject: [PATCH] Clean up zsh scripts; Remove cursor styles, as it is pretty buggy with other shells than TRUE xterm --- .vim.zsh | 49 ------------------------------------------------- .zshrc | 12 ------------ 2 files changed, 61 deletions(-) delete mode 100644 .vim.zsh diff --git a/.vim.zsh b/.vim.zsh deleted file mode 100644 index 59de9a04..00000000 --- a/.vim.zsh +++ /dev/null @@ -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 diff --git a/.zshrc b/.zshrc index 239be3c0..5aea3b86 100644 --- a/.zshrc +++ b/.zshrc @@ -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'