Path: utzoo!news-server.csri.toronto.edu!rutgers!dimacs.rutgers.edu!seismo!uunet!mcsun!hp4nl!rulway.LeidenUniv.nl!rulcvx!crissl From: crissl@rulcvx.LeidenUniv.nl (Stefan Linnemann) Newsgroups: comp.unix.shell Subject: Re: Use of function keys for common comands at the ksh prompt. Message-ID: Date: 13 Mar 91 09:08:53 GMT References: <1991Feb17.235721.20854@shibaya.lonestar.org> <1991Mar5.053405.12750@cs.ucla.edu> <54479@sequent.UUCP> Sender: root@rulway.LeidenUniv.nl (System PRIVILEGED Account) Organization: Leiden University, Netherlands Lines: 51 Nntp-Posting-Host: rulcvx.leidenuniv.nl In <54479@sequent.UUCP> edw@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@rulcvx.LeidenUniv.nl