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

Re: svnlog filetype autodetection

Expand Messages
  • Benjamin Fritz
    I m guessing that: ... should be: if getline(1) =~ /^- {72 }$/ setfiletype svnlog endif Note the extra to make a {... } group, specifying a line of 72 -
    Message 1 of 6 , Jul 1, 2008
    • 0 Attachment
      I'm guessing that:

      On 7/1/08, Adam Monsen <haircut@...> wrote:
      > if getline(1) =~ /^-\{72}$/
      > setfiletype svnlog
      > endif
      >

      should be:

      if getline(1) =~ /^-\{72\}$/
      setfiletype svnlog
      endif

      Note the extra \ to make a \{...\} group, specifying a line of 72 '-'
      characters.

      Apparently this is a common occurrence in svn log files or something.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Benjamin Fritz
      ... Oh, and also enclose it in single quotes instead of / characters to make it a string, like this: ^- {72 }$
      Message 2 of 6 , Jul 1, 2008
      • 0 Attachment
        On 7/1/08, Benjamin Fritz <fritzophrenic@...> wrote:
        > I'm guessing that:
        >
        >
        > On 7/1/08, Adam Monsen <haircut@...> wrote:
        > > if getline(1) =~ /^-\{72}$/
        > > setfiletype svnlog
        > > endif
        > >
        >
        >
        > should be:
        >
        >
        > if getline(1) =~ /^-\{72\}$/
        > setfiletype svnlog
        > endif
        >
        >
        > Note the extra \ to make a \{...\} group, specifying a line of 72 '-'
        > characters.
        >
        > Apparently this is a common occurrence in svn log files or something.
        >

        Oh, and also enclose it in single quotes instead of '/' characters to
        make it a string, like this:

        '^-\{72\}$'

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Gary Johnson
        ... According to :help / { , the } is not necessary--just } will suffice. Regards, Gary --~--~---------~--~----~------------~-------~--~----~ You received
        Message 3 of 6 , Jul 1, 2008
        • 0 Attachment
          On 2008-07-01, Benjamin Fritz <fritzophrenic@...> wrote:
          > I'm guessing that:
          >
          > On 7/1/08, Adam Monsen <haircut@...> wrote:
          > > if getline(1) =~ /^-\{72}$/
          > > setfiletype svnlog
          > > endif
          > >
          >
          > should be:
          >
          > if getline(1) =~ /^-\{72\}$/
          > setfiletype svnlog
          > endif
          >
          > Note the extra \ to make a \{...\} group, specifying a line of 72 '-'
          > characters.

          According to ":help /\{", the \} is not necessary--just } will
          suffice.

          Regards,
          Gary


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Benjamin Fritz
          ... Oh, so it can...I missed that somehow. Cool. It does need to be a string though, rather than surrounding it with / .
          Message 4 of 6 , Jul 1, 2008
          • 0 Attachment
            On 7/1/08, Gary Johnson <garyjohn@...> wrote:
            >
            > On 2008-07-01, Benjamin Fritz <fritzophrenic@...> wrote:
            > > I'm guessing that:
            > >
            > > On 7/1/08, Adam Monsen <haircut@...> wrote:
            > > > if getline(1) =~ /^-\{72}$/
            > > > setfiletype svnlog
            > > > endif
            > > >
            > >
            > > should be:
            > >
            > > if getline(1) =~ /^-\{72\}$/
            > > setfiletype svnlog
            > > endif
            > >
            > > Note the extra \ to make a \{...\} group, specifying a line of 72 '-'
            > > characters.
            >
            >
            > According to ":help /\{", the \} is not necessary--just } will
            > suffice.
            >

            Oh, so it can...I missed that somehow. Cool.

            It does need to be a string though, rather than surrounding it with '/'.

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Adam Monsen
            ... Awesome! That worked. Thank you! I ll send a patch to the maintainer of svnlog.vim, in case he s interested. -- Adam Monsen
            Message 5 of 6 , Jul 1, 2008
            • 0 Attachment
              On Jul 1, 11:35 am, "Benjamin Fritz" wrote:
              > enclose it in single quotes instead of '/' characters to
              > make it a string, like this:
              >
              > '^-\{72\}$'

              Awesome! That worked. Thank you!

              I'll send a patch to the maintainer of svnlog.vim, in case he's
              interested.

              --
              Adam Monsen
              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.