Home Download Buy Blog Forum Support

Bind newline macro with semicolon

Bind newline macro with semicolon

Postby seith on Mon Apr 01, 2013 4:57 pm

I want bind a ctrl+enter macro, that in C++, PHP and javascript adds at the end of line semicon and creates new line under the current line. But I don't want this behave in HTML. Is it possible?
Posts: 1
Joined: Mon Apr 01, 2013 4:51 pm

Re: Bind newline macro with semicolon

Postby skuroda on Tue Apr 02, 2013 1:41 am

If you can define the scope selector properly I don't see why not. Here is an example of the close tag feature in ST3.
Code: Select all
   { "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
         { "key": "selector", "operator": "equal", "operand": "text.html, text.xml", "match_all": true },
         { "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
         { "key": "setting.auto_close_tags" }

What you really care about in this example is the "selector" key in "context".
Posts: 692
Joined: Fri Oct 05, 2012 8:11 am

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 23 guests