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

syntax region start and end patterns: "inherit" group above?

Expand Messages
  • Ben Klein
    I have a syntax region where I want the start and end patterns to basically be ignored, highlighting-wise. Thus e.g. if I have an expression marked with ${},
    Message 1 of 3 , Jul 17, 2014
      I have a syntax region where I want the start and end patterns to basically be ignored, highlighting-wise. Thus e.g. if I have an expression marked with ${}, and what is *contained* in the ${} should be highlighted, but the ${} is within a pair of quotes, the ${} characters should be highlighted as the quotes and the text in them is highlighted.

      "This is text with ${foo} in the middle of it."

      foo should be highlighted one way, and "This is text with ${", and "} in the middle of it" should be highlighted another way.

      How can I do this? I tried setting a matchgroup and also tried setting it to NONE, but either way it is not highlighted, whereas I'd like to have it "inherit" the highlighting of the "" text.

      Ben

      --
      b

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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Charles Campbell
      ... In your start and end patterns, use zs and ze appropriately. ... Regards, Chip Campbell -- -- You received this message from the vim_use maillist. Do
      Message 2 of 3 , Jul 17, 2014
        Ben Klein wrote:
        > I have a syntax region where I want the start and end patterns to
        > basically be ignored, highlighting-wise. Thus e.g. if I have an
        > expression marked with ${}, and what is *contained* in the ${} should
        > be highlighted, but the ${} is within a pair of quotes, the ${}
        > characters should be highlighted as the quotes and the text in them is
        > highlighted.
        >
        > "This is text with ${foo} in the middle of it."
        >
        > foo should be highlighted one way, and "This is text with ${", and "}
        > in the middle of it" should be highlighted another way.
        >
        > How can I do this? I tried setting a matchgroup and also tried setting
        > it to NONE, but either way it is not highlighted, whereas I'd like to
        > have it "inherit" the highlighting of the "" text.
        >
        >
        In your start and end patterns, use \zs and \ze appropriately.

        :he /\zs
        :he /\ze

        Regards,
        Chip Campbell

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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Ben Klein
        On Thu, Jul 17, 2014 at 1:03 PM, Charles Campbell
        Message 3 of 3 , Jul 17, 2014
          On Thu, Jul 17, 2014 at 1:03 PM, Charles Campbell <Charles.E.Campbell@...> wrote:
           
          In your start and end patterns, use \zs and \ze appropriately.

          Well now. That solves all kinds of my problems. Thanks!

          Ben

          --
          b

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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        Your message has been successfully submitted and would be delivered to recipients shortly.