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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aliasing keystrokes

Status
Not open for further replies.

Daedelus

Technical User
Aug 14, 2002
70
US
A common practice where I work is to alias the arrow keys as follows:
alias __A='^P' #up arrow=move back through history
alias __B='^N' #down arrow=move forward through history
alias __C='^F' #right arrow=move cursor forward one position
alias __D='^B' #left arrow=move cursor back one position

where the control characters must be entered by vi or some other editor, and preceding each letter is a double underscore.

I have also found that I can alias the "delete" and "home" keys by
alias __P='^D' #delete=delete character at cursor
alias __H='^A' #home=put cursor at start of the line

My question is: does anyone know how to alias the remaining keys?
Whereas typing &quot;\&quot; followed by any of the keys above produces the corresponding letter (e.g. \<delete> yields &quot;^[[P&quot;, &quot;\&quot; followed by the remaining keys yields various multi-character results (e.g. \<end> yields &quot;^[[146q&quot;)
and trying alias __146q='^E' does not work. The interface appears to demand only one character after the __ in the aliases?

Does anyone know what is going on here? And how to alias the remaining keys?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top