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

suggestion: User syntax cluster

Expand Messages
  • Benji Fisher
    I am sometimes frustrated that I cannot change syntax highlighting the way I want because the characters I want to affect are already contained in another
    Message 1 of 7 , Feb 1, 2002
    • 0 Attachment
      I am sometimes frustrated that I cannot change syntax highlighting the
      way I want because the characters I want to affect are already contained in
      another syntax group. If the syntax maintainer "contains" syntax clusters
      then I can add my groups to these clusters, but (1) not all syntax maintainers
      do this and (2) AFAIK the default syntax groups do not contain any clusters.
      This just came up again on the vim users' list: 'listchars' are contained in
      the SpecialKey group, and I would like to highlight trailing spaces so that
      they are invisible in the current line.

      I propose adding a User cluster that is automatically contained in every
      syntax group. Maybe for vim 6.2? Any comments?

      --Benji Fisher
    • Bram Moolenaar
      ... Can t you use the containedin argument? :help :syn-containedin -- hundred-and-one symptoms of being an internet addict: 136. You decide to stay in a
      Message 2 of 7 , Feb 1, 2002
      • 0 Attachment
        Benji Fisher wrote:

        > I am sometimes frustrated that I cannot change syntax highlighting the
        > way I want because the characters I want to affect are already contained in
        > another syntax group. If the syntax maintainer "contains" syntax clusters
        > then I can add my groups to these clusters, but (1) not all syntax maintainers
        > do this and (2) AFAIK the default syntax groups do not contain any clusters.
        > This just came up again on the vim users' list: 'listchars' are contained in
        > the SpecialKey group, and I would like to highlight trailing spaces so that
        > they are invisible in the current line.
        >
        > I propose adding a User cluster that is automatically contained in every
        > syntax group. Maybe for vim 6.2? Any comments?

        Can't you use the "containedin" argument? ":help :syn-containedin"

        --
        hundred-and-one symptoms of being an internet addict:
        136. You decide to stay in a low-paying job teaching just for the
        free Internet access.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • KONTRA Gergely
        ... Ok, but please patch vim so with set lists in the current line it doesn t hurt me, pls +-[Kontra, Gergely @ Budapest University of Technology and
        Message 3 of 7 , Feb 1, 2002
        • 0 Attachment
          >Can't you use the "containedin" argument? ":help :syn-containedin"

          Ok, but please patch vim so with set lists in the current line it
          doesn't hurt me, pls

          +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
          | Email: CHANGED! kgergely@... kgergely@... (old) |
          | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
          +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
          .
          Magyar php mirror es magyar php dokumentacio: http://hu.php.net
        • Bram Moolenaar
          ... Sorry, I don t understand this sentence. -- hundred-and-one symptoms of being an internet addict: 143. You dream in pallettes of 216 websafe colors. ///
          Message 4 of 7 , Feb 1, 2002
          • 0 Attachment
            Kontra Gergely wrote:

            > >Can't you use the "containedin" argument? ":help :syn-containedin"
            >
            > Ok, but please patch vim so with set lists in the current line it
            > doesn't hurt me, pls

            Sorry, I don't understand this sentence.

            --
            hundred-and-one symptoms of being an internet addict:
            143. You dream in pallettes of 216 websafe colors.

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          • Benji Fisher
            ... Thanks, I did not know about that feature. (This is new in vim 6.0, right?) But either I am using it wrong, or it does not work correctly. I think this
            Message 5 of 7 , Feb 1, 2002
            • 0 Attachment
              On Friday, February 1, 2002, at 10:39 AM, Bram Moolenaar wrote:

              >
              > Benji Fisher wrote:
              >
              >> I am sometimes frustrated that I cannot change syntax
              >> highlighting the
              >> way I want because the characters I want to affect are already
              >> contained in
              >> another syntax group. If the syntax maintainer "contains" syntax
              >> clusters
              >> then I can add my groups to these clusters, but (1) not all syntax
              >> maintainers
              >> do this and (2) AFAIK the default syntax groups do not contain any
              >> clusters.
              >> This just came up again on the vim users' list: 'listchars' are
              >> contained in
              >> the SpecialKey group, and I would like to highlight trailing spaces so
              >> that
              >> they are invisible in the current line.
              >>
              >> I propose adding a User cluster that is automatically contained
              >> in every
              >> syntax group. Maybe for vim 6.2? Any comments?
              >
              > Can't you use the "containedin" argument? ":help :syn-containedin"

              Thanks, I did not know about that feature. (This is new in vim
              6.0, right?) But either I am using it wrong, or it does not work
              correctly. I think this example will clarify another cryptic comment on
              this thread: I try

              :set list listchars=trail:-
              :syn match Space " " containedin=SpecialKey contained
              :hi link Space Error

              (This is for testing. My goal is to use a pattern that matches trailing
              spaces on the current line, and I want to link to Ignore instead of
              Error, so that trailing spaces are not visible as I add them to the
              current line.)

              I think the above commands should make spaces appear as "-"
              characters with Error highlighting. Either I am doing something wrong,
              or vim is, because it does not work.

              --Benji Fisher
            • Bram Moolenaar
              ... SpecialKey isn t a syntax group, only a highlight group. There are no syntax items defined for SpecialKey (well, you could define them, but none of the
              Message 6 of 7 , Feb 1, 2002
              • 0 Attachment
                Benji Fisher wrote:

                > > Can't you use the "containedin" argument? ":help :syn-containedin"
                >
                > Thanks, I did not know about that feature. (This is new in vim
                > 6.0, right?) But either I am using it wrong, or it does not work
                > correctly. I think this example will clarify another cryptic comment on
                > this thread: I try
                >
                > :set list listchars=trail:-
                > :syn match Space " " containedin=SpecialKey contained
                > :hi link Space Error
                >
                > (This is for testing. My goal is to use a pattern that matches trailing
                > spaces on the current line, and I want to link to Ignore instead of
                > Error, so that trailing spaces are not visible as I add them to the
                > current line.)
                >
                > I think the above commands should make spaces appear as "-"
                > characters with Error highlighting. Either I am doing something wrong,
                > or vim is, because it does not work.

                SpecialKey isn't a syntax group, only a highlight group. There are no
                syntax items defined for SpecialKey (well, you could define them, but
                none of the existing syntax file have one). You need a syntax group in
                which your "Space" item is matched in. ":syntax" lists them all.

                --
                hundred-and-one symptoms of being an internet addict:
                152. You find yourself falling for someone you've never seen or hardly
                know, but, boy can he/she TYPE!!!!!!

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
              • KONTRA Gergely
                ... So: Please patch vim to turn off highlighting (at the cursor), if possible. Thx Gergo +-[Kontra, Gergely @ Budapest University of Technology and
                Message 7 of 7 , Feb 4, 2002
                • 0 Attachment
                  >> >Can't you use the "containedin" argument? ":help :syn-containedin"
                  >>
                  >> Ok, but please patch vim so with set lists in the current line it
                  >> doesn't hurt me, pls
                  >
                  >Sorry, I don't understand this sentence.

                  :) I don't understand it either.
                  So: Please patch vim to turn off highlighting (at the cursor), if
                  possible.

                  Thx
                  Gergo
                  +-[Kontra, Gergely @ Budapest University of Technology and Economics]-+
                  | Email: CHANGED! kgergely@... kgergely@... (old) |
                  | URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
                  +-------"Olyan langesz vagyok, hogy poroltoval kellene jarnom!"-------+
                  .
                  Magyar php mirror es magyar php dokumentacio: http://hu.php.net
                Your message has been successfully submitted and would be delivered to recipients shortly.