Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.editors Subject: Re: map the space bar Message-ID: <11034@dog.ee.lbl.gov> Date: 17 Mar 91 21:01:18 GMT References: <984@uncw.UUCP> <2878@gould.doc.ic.ac.uk> <5108@lure.latrobe.edu.au> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 44 X-Local-Date: Sun, 17 Mar 91 13:01:18 PST In article <5108@lure.latrobe.edu.au> ECSGRT@lure.latrobe.edu.au (GEOFFREY TOBIN, ELECTRONIC ENGINEERING) writes: >Hold everything! Is Alexios accurate in stating that mapping >a key [in vi] will change its INTERNAL usage? This is correct. The list of such keys is: $ a i u \ _ r l (this is for `Version 3.7, 6/7/85.'). The reason is that vi implements a few commands by `pushing back' some keys you never typed. For instance, typing `~' makes vi pretend you typed r, , , where is the character under the cursor, with its case inverted if it is a letter, and the appears if there is a character after the cursor. Thus, if you :map l h and type tilde in the middle of a line, vi will flip case and back up. At the end of the line, vi will flip case and stay put. At the beginning of a line, vi will flip case and beep at you. This is just a symptom of a much greater underlying disease: vi's internal design is a mess, largely because of the way vi was written. Sometime in or around the 1970s, Bill Joy & co decided to extend the ed editor; this became `ex' (the `extended' editor). Then they added screen capabilities, invented termcap, added more stuff, ran out of room on the PDP-11, chipped and hacked to fit, etc. At some point Mark Horton took over development. Eventually he left; since then there have been only minor changes at Berkeley (no one is doing any `serious' development anymore). There is, however, an external design, and vi works as it does not just `because that was the way Bill Joy set it up'. For instance, the original `delete line' command was `d_'; the original yank line command was `y_'; and so forth. The concept of `stuttering' on a key came later. The external design changes are part of the reason that the internals are such a mess. -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov