+Nikolai +Bram +Tim (authors of the majority of these plugins) I'm confident we can get consensus to at least remove a few of those formatoptions modifications. You should also add "setlocal formatoptions-=t" in pretty much every case (unless your syntax is fine with any arbitrary space being converted to a newline). ftplugin/python.vim should be setting -t, for instance.
FYI, these settings affect what happens when you set &textwidth to non-zero, so the problem usually only comes up when users want to set &textwidth and use &colorcolumn. David On Mon, Sep 30, 2013 at 10:27 AM, glts <[email protected]> wrote: > On Mon, Sep 30, 2013 at 9:57 AM, David Barnett <[email protected]> > wrote: > > I've found the built-in ftplugin files are all over the place with > respect to handling 'formatoptions'. Some ftplugins don't touch it, many > clobber useful user preferences. I put together a patch that batch-changes > the ftplugin files to stop clobbering anything that might be a user > preference. > > > > Rationale: Most 'formatoptions' options affect interactive editing > behavior that vim shouldn't manage per-filetype, and doesn't currently > manage consistently. > > > > The 't' option in particular seems like it could vary by filetype: it > does insane things for almost every filetype just blindly jamming in > newlines at a certain width, and should be forced disabled in most cases. > But for the text filetype or unspecified filetype, it makes perfect sense. > I think maybe it should never be explicitly enabled but should be > explicitly disabled for most filetypes. > > > > The 'o' and 'r' options determine whether to automatically insert the > comment leader when starting a new line after a comment line. I want +o -r > everywhere, but most ftplugin files force +croql, so I have to fight with > them by creating after/ files to force -r again. These weren't per-filetype > settings and should have been left alone. Same for 'l'. > > > > The 'c' option also seems like it never needs to vary by filetype > because comments are a specific case and there's no per-filetype reason you > would want to auto-wrap comments. > > > > Then there are some I'm not sure about. I don't understand the value of > ever disabling 'q', the option to 'Allow formatting of comments with "gq"'. > And 'm1' is set for certain filetypes like verilog… I don't follow if > that's because of something specific to verilog syntax, or if it's just the > authors' preferred configuration. > > I support this initiative. A bulk patch won't be accepted though. > > The line > > setlocal formatoptions-=t formatoptions+=croql > > has become boilerplate for ftplugins, but unlike settings such as > 'commentstring' or 'matchpairs' or whathaveyou, these are not settings > that pertain to the domain of the *file type*. They're user settings. > (By the way, see the comment in ftplugin/clojure.vim for a similar > sentiment!) > > If there is an agreement that the "+=croql" setting doesn't really > belong in a core ftplugin, I'll remove it from the one I maintain. > Hopefully others feel the same way: please speak up. > > Best, > > -- > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to a topic in the > Google Groups "vim_dev" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/vim_dev/EKDS1PP4rPo/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
