[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] vim text wrapping



On Thu, Mar 17, 2011 at 10:26:51AM -0400, Philippe LeCavalier wrote:
> Hi All.
> 
Hi there.

> This is more of a vim question than it is a sup one but I'm not a
> member of the vim list so I thought I'd ask you guys first.
> 
> Since I don't write very well I always end up making changes while
> re-reading myself. When I edit a line Vim doesn't wrap anymore like it
> did when I first typed the text. So all the lines I've edited aren't
> wrapped like the others. It can make reading my mail challenging at
> times.
> 
For the sake of others:
If you want Vim to fold lines as you newly write them, just run
:set textwidth=72  # set tw=72 for short

If you want Vim to reformat the text when you edit it, just run
:set formatoptions+=a
or add it to your vimrc, etc.

This is explained in Vim help,
:help textwidth
:help ins-textwidth
:help formatoptions
:help fo-table

If you don't want this to happen all the time (as I don't),
you can use the gq operator discretionally.
gq <movement>, e.g.:
gq}     reflow till the end of the paragraph
gqap    reflow the whole paragraph

> Perhaps I'm misunderstanding how to properly edit text in vim?
> 
A minor tweak and you are done.

Hope that it helps.

Happy hacking,

-- 
pancho horrillo

To be conscious that
you are ignorant is a great step
to knowledge.

		Benjamin Disraeli
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk