Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

KSH history w/<esc>k

Status
Not open for further replies.

Stumpr

Technical User
Jan 2, 2004
1,178
US
How do I enble Ksh history in order to use <esc>k and be able to then use vi commands?


Bob Stump
VERITAS
"Ain't it the truth? Ain't it the truth?" Bert Lahr, Wizard of Oz 1939
 
The EDITOR environmental variable affects what editor is invoked in various cases, not how the command line itself behaves.

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
DOH!
I added to the .profile

EXPORT EDITOR=vi

it works. thanks to all.

Bob Stump
VERITAS
"Ain't it the truth? Ain't it the truth?" Bert Lahr, Wizard of Oz 1939
 
It's true that one learns something new everyday.

EDITOR works just as ogniemi describes, but only if VISUAL is not set. (VISUAL was set in my environment, so EDITOR had no effect)

To complicate things further, FCEDIT(old ksh) and HISTEDIT(ksh93) get into the act for the hist builtin if they are defined.

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
I put the line

VISUAL=/usr/bin/vi

in the file /etc/environment.
That way, any interactive ksh automatically enables the set -o vi option. Including subshells or shell escapes from vi or smit or whatever.


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top