Loading ...
Sorry, an error occurred while loading the content.

73484Re: Patch: formatoptions in ftplugins

Expand Messages
  • glts
    Oct 2, 2013
    • 0 Attachment

      On Wed, Oct 2, 2013 at 12:52 PM, Bram Moolenaar <Bram@...> wrote:
      > David Barnett wrote:
      >> +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-=3Dt" 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.
      > I think we should make a difference between the case the user has not
      > set any formatting options and when he did. If there are no user
      > preferences, the user expects the filetype plugin to do it all. If the
      > user did set preferences, we should indeed avoid overruling these when
      > they are not specific for the filetype.
      > Once we agree, an explanation needs to be added to :help
      > write-filetype-plugin

      yes, that's a fair solution.

      However -- what worries me is that this requires even more boilerplate
      in all ftplugins. I understand your point about not changing what the
      user is used to, but I don't feel this way is a step forward really.

      What we could do to mitigate the impact on the users is make the setting
      "formatoptions+=croql" recommended boilerplate for everybody's vimrc:

      diff -r 20068068e3f9 runtime/vimrc_example.vim
      --- a/runtime/vimrc_example.vim Wed Oct 02 18:43:06 2013 +0200
      +++ b/runtime/vimrc_example.vim Wed Oct 02 20:38:15 2013 +0200
      @@ -31,6 +31,9 @@
      set showcmd " display incomplete commands
      set incsearch " do incremental searching

      +" Fine-tune how Vim formats comments and long lines. See ":help fo-table".
      +set formatoptions+=croql
      " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
      " let &guioptions = substitute(&guioptions, "t", "", "g")

      That way we could implement the change and just guide users to the new
      (and better) practice. What do you think about this solution? I'd love
      to see it happen.


      David B├╝rgin

      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 14 messages in this topic