A
A
Artem2015-05-19 11:57:16
Sublime Text
Artem, 2015-05-19 11:57:16

How to get inside the brackets immediately with an indent by pressing Enter?

Hi all. Straight to the point - with curly ones everything works fine, with square ones there is a problem. For Google, I could not adequately formulate the request. I hope they help here.
606793e8559c429eaeabc84d567cc6b3.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zuev, 2015-05-19
@peakweb

Preferences->Key Bindings-User and add

{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "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 }
    ]
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question