Use of function keys for common comands at the ksh prompt.
Stefan Linnemann
crissl at rulcvx.LeidenUniv.nl
Wed Mar 13 19:08:53 AEST 1991
In <54479 at sequent.UUCP> edw at sequent.UUCP (Ed Wright) writes:
>%>I would like to use my function keys (F1-F8) to save keystrokes.
>%>My keyboard generates "ESC O c-j" for F1-F8 respectively.
>Go to the shelf and get the book.
>The manual for your terminal should tell you haow to program the
>F keys.
>Thank god each terminal appears to be different! (:-)/2)
>THis is often a task that involves doing things that are not obvious
>and sometimnes frustrating.
>TVI-950s are easy
>HP700s are less so
You don't have to reprogram your terminal function keys. Just use
the emacs command line editor and map ESC-O to ESC-ESC, after which
you can define ESC-[c-j] as aliases for whatever you fancy. You'd
have to use __[c-j] as the alias names, but that's no problem.
The following lines are from my .profile:
--- part of .profile start ---
# make sure the emacs command line editor is used, independant of $EDITOR
export VISUAL=emacs
# set up aliases, functions and variables
alias -x _O='[' \
__A='' \
__B='' \
__C='' \
__D='' \
__P='' \
__Q='=' \
__R='*' \
__S=''
--- part of .profile end ---
__[A-D] are my cursor keys, which produce ESC-ESC-[A-D] and
__[P-S] are my function keys: they work like wonder for me.
>It can be done.
>Have fun
>Ed
>--
> I think I've got the hang of it now .... :w :q :wq :wq! ^d X exit
> X Q :quitbye CtrlAltDel ~~q :~q logout save/quit :!QUIT ^[zz
> ^[ZZ ZZZZ ^H ^@ ^L ^[c ^# ^E ^X ^I ^T ? help helpquit ^D ^d
> ^C ^c helpexit ?Quit ?q decwrl or uunet or tek !sequent!edw
It's been done.
Good luck!
Stefan.
Stefan M. Linnemann, System programmer; Leiden University, the Netherlands.
crissl at rulcvx.LeidenUniv.nl
More information about the Comp.unix.shell
mailing list