Xref: utzoo comp.editors:933 comp.unix.questions:16318 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!lll-winken!ncis.tis.llnl.gov!blackbird!hamlin From: hamlin@blackbird.afit.af.mil (Joe Hamlin) Newsgroups: comp.editors,comp.unix.questions Subject: Re: Centering lines in vi Message-ID: <1345@blackbird.afit.af.mil> Date: 14 Sep 89 04:10:37 GMT References: <2283@umbc3.UMBC.EDU> Organization: Air Force Institute of Technology; WPAFB, OH Lines: 20 rostamia@umbc3.UMBC.EDU (Rouben Rostamian) writes: >Does anyone know a combination of commands that will center a given line >(or better yet, a range of lines) in vi? The following macro seems to work just fine. These painful-to-read lines were centered with it. map v $ma81a ^[81^V|D`alld0:s/ / /g^M$p^M Note: "^[" is entered as CTRL-V ESC "^V" as CTRL-V CTRL-V, "^M" as CTRL-V CTRL-M. -- Joe Hamlin