Instead of doing something constructive, today, I decided to battle with my shell. I use ksh on OpenBSD and I want to achieve something relatively simple:
So it looks like a no brainer:
and vi command line editing should work. Well it does, but for some reason it disables feature (2), cursor keys for history.
Now, I can work around this a little by pressing ESC and then using 'j' and 'k' keys to go through the history, but I'd rather avoid this extra key press and my finger memory is already used to using the arrow keys.
Anyone got a solution?
- Be able to use the tab key for file and directory completion;
- Be able to use the up and down cursor/arrow keys to go through the command line history; and
- Be able to edit the command line using vi.
vi
Enable vi(1)-like command-line editing (interactive shells only).
vi-esccomplete
In vi command-line editing, do command and filename completion when escape (^[) is entered in command mode.
vi-tabcomplete
In vi command-line editing, do command and file name completion when tab (^I) is entered in insert mode. This is the default.
So it looks like a no brainer:
set -o vi
and vi command line editing should work. Well it does, but for some reason it disables feature (2), cursor keys for history.
Now, I can work around this a little by pressing ESC and then using 'j' and 'k' keys to go through the history, but I'd rather avoid this extra key press and my finger memory is already used to using the arrow keys.
Anyone got a solution?

Charles Darke | 2 June 2007