Forked from koulmomo/sublime_text_2_perfect_key_bindings
Created
August 3, 2016 22:32
-
-
Save ccnixon/c39852742ccc45eb4419c4588854e3d6 to your computer and use it in GitHub Desktop.
Perfect Sublime Text 2 Key Bindings. Tab to skip out of brackets, braces, parentheses, and quotes/quotations but still be able to indent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// Move out of common paired characters () and [] with `Tab` | |
{ | |
"keys": ["tab"], | |
"command": "move", | |
"args": {"by": "characters", "forward": true}, | |
"context": [ | |
{"key": "auto_complete_visible", "operand": false}, | |
// Check if next char matches (followed by anything) | |
{ "key": "following_text", "operator": "regex_match", "operand": "(:?`|\\)|\\]|\\}).*", "match_all": true }, | |
// ...and that there is a paid character before it on the same | |
// line. This lets you `tab` to Indent at lines with single ]s | |
// still, like in a JSOn file | |
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(:?`|\\(|\\[|\\{)", "match_all": true } | |
] | |
}, | |
// Move out of single and double quotes with `Tab` | |
{ | |
"keys": ["tab"], | |
"command": "move", | |
"args": {"by": "characters", "forward": true}, | |
"context": [ | |
{"key": "auto_complete_visible", "operand": false}, | |
{ "key": "following_text", "operator": "regex_match", "operand": "(?:\"|').*", "match_all": true }, | |
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?:\"|')", "match_all": true } | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment