Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!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: 14 Mar 91 15:04:57 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: 58 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-[, after which you can define ESC-O-[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='^P' \ __B='^N' \ __C='^F' \ __D='^B' \ __P='^[^[' \ __Q='^[=' \ __R='^[*' \ __S='^[' --- part of .profile end --- In the above abstract from my .profile all the real control characters have of course been replaced by representations. To make it really work, you'd have to replace them by the real thing. __[A-D] are my cursor keys, which produce ESC-[-[A-D] and __[P-S] are my function keys, which produce ESC-O-[P-S]: they work wonders 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