history-substring-search key bindings for zsh

This commit is contained in:
Cyryl Plotnicki-Chudyk 2015-01-24 16:52:06 +01:00
parent 136877720d
commit da75eb7e94

8
.zshrc
View file

@ -8,7 +8,6 @@ plugins=(vi-mode svn git python history-substring-search)
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
# Customize to your needs...
HISTFILE=~/.histfile HISTFILE=~/.histfile
HISTSIZE=10240 HISTSIZE=10240
SAVEHIST=10240 SAVEHIST=10240
@ -21,6 +20,13 @@ setopt completealiases
zstyle ':completion::complete:*' use-cache 1 zstyle ':completion::complete:*' use-cache 1
# bind UP and DOWN arrow keys
zmodload zsh/terminfo
bindkey "$terminfo[cuu1]" history-substring-search-up
bindkey "$terminfo[cud1]" history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
if [[ `uname` == 'Darwin' ]]; then if [[ `uname` == 'Darwin' ]]; then
alias vim=/usr/local/Cellar/vim/7.4/bin/vim alias vim=/usr/local/Cellar/vim/7.4/bin/vim
fi fi