css - Sublime Text 3 indents an extra tab after hitting enter for only parentheses in javascript -


right now, working on project using reactjs in sublime text. whenever hit enter in between parentheses break line , add space. here's example:

initial start

the cursor in middle, hit enter:

enter image description here

current result

then adds indent afterwards. causing me waste time , fix it.

enter image description here

desired result

this desired result after hitting enter:

enter image description here

thank in advance!

open preferences -> key bindings-user , add following:

{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context":     [         { "key": "setting.auto_indent", "operator": "equal", "operand": true },         { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },         { "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },         { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }     ] } 

if file empty, add square brackets [ ] around key binding , save. if file has other custom key bindings, paste @ beginning after opening bracket [, , make sure add comma , after make sure file valid json.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -