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:
current result
then adds indent afterwards. causing me waste time , fix it.
desired result
this desired result after hitting enter:
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
Post a Comment