Centering lines in vi

Joe Hamlin hamlin at blackbird.afit.af.mil
Thu Sep 14 14:10:37 AEST 1989


rostamia at 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    <hamlin at blackbird.afit.af.mil>



More information about the Comp.unix.questions mailing list