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

Re: Unicode matchpairs not possible?

Expand Messages
  • Tony Mechelynck
    ... It is documented under :help matchpairs : Currently only single byte character pairs are allowed, and they must be different . What is or isn t a
    Message 1 of 4 , Jul 3, 2012
    • 0 Attachment
      On Jul 1, 7:27 pm, Axel Kielhorn <v...@...> wrote:
      > Hi!
      >
      > I'm using:
      >
      > VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun  4 2012 19:19:42)
      > MacOS X (unix) version
      > Included patches: 1-531
      >
      > The default matchpairs are:
      > matchpair(:),{:},[:]
      >
      > I can
      > :set mps+=<:>
      >
      > to add a new matchpair, but I can't
      >
      > :set mps+=«:»
      > or
      > :set mps+=‹:›
      >
      > I get
      > E474: Invalid argument: mps+=‹:›
      >
      > Shouldn't Vim accept any unicode character?
      >
      > Axel

      It is documented under ":help 'matchpairs'":

      "Currently only single byte character pairs are allowed, and they must
      be different".

      What is or isn't a single-byte character depends on how characters are
      represented in memory (i.e. the global 'encoding' option), not on disk
      (the buffer-local 'fileencoding'). If 'encoding' is set to "utf-8",
      only the 128 lowest codepoints are single-byte, so you can add <:>
      (0x3C 0x3E) but not «:» (0xAB 0xBB) and not ‹:› (U+2039 U+203A). If
      'encoding' is set to Latin1, only the lowest 256 Unicode codepoints
      can be represented in memory, each as a single byte, so in that case
      you can add «:» but you cannot even represent ‹:› in memory (in any
      buffer, since 'encoding' is a global option).

      Best regards,
      Tony.

      --

      Economists state their GNP growth projections to the nearest tenth of
      a
      percentage point to prove they have a sense of humor.
      -- Edgar R. Fiedler

      --
      You received this message from the "vim_mac" 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
    • Axel Kielhorn
      ... Thanks, I somehow missed that. Maybe I should transform » and « to and
      Message 2 of 4 , Jul 3, 2012
      • 0 Attachment
        Am 03.07.2012 um 14:17 schrieb Tony Mechelynck:

        > It is documented under ":help 'matchpairs'":
        >
        > "Currently only single byte character pairs are allowed, and they must
        > be different".

        Thanks, I somehow missed that.

        Maybe I should transform » and « to >> and << while editing and convert it back when writing the file. It's easier to type that way, which is another bonus.

        Axel

        --
        You received this message from the "vim_mac" 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
      • Tony Mechelynck
        ... Maybe you could, but in that case beware that having unpaired less- than and greater-than signs (as in mathematics) will confuse Vim when trying to find
        Message 3 of 4 , Jul 5, 2012
        • 0 Attachment
          On Jul 3, 6:14 pm, Axel Kielhorn <v...@...> wrote:
          > Am 03.07.2012 um 14:17 schrieb Tony Mechelynck:
          >
          > > It is documented under ":help 'matchpairs'":
          >
          > > "Currently only single byte character pairs are allowed, and they must
          > > be different".
          >
          > Thanks, I somehow missed that.
          >
          > Maybe I should transform » and « to >> and << while editing and convert it back when writing the file. It's easier to type that way, which is another bonus.
          >
          > Axel

          Maybe you could, but in that case beware that having unpaired less-
          than and greater-than signs (as in mathematics) will confuse Vim when
          trying to find the mate of a << or >> marker. And of course you won't
          be able to use << for "much less than" and >> for "much greater than"
          or similar.

          Best regards,
          Tony.

          --

          Whom computers would destroy, they must first drive mad.

          --
          You received this message from the "vim_mac" 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.