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

Syntax Detection

Expand Messages
  • jason heddings
    Is it possible to determine (based on the cursor location) which syntax elements are being matched? i.e. if I were editing a C++ file and the cursor were in a
    Message 1 of 4 , Sep 1, 2005
    • 0 Attachment
      Is it possible to determine (based on the cursor location) which syntax
      elements are being matched?

      i.e. if I were editing a C++ file and the cursor were in a string, I might
      press a key to see "String,Constant" etc.

      Thanks,
      --jah
    • Nikolai Weibull
      ... Enjoy, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
      Message 2 of 4 , Sep 1, 2005
      • 0 Attachment
        jason heddings wrote:

        > Is it possible to determine (based on the cursor location) which
        > syntax elements are being matched?

        :echo synIDattr(synID(line('.'), col('.'), 0), 'name')

        Enjoy,
        nikolai

        --
        Nikolai Weibull: now available free of charge at http://bitwi.se/!
        Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
        main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
      • Charles E. Campbell, Jr.
        ... Take a look at: How to tell what syntax highlighting group *that* is! : http://vim.sourceforge.net/tips/tip.php?tip_id=99 Regards, Chip Campbell
        Message 3 of 4 , Sep 2, 2005
        • 0 Attachment
          jason heddings wrote:

          >Is it possible to determine (based on the cursor location) which syntax
          >elements are being matched?
          >
          >i.e. if I were editing a C++ file and the cursor were in a string, I might
          >press a key to see "String,Constant" etc.
          >
          >

          Take a look at: "How to tell what syntax highlighting group *that* is!":

          http://vim.sourceforge.net/tips/tip.php?tip_id=99

          Regards,
          Chip Campbell
        • jason heddings
          Works like a charm... Especially the script... ... From: Charles E. Campbell, Jr. [mailto:drchip@campbellfamily.biz] Sent: Friday, 02 September, 2005 13:50
          Message 4 of 4 , Sep 2, 2005
          • 0 Attachment
            Works like a charm... Especially the script...



            -----Original Message-----
            From: Charles E. Campbell, Jr. [mailto:drchip@...]
            Sent: Friday, 02 September, 2005 13:50
            To: jason heddings
            Cc: vim@...
            Subject: Re: Syntax Detection

            jason heddings wrote:

            >Is it possible to determine (based on the cursor location) which syntax
            >elements are being matched?
            >
            >i.e. if I were editing a C++ file and the cursor were in a string, I
            >might press a key to see "String,Constant" etc.
            >
            >

            Take a look at: "How to tell what syntax highlighting group *that* is!":

            http://vim.sourceforge.net/tips/tip.php?tip_id=99

            Regards,
            Chip Campbell
          Your message has been successfully submitted and would be delivered to recipients shortly.