Home Download Buy Blog Forum Support

Determine Syntax Element

Determine Syntax Element

Postby philomelus on Tue Sep 25, 2012 12:17 am

Is there a way to determine which syntax element is at the cursor? I used to use this feature of Emacs to update my indentation/coloring/etc. exactly the way I like, but I've been fighting with ST2 to do the same thing.

If not, is there some other way to make creating color syntax easier (I used to use synic from Vim, but translating it is making my eyes and fingers bleed!).
philomelus
 
Posts: 5
Joined: Tue Sep 25, 2012 12:13 am

Re: Determine Syntax Element

Postby philomelus on Tue Sep 25, 2012 12:20 am

Doh! I think I found it - the API has a function sublime.View.scope_name that appears to do it. I'll write some python and bind to a key so I can make it easy.
philomelus
 
Posts: 5
Joined: Tue Sep 25, 2012 12:13 am

Re: Determine Syntax Element

Postby bizoo on Tue Sep 25, 2012 7:58 am

bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Determine Syntax Element

Postby philomelus on Tue Sep 25, 2012 6:24 pm

Awesome! Saved me some time :-)

Thank you!
philomelus
 
Posts: 5
Joined: Tue Sep 25, 2012 12:13 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 18 guests