Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!know!samsung!munnari.oz.au!mullian!dtau From: dtau@mullian.ee.mu.oz.au (David Au) Newsgroups: comp.editors Subject: vi, word completion Message-ID: <4789@munnari.oz.au> Date: 11 Jul 90 00:57:45 GMT Sender: news@cs.mu.oz.au Reply-To: dtau@mullian.ee.mu.OZ.AU (David Au) Organization: Dept. of Electrical Engineering, University of Melbourne Lines: 53 In article <1990Jul10.151510.17011@sq.sq.com> lee@sq.sq.com (Liam R. E. Quin) writes: >dtau@mullian.ee.mu.OZ.AU (David Au) writes: >>The following is a slight improvement on the previously posted >>macro, but may be someone out there has a better solution: >> >>map! a. bbmmi?\<2h"zdt.@z >>map! a. bbdw`xnywmx`mPbea dwbis"zdt.x@z >>map! a. bbdw`xNywmx`mPbea dwbis"zdt.x@z > >This is not an improvement at all. It is a syntax error. :-( >The trick when posting these things is to use the two-character representation >with a caret (^) -- ^K, ^[, etc., rather than the actual control character. >If you don't do this, the network strips out most of the control characters, >and the vi macros don't work any more.... > >I'm not able to reconstruct this exactly, so I don't know if it's better, >but the "bb" near the beginning concerns me -- better to use 3h or 2h (which >depends on the missing control chars I think) -- in case there was >punctuation immediately to the left. I'm sorry about not paying attention to the control characters in the last posting. Here is what it should have looked like: map! ^K ^[a. ^[bbmmi?\<^[2h"zdt.@z^Mywmx`mPbea ^[dwbis^["zdt.x@z map! ^N ^[a. ^[bbdw`xnywmx`mPbea ^[dwbis^["zdt.x@z map! ^P ^[a. ^[bbdw`xNywmx`mPbea ^[dwbis^["zdt.x@z It is true that in the general case it is better to use hb instead of bb. In this case, because both the punctuation and the following space are intentionally appended, I thought it didn't matter as long as it works. So change it to hb if it makes anybody happier. An alternative to the above fix is as follows. The advantage of doing it this way I guest depends on the vi implementation that you are using. On the one that I'm using to write this posting, undo takes you back to ?\