Better completion with up-arrow.

This commit is contained in:
Bartek Stalewski 2021-08-01 22:35:13 +02:00
parent 323b41e49f
commit 88f6831798
2 changed files with 23 additions and 3 deletions

View File

@ -1,6 +1,3 @@
# key mode
bindkey -e
# global exports and options # global exports and options
export HISTSIZE=10000 export HISTSIZE=10000
export SAVEHIST=$HISTSIZE export SAVEHIST=$HISTSIZE
@ -18,6 +15,7 @@ mkdir -p $XDG_CACHE_HOME/zsh
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-colors ''
source $ZDOTDIR/keys.zsh
# fancy stuff only in X or ssh # fancy stuff only in X or ssh
if [[ ! $(tty) =~ /dev/tty[0-9] ]]; then if [[ ! $(tty) =~ /dev/tty[0-9] ]]; then
# aliases # aliases

22
zsh/keys.zsh Normal file
View File

@ -0,0 +1,22 @@
# key mode
bindkey -e
# proudly stolen from oh-my-zsh
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
if [[ -n "${terminfo[kcuu1]}" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
fi