Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!dans From: dans@hplsla.HP.COM (Dan Siler) Newsgroups: comp.unix.questions Subject: Re: Centering lines in vi Message-ID: <5520004@hplsla.HP.COM> Date: 11 Sep 89 18:00:04 GMT References: <2283@umbc3.UMBC.EDU> Organization: HP Lake Stevens, WA Lines: 21 > Does anyone know a combination of commands that will center a given line > (or better yet, a range of lines) in vi? > > Rouben Rostamian Phone: 301 455-2458 I think your best bet is to use an external text formatting command. My system has a command called "adjust" that I call from a key macro when I want to center a line: map ^V^O ^!}exec adjust -c^M When I type CTRL-V CTRL-O, the current line is centered. Hope this helps. Dan _________________________________________________________________________ | | | Dan Siler unix: dans%hplsla@hplabs.hp.com hplabs!hplsla!dans | | Hewlett Packard | | Lake Stevens Instrument Division, ms:380 at&t: (206) 335-2178 | | 8600 Soper Hill Road; Everett, WA 98205-1298 | |_________________________________________________________________________|