On Fri, Apr 12, 2013 at 00:05, Stefan Olsson wrote:

> I usually do "set -o vi" in my .profile. In bash on OS/X it then works to
> go up and down in history with both j+k or up+down-keys. If I ssh to a
> OpenBSD host from my Mac, I can NOT use up+down in the shell (ksh), but it
> works fine in less or vi. It even works fine with up+down keys in bash on
> OpenBSD - so what do I need to do in ksh to make up+down-keys work (apart
> from doing "set -o emacs")??

You fix the code.

I was going to say maybe we just need some default keybindings for vi
mode, but a glance at the code reveals emacs and vi modes are
implemented totally separately. hurray! I suspect somewhere in
ksh/vi.c is a switch statement you could add the magic cases to for
arrow keys.

On the other hand, strictly speaking, vi doesn't support arrow keys.
vim in compatible mode or the stock vi on hpux (shudder) will just dump
control characters in your file for example. If you're going to be
hard core and use vi for command line editing, I'd say you should go
all in and only use hjkl too. :)

Reply via email to