Home Download Buy Blog Forum Support

Macro for triggering full-buffer syntax format?

Macro for triggering full-buffer syntax format?

Postby orion2480 on Thu Jun 28, 2012 6:54 pm

I am using Submlime Text 2 to do a lot of JavaScript writing/editing. One feature I love in Visual Studio 2010 is that, upon entering a ; or a terminating }, the buffer is formatted for indentation, etc (only works if there are no syntax errors). I'd like to do the same with Sublime. I have the JsFormatter plugin installed, and bound to a key, but am not sure how to go about triggering this action whenever a ; or } are pressed.
orion2480
 
Posts: 1
Joined: Thu Jun 28, 2012 6:50 pm

Re: Macro for triggering full-buffer syntax format?

Postby C0D312 on Thu Jun 28, 2012 7:09 pm

http://docs.sublimetext.info/en/latest/ ... acros.html

Just create a macro that:
- inserts }
- activates jsformat

then bind that to }

repeat for ;
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 40 guests