--- Bram Moolenaar <[EMAIL PROTECTED]> wrote: > > 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.
OK, I understand now. Perhaps the fo-table docs should read: t Auto-wrap all text using textwidth. Comment leader is not inserted automatically unless 'c' is present also. Otherwise, it appears as though 't' should wrap everything except comments. "... (does not apply to comments)". regards, Peter ____________________________________________________ On Yahoo!7 Men's Health Radio: Chill out or work out, or just tune in http://au.launch.yahoo.com/mens-health-radio/index.html