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

Re: about formatoptions

Expand Messages
  • Salman Halim
    ... $VIMRUNTIME/ftplugin/c.vim: setlocal fo-=t fo+=croql Create your own ftplugin/c.vim file in &rtp/after. Also, look at ... Salman -- -- You received this
    Message 1 of 4 , Jun 12, 2013
    • 0 Attachment



      On Wed, Jun 12, 2013 at 10:49 AM, wangjun850725 <wangjun850725@...> wrote:
      hi:
      I set
      set formatoptions-=o
      or
      set formatoptions=crql
      or
      autocmd BufRead *.c  set formatoptions-=o
      in _vimrc file, it all don't work
       
      why?
       
      best
            regards

      --


      $VIMRUNTIME/ftplugin/c.vim:

      setlocal fo-=t fo+=croql

      Create your own ftplugin/c.vim file in &rtp/after.

      Also, look at

      :help 'rtp'
      :help after-directory
      :help ftplugin

      Salman

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Ben Fritz
      ... Probably because you have filetype plugins turned on, and the C filetype plugin sets formatoptions for you. Use autocmd FileType c or a set
      Message 2 of 4 , Jun 12, 2013
      • 0 Attachment
        On Wednesday, June 12, 2013 9:49:22 AM UTC-5, jun wang wrote:
        > hi:
        >
        > I set
        >
        >
        >
        > set formatoptions-=o
        >
        > or
        >
        > set formatoptions=crql
        >
        > or
        >
        > autocmd BufRead *.c  set formatoptions-=o
        >
        > in _vimrc file, it all don't work
        >
        >  
        >
        > why?
        >

        Probably because you have filetype plugins turned on, and the C filetype plugin sets formatoptions for you.

        Use "autocmd FileType c" or a "set formatoptions" command in ~/.vim/after/ftplugin/c.vim instead to override the ftplugin settings.

        http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.3

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ben Fritz
        ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more information,
        Message 3 of 4 , Jun 12, 2013
        • 0 Attachment
          On Wednesday, June 12, 2013 10:01:37 AM UTC-5, Ben Fritz wrote:
          >
          > or a "set formatoptions" command in ~/.vim/after/ftplugin/c.vim

          You said "_vimrc file" so actually you are problem on Windows. On Windows the path to the file should be $HOME\vimfiles\after\ftplugin\c.vim instead. Ask Vim what it sees as the $HOME directory with:

          :echo $HOME

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.