forked from DustVoice/dotfiles
Resolve compatibility issues; Transition to fish
This commit is contained in:
parent
c7fa14d370
commit
377bb20f35
2 changed files with 0 additions and 61 deletions
49
.vim.zsh
49
.vim.zsh
|
@ -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
12
.zshrc
|
@ -24,12 +24,6 @@ function zle-keymap-select () {
|
||||||
(*) VI_MODE="$(insert-mode)" ;;
|
(*) VI_MODE="$(insert-mode)" ;;
|
||||||
esac
|
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 %(!.#.$) "
|
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 reset-prompt
|
||||||
|
@ -45,12 +39,6 @@ preexec () { print -rn -- $terminfo[el]; }
|
||||||
zle -N zle-line-init
|
zle -N zle-line-init
|
||||||
zle -N zle-keymap-select
|
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
|
export KEYTIMEOUT=1
|
||||||
|
|
||||||
alias ll='ls -alF'
|
alias ll='ls -alF'
|
||||||
|
|
Loading…
Reference in a new issue