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

RE: History Up key

> I have been using zsh-3.0.8 until yesterday, when I decided to switch to
> zsh-4.0.1-pre2. I have one problem, which I want to report. It
> might be an old
> story, but I am not aware of it:
> I am using vi key binding. When I want to repeare my repeat command, I used
> to hit the "cursor-up" key, see the last command and hit enter. The
> fact that I
> am at vi-insert-mode still allowed the binding of "cursor-up" to
> "up-line-or-history".
> However, upgrading to zsh 4, the binding apparently disappeared,
> and I have to
> hit the escape key before the cursor-up to go into vi-command-mode. I think
> this behavior is the same as in bash, but I find it a little
> annoying. Is this
> intentional? Is there any setting I can  do to have the old behavior?

bindkey -M viins $terminfo[kcuu1] up-line-or-history

replace $terminfo[kcuu1] with your favorite cursor-up esc sequence; I was lazy
to look it up. Actually, the above is quite portable (better is probably
${terminfo[kcuu1]-some fallback}, but I'm not sure if it really works).

I believe, change was deliberate, but I forgot the reasons ... it was really
long time - I think over three years. And I switched over to emacs binding
long ago (but have been using something similar before).

Anyway, in vi mode (bindkey -v) you have two keymaps - viins (for input) and
vicmd (for command mode). To change key binding use 'bindkey -M <keymap>'


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