Centering lines in vi

Dan Siler dans at hplsla.HP.COM
Tue Sep 12 04:00:04 AEST 1989


> 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 at 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                           |
|_________________________________________________________________________|



More information about the Comp.unix.questions mailing list