That does the trick for me. Thanks a lot! I’m ready to get a license now.
I didn’t add in the part for indents, because I can always revert to command + and ] to do highlight indents.
EDIT: I added it and doesn’t seem to work for me when I do single line indents (select a whole line that doesn’t have a line ending, and press tab). I think it’s because of the regex “\n” part.
{ "keys": "tab"], "command": "insert", "args": {"characters": "\t"} },
{ "keys": "tab"], "command": "reindent", "context":
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
]
},
{ "keys": "tab"], "command": "indent", "context":
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
]
},
{ "keys": "tab"], "command": "next_field", "context":
{ "key": "has_next_field", "operator": "equal", "operand": true }
]
}
]
Changing “\n” to “.” works.
YEAHHHHH!!!