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

Syntax highlighting of IDL keywords

Expand Messages
  • Aleksandar Jelenak
    Dear All: I am trying to get proper syntax highlighting of keywords in IDL (ft=idlang). Here s an example: plot, x, /box, y, title= My Plot , z, $
    Message 1 of 1 , Apr 1, 2002
    • 0 Attachment
      Dear All:

      I am trying to get proper syntax highlighting of keywords in IDL
      (ft=idlang). Here's an example:

      plot, x, /box, y, title='My Plot', z, $
      xlabel='Degrees'

      IDL keywords in the above example are "box", "title" and "xlabel". I
      would like to highlight "/box", "title=" and "xlabel=".

      Syntax highlighting of the first two cases was trivial even for me:

      1) /box -> syn match group_name ",\s*/\h\w*"hs=s+1

      2) title= -> syn match group_name ",/s*\h\w*="hs=s+1

      However, I ran into problems with the third case (xlabel). The way I
      see it, properly highlighting a case like this requires examination of
      the previous line. If the line does not end with a ",\s*\$\s*$" pattern
      (the "$" sign is the line continuation character in IDL), then the
      "xlabel" line is just an ordinary assignment. But I did not know how to
      achieve this, despite quite an exhaustive syntax highlighting manual in
      Vim.

      I reckon I've spent enough time trying myself, so am seeking help now
      from Those Who Know More.

      Many thanks in advance.

      Aleksandar
    Your message has been successfully submitted and would be delivered to recipients shortly.