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

Re: Collection issue: backslash after dash

Expand Messages
  • martinwguy
    ... Er, I thought vim was a reimplementation of vi. ... Mmm, sorry, I don t know what :se cp/nocp is. ... Hum, it sounds like you re putting your fists up. Bad
    Message 1 of 14 , Jan 4, 2013
    • 0 Attachment
      On 4 January 2013 14:34, Andy Wokula <anwoku@...> wrote:
      > Am 03.01.2013 09:51, schrieb martinwguy:
      >>> Is it a bug that '\' after '-' in a collection is taken literally?
      >> No, that's normal vi behaviour.
      > The context is Vim, not Vi:
      > :set nocp cpo&vim

      Er, I thought vim was a reimplementation of vi.

      >> \ is not special in a character range (it stands for itself) and to
      >> include ] you need to specify it as the first character in the range.
      >
      > Even with set 'cp', `\]' is still special. See:
      > :h cpo-\

      Mmm, sorry, I don't know what :se cp/nocp is.


      > Do you actually use Vi?

      Hum, it sounds like you're putting your fists up. Bad sign.
      Yes, since 1982 for all my work. I am also the maintainer for another
      vi clone, "xvi".
      Is that enough for you?

      >> In the example you give
      >> /[]@-\]
      >> (knowing that \ is the character previous to ])
      >
      > (my pattern `[@-\\]]' also made use of it)
      >
      > So far, it looks like if Vim just forgot to implement a certain case.
      > There is no apparent reason why `\]' is allowed for X but not for Y in
      > a [X-Y] collection.

      No, you're thinking that vi should do as you would expect according to
      your own thinking.
      That may be reasonable if we were designing a new editor, but vim is a
      vi clone, so needs to implement what vi, and the other dozen vi
      clones, do, so as not to break people's scripts.

      That said, it is open source, so you are free to take it, make the
      change you desire and suse your own version.

      Or take it up with Bill Joy in the 1970s, but fr that you will need a
      time machine...

      M

      --
      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
    • Gary Johnson
      ... It is. To a point. See ... There are a couple of ways that question could be read. I think Andy meant it as, Do you use vi and not Vim? , and I think
      Message 2 of 14 , Jan 4, 2013
      • 0 Attachment
        On 2013-01-04, martinwguy wrote:
        > On 4 January 2013 14:34, Andy Wokula wrote:
        > > Am 03.01.2013 09:51, schrieb martinwguy:
        > >>> Is it a bug that '\' after '-' in a collection is taken literally?
        > >> No, that's normal vi behaviour.
        > > The context is Vim, not Vi:
        > > :set nocp cpo&vim
        >
        > Er, I thought vim was a reimplementation of vi.

        It is. To a point. See

        :help design-compatible
        :help vi-differences

        > >> \ is not special in a character range (it stands for itself) and to
        > >> include ] you need to specify it as the first character in the range.
        > >
        > > Even with set 'cp', `\]' is still special. See:
        > > :h cpo-\
        >
        > Mmm, sorry, I don't know what :se cp/nocp is.

        :help 'cp'

        > > Do you actually use Vi?
        >
        > Hum, it sounds like you're putting your fists up. Bad sign.
        > Yes, since 1982 for all my work. I am also the maintainer for another
        > vi clone, "xvi".
        > Is that enough for you?

        There are a couple of ways that question could be read. I think
        Andy meant it as, "Do you use vi and not Vim?", and I think you
        took it as, "Do you know how to use vi?"

        Regards,
        Gary

        --
        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
      • Andy Wokula
        ... Yep, I meant the former. Vim added the backslash for escaping within a collection, but it does so inconsistently. This has nothing to do with Vi. -- Andy
        Message 3 of 14 , Jan 7, 2013
        • 0 Attachment
          Am 04.01.2013 22:22, schrieb Gary Johnson:
          > On 2013-01-04, martinwguy wrote:
          >> On 4 January 2013 14:34, Andy Wokula wrote:
          >>> Am 03.01.2013 09:51, schrieb martinwguy:
          >>>>> Is it a bug that '\' after '-' in a collection is taken literally?
          >>>> No, that's normal vi behaviour.
          >>> The context is Vim, not Vi:
          >>> :set nocp cpo&vim
          >>
          >> Er, I thought vim was a reimplementation of vi.
          >
          > It is. To a point. See
          >
          > :help design-compatible
          > :help vi-differences
          >
          >>>> \ is not special in a character range (it stands for itself) and to
          >>>> include ] you need to specify it as the first character in the range.
          >>>
          >>> Even with set 'cp', `\]' is still special. See:
          >>> :h cpo-\
          >>
          >> Mmm, sorry, I don't know what :se cp/nocp is.
          >
          > :help 'cp'
          >
          >>> Do you actually use Vi?
          >>
          >> Hum, it sounds like you're putting your fists up. Bad sign.
          >> Yes, since 1982 for all my work. I am also the maintainer for another
          >> vi clone, "xvi".
          >> Is that enough for you?
          >
          > There are a couple of ways that question could be read. I think
          > Andy meant it as, "Do you use vi and not Vim?", and I think you
          > took it as, "Do you know how to use vi?"

          Yep, I meant the former.

          Vim added the backslash for escaping within a collection, but it does so
          inconsistently. This has nothing to do with Vi.

          --
          Andy

          --
          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
        • martinwguy
          ... OK, my bad. I didn t know that vim was becoming deliberately non-backward-compatible with standard vi. Good luck resolving this issue in whatever way you
          Message 4 of 14 , Jan 7, 2013
          • 0 Attachment
            > Vim added the backslash for escaping within a collection, but it does so
            > inconsistently. This has nothing to do with Vi.

            OK, my bad. I didn't know that vim was becoming deliberately
            non-backward-compatible with standard vi.

            Good luck resolving this issue in whatever way you think best

            M

            --
            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
          Your message has been successfully submitted and would be delivered to recipients shortly.