Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.editors Subject: Re: vi for power users Message-ID: <1371:Dec1108:11:4090@kramden.acf.nyu.edu> Date: 11 Dec 90 08:11:40 GMT References: <1005@langtry.cs.utexas.edu> <109909@convex.convex.com> Organization: IR Lines: 58 Here's my favorite macro (like Tom's ^O): map! ^[6 ^[o {^M.^M}^[ks Starting from insert mode it puts in a pair of braces in my favorite style and leaves the cursor in the middle. If you don't like two-space indents with half-indented braces you'll have to change the macro a bit. map ^A o $^[kJ$r 073l? ^Ms^M^[$xx0 Split a line properly at 72 characters (from the left margin), leaving the cursor on the second half of the line and beeping if the second line is blank. A lot faster than fmt, though on a slow connection you may not like the screen bounce. map ^[7c amain(argc,argv)^Mint argc;^Mchar *argv[];^M{^M}^[O The generic program starter. I have a couple more like this to handle other common drudgery. map ^[7u 0/@^Mr%A@uunet.uu.net^[ How to quickly munge a To: line for dumb mailers. I actually have it insert brnstnd@nyu.edu as well. set autoindent autoprint noautowrite nobeautify directory=/tmp noedcompatible noerrorbells hardtabs=8 noignorecase nolisp nolist magic mesg nonumber nooptimize prompt noreadonly redraw remap report=5 shiftwidth=8 noshowmatch noslowopen tabstop=8 taglength=0 noterse notimeout warn wrapscan wrapmargin=8 nowriteany (All on one line.) I get sick of working on different configurations, so this has all the settings I care about. In article <109909@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes: > set nomesg > " because being talked to during an edit is aggravating Oh? This is only because talkd is insane. I get a pleasant notice on my status line when someone tries to talk. > map! ^V^[OC ^V^[lli That doesn't work at the end of a line. > set modelines Dangerous. > " my figners have dyslexia > ab covnex convex > ab Covnex Convex > ab versino version Yeah. I'd never give up alias jbs jobs in csh, or variable Mail set to mail. ---Dan