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

Syntax file development

Expand Messages
  • Valter Sundström
    Hi, I am trying to modify the fs.vim syntax file to support separate syntax groups for types and functions. The syntax for a simple type declaration is this:
    Message 1 of 3 , Aug 1, 2010
    • 0 Attachment
      Hi,
      I am trying to modify the fs.vim syntax file to support separate syntax
      groups for types and functions.
      The syntax for a simple type declaration is this: type [A-Za-z0-9]\+[ \t]*=

      The problem I am having is that "type" is a keyword that is already
      highlighted as such, which overrides the syn matches I have tried writing.

      How do I approach this correctly?

      --
      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
    • Ben Fritz
      On Aug 1, 1:25 pm, Valter Sundström ... Since you re already editing the distributed syntax file (something generally frowned
      Message 2 of 3 , Aug 2, 2010
      • 0 Attachment
        On Aug 1, 1:25 pm, Valter Sundström <valter.sundst...@...>
        wrote:
        > Hi,
        > I am trying to modify the fs.vim syntax file to support separate syntax
        > groups for types and functions.
        > The syntax for a simple type declaration is this:  type [A-Za-z0-9]\+[ \t]*=
        >
        > The problem I am having is that "type" is a keyword that is already
        > highlighted as such, which overrides the syn matches I have tried writing.
        >
        > How do I approach this correctly?

        Since you're already editing the distributed syntax file (something
        generally frowned upon), you may as well just remove the keyword match
        and make it a 'match' instead. Keywords always take precedence over
        matches and regions no matter what order they are defined in.

        --
        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
      • Charles Campbell
        ... Instead of editing the distributed syntax file in-place, leave it alone -- and * make a copy in ~/.vim/syntax * edit that copy That way the next update to
        Message 3 of 3 , Aug 2, 2010
        • 0 Attachment
          Ben Fritz wrote:
          >
          > On Aug 1, 1:25 pm, Valter Sundström<valter.sundst...@...>
          > wrote:
          >
          >> Hi,
          >> I am trying to modify the fs.vim syntax file to support separate syntax
          >> groups for types and functions.
          >> The syntax for a simple type declaration is this: type [A-Za-z0-9]\+[ \t]*=
          >>
          >> The problem I am having is that "type" is a keyword that is already
          >> highlighted as such, which overrides the syn matches I have tried writing.
          >>
          >> How do I approach this correctly?
          >>
          > Since you're already editing the distributed syntax file (something
          > generally frowned upon), you may as well just remove the keyword match
          > and make it a 'match' instead. Keywords always take precedence over
          > matches and regions no matter what order they are defined in.
          >
          >
          Instead of editing the distributed syntax file in-place, leave it alone
          -- and

          * make a copy in ~/.vim/syntax
          * edit that copy

          That way the next update to vim doesn't wipe your work out, and your
          version takes precedence and thus blocks the distributed copy from
          taking effect.

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