Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The Ctrl+R works for root (well toor) however I cannot find why it does not work for user.

User .zshrc:

setopt AUTO_CD
setopt CORRECT_ALL
setopt EXTENDED_GLOB
# History
SAVEHIST=10000
HISTSIZE=10000
HISTFILE=~/.zsh/history
setopt APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt INC_APPEND_HISTORY
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt NO_HIST_BEEP
setopt SHARE_HISTORY
# Keys
autoload zkbd
[[ ! -d ~/.zkbd ]] && mkdir ~/.zkbd
[[ ! -f ~/.zkbd/$TERM-${DISPLAY:-$VENDOR-$OSTYPE} ]] && zkbd
source  ~/.zkbd/$TERM-${DISPLAY:-$VENDOR-$OSTYPE}
[[ -n ${key[Home]}    ]]  && bindkey  "${key[Home]}"    beginning-of-line
[[ -n ${key[End]}     ]]  && bindkey  "${key[End]}"     end-of-line
[[ -n ${key[Insert]}  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
[[ -n ${key[Delete]}  ]]  && bindkey  "${key[Delete]}"  delete-char
[[ -n ${key[Up]}      ]]  && bindkey  "${key[Up]}"      up-line-or-history
[[ -n ${key[Down]}    ]]  && bindkey  "${key[Down]}"    down-line-or-history
[[ -n ${key[Left]}    ]]  && bindkey  "${key[Left]}"    backward-char
[[ -n ${key[Right]}   ]]  && bindkey  "${key[Right]}"   forward-char
# Auto completion
autoload -U compinit promptinit
compinit
promptinit
prompt clint
zstyle ':completion::complete:*' use-cache 1
setopt HASH_LIST_ALL
# MIME
autoload -U zsh-mime-setup
zsh-mime-setup
# Calc
autoload -U zcalc
# Login
alias su="su - toor"

diff with root .zshrc:

--- -   2011-01-06 23:53:54.772440701 +0100
+++ .zshrc  2011-01-06 23:50:00.000000000 +0100
@@ -38,9 +38,5 @@
 zsh-mime-setup
 # Calc
 autoload -U zcalc
-# Editor
-export EDITOR=vim
-# Paludis
-alias background="schedtool -B -e"
-alias lowprio="nice -n 20 ionice -c 3"
-alias blowprio="ionice -c 3 schedtool -B -e nice -n 20"
+# Login
+alias su="su - toor"

Any ideas?

zsh version 2.3.11.

share|improve this question
    
^r is search right. in vi mode use enter command mode, and type / then search paramenter, enter, n or N to go forward and backwards. –  xenoterracide Jan 7 '11 at 13:16

1 Answer 1

up vote 7 down vote accepted

If you have $EDITOR = vi* or VISUAL = vi* when zsh starts up, zsh uses vi insertion mode as the default keymap. Otherwise zsh uses emacs mode. You presumably set EDITOR (or VISUAL) to vim in your init file, but have no such setting when running as root, so you're seeing the vi mode map, in which history search is on ^X r and ^X s.

Add bindkey -e to your .zshrc (or learn the vi map).

As usual, this is in the documentation (zshzle man page), but you have to know what you're looking for.

share|improve this answer
    
I read documentation on the web but it did not appear in placed I looked at. –  Maciej Piechotka Jan 7 '11 at 2:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.