[plug] formatting plain text in vi/vim

Greg Gamble gregg at maths.uwa.edu.au
Wed Mar 1 09:44:25 WST 2000


Hi,

  I know this isn't quite the place for this ... but perhaps
one of you can point me to the right M (and perhaps place in M) 
so I can RTFM.
  I am a die-hard vi/vim user (sorry, I hate emacs ... I
know what I'm asking for, can be done with emacs). What I want
to do is balance lines and right adjust them (by insertion of
white space) so they are flush on the right. I seem to be able
to do one or other, but not both via shell escapes:

  fmt ... balances up lines to any width you like, but doesn't
          insert white space between words so that lines are
          flush on the right

  nroff -e ... inserts white space so that lines are flush on
               the right, but only seems to give a line width of
               65 columns (but I want 70 columns!??)

  So how do you get both? Is there a standard UNIX tool, or
some filtering of a few tools? Is there an environment variable 
for nroff that will change the number of columns? (I couldn't
see one in the man pages).

  Also vim supplies 

     :<m>,<n>ri  to flush-right text,
     :<m>,<n>le  to flush-left text
     :<m>,<n>ce  to centre text

from lines <m> to <n> ... but as far as I can see won't insert
white space between words to get the lines flush on the right.
  Any ideas?

  By the way, many thanks for all the additional replies to the
modem + hum problem. One way or another it would seem to be a
problem only fixable by getting a competent Telstra technician
out ... and like Tony Clark, my money is on an earth leakage
problem of the cable down the street (that one reminded me of
a friend who had had *exactly* that problem).

  Regards,
  Greg Gamble <gregg at maths.uwa.edu.au>



More information about the plug mailing list