Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!sdd.hp.com!spool.mu.edu!uunet!mcsun!cernvax!chx400!chx400!bernina!neptune!iiic.ethz.ch!wyle From: wyle@iiic.ethz.ch (Mitchell Wyle) Newsgroups: comp.editors Subject: Re: aligning columns in vi Keywords: columns, vi, stress Message-ID: <24231@neptune.inf.ethz.ch> Date: 9 Feb 91 13:34:08 GMT References: <4868@male.EBay.Sun.COM> Sender: news@neptune.inf.ethz.ch Reply-To: wyle@iiic.ethz.ch (Mitchell Wyle) Organization: Departement Informatik, ETH, Zurich Lines: 36 In article <4868@male.EBay.Sun.COM> The manager of information systems for Sun Microsystems' Eastern Headquarters, Carl Johnson, with e-mail address: carl@mugwump.EBay.Sun.COM tells us: > In vi what I want to do is align certain characters into the same > column. For instance :- > /*codecodecodecodecode */ > /*codecodecodecodecodecodecodecodecodecodecodecodeco */ > /*codecodecodecodecodecodecodecodecodecode */ > some command like :1,$s/\/\*/>>\/\*/ ?? > would end up aligned so :- > /*codecodecodecodecode */ > /*codecodecodecodecodecodecodecodecodecodecodecodeco */ > /*codecodecodecodecodecodecodecodecodecode */ > Use indent(1), Carl. Indent does it better than vi macros. Set up a file ~/.indentpro and send all your coders' code through indent. Read your MAN PAGES for the program cb (C beautifier). It tells us to use indent. When my students deliver code formatted in a style I don't like, I use indent. When I write block comments, I usually do something like: /* comments lots of code or comments */ But then again, "De gustebus non est disputandem."