Xref: utzoo comp.unix.questions:29290 comp.terminals:2661 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!stanford.edu!msi.umn.edu!vixvax.mgi.com!cepek From: cepek@vixvax.mgi.com Newsgroups: comp.unix.questions,comp.terminals Subject: Re: Using a vt220 clone with unix vi? Message-ID: <1991Mar8.171343.825@vixvax.mgi.com> Date: 8 Mar 91 23:13:43 GMT References: <1991Mar7.012051.27038@csn.org> Organization: Management Graphics, Inc. Lines: 28 In article <1991Mar7.012051.27038@csn.org>, frechett@spot.Colorado.EDU (-=Runaway Daemon=-) writes: > In article pln@egret1.stanford.edu (Patrick L. Nolan) writes: >>I would like to know if there's a way to change termcap or tset or teach >>vi to deal with this sequence as if it was ESC. Or maybe to make >>the terminal send ESC, without giving up the rest of the VT220 >>keyboard mapping. > > Why not make vi recognize the difference. Here is an example while in vi: > Type this sequence. > :map! abc ^[ is . > So you will see > :map! abc ^[ When you are done. > What happens is that any time you type abc, it will send ESC to vi. This is an > easy thing to put in your .exrc file or just to type in. I suspect that the > sequence that pressing the ESC key sends is odd enough that you are not going > to just stumble on it some day while typing. Taking this one step further, why not choose as your "unique sequence" the characters that the "VT220" puts out when you press the ESC key? It likely puts out [ 2 3 ~ (five characters) instead of the character you want. I know nothing about vi, but wouldn't that do the trick? +----------------------------------+-----------------------------+ - - - - - - | Mike Cepek, Programmer/Analyst | Internet: CEPEK@MGI.COM | | Management Graphics, Inc. | Voice: +1 612/851-6112 | "Engage." | 1401 East 79th Street | Operator: +1 612/854-1220 | | Minneapolis, MN 55425 USA | Fax: +1 612/854-6913 | +----------------------------------+-----------------------------+ - - - - - -