On Sat, Dec 23, 2000 at 11:59:45AM -0800, Brian Frederick Kimball wrote: > Brian Frederick Kimball wrote: > > > If it's nvi (the default vi on Debian), you want "set wraplen=NN" in > > your $HOME/.exrc. But nvi is pretty slim on features-- it doesn't even > > have multi-level undo. Better to just install vim & vim-rt and put "set > > textwidth=NN" in your $HOME/.vimrc. > > Oh, and if you have trouble with your paragraph formatting (as I did > when I used nvi), that is, > if your > paragraphs end up looking > like this > because you tried to revised them, > > install the par package, put > export PARINIT='rTbgqR B=.?_A_a Q=_s>|' > in your $HOME/.bashrc and execute it on the command line, and then you > can type "!(motion)par NN" in vi to reformat your text. (motion) should > be replaced with whatever key(s) represents the portion of the document > that you want to reformat-- if just to the end of the current paragraph, > try "}", if the current cursor position to the bottom of the document, > try "G", if the whole document, try "1G", etc. Also note that this vi > command doesn't start with ":". > > As always, man nvi and man par for details. > > Or install vim & vim-rt and use the builtin "gq(motion)" command which > accomplishes much the same thing.
in VIM, you can reformat a paragraph that looks like this using an obtuse four-keystroke command: enter the paragraph to re-flow (vim, remember, this is VIM) and then enter gqip and the whole paragraph will rearrange itself, based on your current 'textwidth' setting. or you can use the 'visual' (v or V or ^V) select mode first, and then 'gq' to format what you've selected. [it also nicely accomodates leading quotation, as in > this stuff > right here everything will re-wrap just as if you'd done it by hand, with leading whitespace and punctuation maintained.] see :help gq in vim for more info. (^Wq to get out of help.) -- There are only two places in the world where time takes precedence over the job to be done. School and prison. --William Glasser [EMAIL PROTECTED] *** http://www.dontUthink.com/ volunteer to document your experience for next week's newbies -- http://www.eGroups.com/messages/newbieDoc