Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bindings in .zshrc



I want M-p and M-n bound to history-beginning-search-backward and
history-beginning-search-forward respectively, but it doesn't seem to
work in recent versions of zsh.

Zsh version is 3.1.6-pws-12 from Debian potato.  A detailed recipe to
repeat the problem follows.

$ mkdir tst
$ cat > tst/.zshrc
echo start
bindkey '\ep' history-beginning-search-backward
bindkey '\en' history-beginning-search-forward
echo end
^D
$ ZDOTDIR=~/tst zsh
start
end
mraz% bindkey -e        # new zsh, use Emacs-style bindings
mraz% bindkey
...
"^[n" history-search-forward
"^[p" history-search-backward
...

Obviously, the bindings didn't take effect, although .zshrc is read.
If I type it manually, it works:

mraz% bindkey '\ep' history-beginning-search-backward
mraz% bindkey '\en' history-beginning-search-forward
mraz% bindkey 
...
"^[n" history-beginning-search-forward
"^[p" history-beginning-search-backward
...



Messages sorted by: Reverse Date, Date, Thread, Author