On Sat, 5 May 2007, openbsd fan wrote:

> I am still coming up short here. I have consulted the online man pdksh and
> google but I can't solve the problem of having a command line history and
> navigating the command line.
> 
> In my /etc/profile I have:
> 
> <snip>
> export EDITOR=/usr/bin/vi
> export ENV=/etc/ksh.kshrc
> export HISTFILE=$HOME/.sh_history
> export HISTSIZE=128
> </snip>
> 
> In my customized /etc/ksh.kshrc (not the default Openbsd ksh.kshrc) I have:
> 
> <snip>
> set -a
> set -o vi
> </snip>
> 
> <snip>
> bind '^[['=prefix-2
> bind '^XA'=up-history
> bind '^XB'=down-history
> bind '^XC'=forward-char
> bind '^XD'=backward-char
> bind '^A'=beginning-of-line
> bind '^E'=end-of-line
> </snip>
> 
> $ echo $TERM
> vt220

Hmm, I see you are using vi mode in ksh. Th example given in the man
page applies to emacs mode. I never use vi mode in ksh, so I can't
help you much. 

Of course the basic command history stuff works with the real vi motion
keys: escape-k followed by more k's and j's.

        -Otto

> 
> I am not sure what I am doing wrong to not have a command line history.  How
> can I test the bind pdksh keys?
> 
> # bind
> 
> only gives you what available keys are available, not confirmation that
> they, in fact, are working...
> 
> On 5/5/07, Otto Moerbeek <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > On Sat, 5 May 2007, openbsd fan wrote:
> > 
> > > Reviewing the man pages I noted that vi == nvi.
> > >
> > > When I open a file and issue an :map command I get the following:
> > >
> > > ^A     ^
> > > ^K     d$
> > > ^[0A  k
> > > ^[0B  j
> > > ^[0C  l
> > > ^[0D  h
> > > ^[[2~ i
> > > ^[[3~ x
> > >
> > > <snip>
> > >
> > > Where is this file being sourced from?  I created an ~/.exrc file, and
> > tried
> > > to map the Home and End keys.  (These keys have been created in my
> > > /etc/X11/xinit/.Xresources file as have the Insert/Delete/PgUp/PgDn
> > keys.)
> > 
> > These are not fixed mappings. The termcap/terminfo entry for the
> > current terminal is used to create them. For the code, see
> > usr.bin/vi/cl/cl_term.c.
> > 
> >         -Otto
> > 
> > >
> > > They show up when I do
> > >
> > > :map
> > >
> > > from within nvi but are not being used when I am in command mode.
> > >
> > > I mapped:
> > >
> > >  ^[[1~ 0 // home
> > >  ^[[4~ $ // eol
> > >
> > > I want to try adding these keys to the file where the other default
> > mappings
> > > are coming from.  I can't seem to find anything that would tell me where
> > to
> > > find this file in on Openbsd.  I also consulted O'Reilly's Learning Vi
> > book
> > > before writing @misc.
> > >
> > > Please help.  Thanks.
> > >
> > > Openbsd fan.

Reply via email to