Remove zsh vi mode
This commit is contained in:
parent
2215ab6112
commit
93cbaf6a69
@ -18,45 +18,12 @@ zmodload zsh/complist
|
||||
compinit
|
||||
_comp_options+=(globdots) # Include hidden files
|
||||
|
||||
# Vi keybindings
|
||||
bindkey -v
|
||||
bindkey -v '^?' backward-delete-char
|
||||
bindkey -M menuselect 'h' vi-backward-char
|
||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||
bindkey -M menuselect 'k' vi-up-line-or-history
|
||||
bindkey -M menuselect 'l' vi-forward-char
|
||||
bindkey '^[[P' delete-char
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
# Colors
|
||||
autoload -U colors && colors
|
||||
|
||||
# Prompt
|
||||
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
zle-line-init() {
|
||||
# zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
||||
echo -ne "\e[5 q"
|
||||
}
|
||||
|
||||
zle -N zle-keymap-select
|
||||
zle -N zle-line-init
|
||||
|
||||
echo -ne '\e[5 q' # Beam cursor on startup
|
||||
preexec() { echo -ne '\e[5 q' ;} # Beam cursor for new prompts
|
||||
|
||||
# Aliases
|
||||
source "${XDG_CONFIG_HOME:-${HOME}/.config}/.aliasrc"
|
||||
|
||||
|
Reference in New Issue
Block a user