Peter Hodge wrote:

> When I have formatoptions=t, it makes comment lines wrap when they
> shouldn't, and it also ignores whatever comment leader is defined in
> 'comments'.  To reproduce:
> 
> 
>   :set formatoptions=roc
>   :set comments=b:%
>   :set textwidth=30
> 
>   % type these lines of text
>   % as one line, and notice
>   % how Vim automatically
>   % wraps the lines and adds
>   % '%' at the start of each
>   % line.
> 
> Now remove 'c' from formatoptions and add 't'.
>   :set formatoptions-=c
>   :set formatoptions+=t
> From the help pages (:help fo-table)
>         t   Auto-wrap text using textwidth (does not apply to comments)
>         c   Auto-wrap comments using textwidth, inserting the current comment
>             leader automatically.
> With 'formatoptions' now set to 'rot', Vim should wrap normal text, but not
> comments.
> 
>   % but when you type this
>   next set of comments, Vim
>   will wrap them (when it
>   shouldn't, because they are
>   comments), and it will also
>   miss out the comment leader.
> 
> I hope it's clear what's going on here.  I'm running Vim 7 with
> patches 1-101.

When you remove "c" from 'formatoptions' Vim doesn't recognize comments,
thus everything is formatted as normal text.

I don't think there currently is a value for 'formatoptions' to only
format text that isn't comments.  Mostly because comments is text that
you normally want to format.

-- 
hundred-and-one symptoms of being an internet addict:
74. Your most erotic dreams are about cybersex

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to