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

Re: automatically starting line with #

Expand Messages
  • Piet Delport
    ... The relevant setting should be the c flag in formatoptions (and the b:# entry in comments , but that should practically always be there anyway).
    Message 1 of 6 , May 1 10:34 AM
    • 0 Attachment
      On Thu, 01 May 2003 at 10:23:23 -0700, Mark Davis wrote:
      >
      > I have two installations of vim, both are version 6.1. When using one
      > of them, if I start a line with '#', and then type enough characters
      > that the line wraps around, the '#' (and a space) gets added
      > automatically at the beginning of subsequent lines. On the other,
      > this doesn't happen. I assume this is just an option one can set, but
      > I can't find anything about this on the FAQ.
      >
      > I'm using vim on Windows XP Home; one version is the standard download
      > from the site; the other came wrapped with an installation of Cygwin.
      > It's the latter that automatically adds the '#'.

      The relevant setting should be the "c" flag in 'formatoptions' (and the
      "b:#" entry in 'comments', but that should practically always be there
      anyway). Check that ftplugins, .vimrc's, or system vimrc's aren't
      setting that option differently.

      --
      Piet Delport
      Today's subliminal thought is:
    • Herr Christian Wolfgang Hujer
      ... Hash: SHA1 ... Hi mark, try :help formatoptions and :help fo-table to find out more. As you see there, it s the flag insert current comment leader for
      Message 2 of 6 , May 1 10:40 AM
      • 0 Attachment
        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        Am Donnerstag, 1. Mai 2003 19:23 schrieb Mark Davis:
        > I have two installations of vim, both are version 6.1. When using one
        > of them, if I start a line with '#', and then type enough characters
        > that the line wraps around, the '#' (and a space) gets added
        > automatically at the beginning of subsequent lines. On the other, this
        > doesn't happen. I assume this is just an option one can set, but I
        > can't find anything about this on the FAQ.
        >
        > I'm using vim on Windows XP Home; one version is the standard download
        > from the site; the other came wrapped with an installation of Cygwin.
        > It's the latter that automatically adds the '#'.

        Hi mark,

        try :help formatoptions and :help fo-table to find out more.
        As you see there, it's the flag "insert current comment leader" for option
        "formatoptions", which can be activated using :set formatoptions+=ro

        I hope this is what you have been looking for.


        Bye
        - --
        ITCQIS GmbH
        Christian Wolfgang Hujer
        Geschäftsführender Gesellschafter
        Telefon: +49 (0)89 27 37 04 37
        Telefax: +49 (0)89 27 37 04 39
        E-Mail: Christian.Hujer@...
        WWW: http://www.itcqis.com/
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.0.7 (GNU/Linux)

        iD8DBQE+sVwdzu6h7O/MKZkRAnCRAJwPoe4eAvlfXOKDtFB4mtgXc7RIpQCeIjAr
        zmmbmDBI2ovppfrBxuaE8FY=
        =/MIl
        -----END PGP SIGNATURE-----
      • Scott LaBounty
        Mark, Check the formatoptions ... on both machines. You probably want at least the c option and probably others. Scott LaBounty Nexa Technologies, Inc. ...
        Message 3 of 6 , May 1 10:43 AM
        • 0 Attachment
          Mark,

          Check the formatoptions

          :set formatoptions
          :help formatoptions
          :help fo-table

          on both machines. You probably want at least the 'c' option and probably
          others.

          Scott LaBounty
          Nexa Technologies, Inc.

          -----Original Message-----
          From: Mark Davis [mailto:mark@...]
          Sent: Thursday, May 01, 2003 10:23 AM
          To: vim@...
          Subject: automatically starting line with #


          I have two installations of vim, both are version 6.1. When using one
          of them, if I start a line with '#', and then type enough characters
          that the line wraps around, the '#' (and a space) gets added
          automatically at the beginning of subsequent lines. On the other, this
          doesn't happen. I assume this is just an option one can set, but I
          can't find anything about this on the FAQ.

          I'm using vim on Windows XP Home; one version is the standard download
          from the site; the other came wrapped with an installation of Cygwin.
          It's the latter that automatically adds the '#'.

          Mark Davis
        • Gary Johnson
          ... The option you are looking for is formatoptions and the particular flag giving you problems is c . See ... This is odd, because the default value of
          Message 4 of 6 , May 1 10:48 AM
          • 0 Attachment
            On 2003-05-01, Mark Davis <mark@...> wrote:
            > I have two installations of vim, both are version 6.1. When using one
            > of them, if I start a line with '#', and then type enough characters
            > that the line wraps around, the '#' (and a space) gets added
            > automatically at the beginning of subsequent lines. On the other, this
            > doesn't happen. I assume this is just an option one can set, but I
            > can't find anything about this on the FAQ.

            The option you are looking for is 'formatoptions' and the particular
            flag giving you problems is 'c'. See

            :help formatoptions
            :help fo-table

            > I'm using vim on Windows XP Home; one version is the standard download
            > from the site; the other came wrapped with an installation of Cygwin.
            > It's the latter that automatically adds the '#'.

            This is odd, because the default value of 'formatoptions' is "tcq",
            so I would expect the "standard download" to use that default.
            Maybe it's being changed by a filetype plugin.

            HTH,
            Gary

            --
            Gary Johnson | Agilent Technologies
            garyjohn@... | Wireless Division
            | Spokane, Washington, USA
          • Antoine J. Mechelynck
            ... to see where an option has been last set, do ... i.e., in this case, ... This should return the current value, and also (unless it was set from the
            Message 5 of 6 , May 1 2:55 PM
            • 0 Attachment
              Gary Johnson <garyjohn@...> wrote:
              > On 2003-05-01, Mark Davis <mark@...> wrote:
              > > I have two installations of vim, both are version 6.1. When using
              > > one of them, if I start a line with '#', and then type enough
              > > characters that the line wraps around, the '#' (and a space) gets
              > > added automatically at the beginning of subsequent lines. On the
              > > other, this doesn't happen. I assume this is just an option one
              > > can set, but I can't find anything about this on the FAQ.
              >
              > The option you are looking for is 'formatoptions' and the particular
              > flag giving you problems is 'c'. See
              >
              > :help formatoptions
              > :help fo-table
              >
              > > I'm using vim on Windows XP Home; one version is the standard
              > > download from the site; the other came wrapped with an installation
              > > of Cygwin. It's the latter that automatically adds the '#'.
              >
              > This is odd, because the default value of 'formatoptions' is "tcq",
              > so I would expect the "standard download" to use that default.
              > Maybe it's being changed by a filetype plugin.
              >
              > HTH,
              > Gary
              >
              > --
              > Gary Johnson | Agilent Technologies
              > garyjohn@... | Wireless Division
              > | Spokane, Washington, USA

              to see where an option has been last set, do

              :verbose set optionname?

              i.e., in this case,

              :verbose set formatoptions?

              This should return the current value, and also (unless it was set from the
              keyboard) something like "Set from /path/to/file.vim" or "Set from modeline"
              (see :help modeline if you get the latter, to see what it means).

              HTH,
              Tony.
            Your message has been successfully submitted and would be delivered to recipients shortly.