Tab or Enter Through Parentheses and Quotes in Sublime Text
Add the following code to your Key Bindings > User file
[
// -------------------------------------------------------------------------
// Auto-complete behaviour for ), ], '', ""
// Bind to , to step over the auto-completed character(s)
// -------------------------------------------------------------------------
{ "keys": ["enter"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)\\]'\"]", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[(['\"]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)\\]'\"]", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[(['\"]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
}
]
The opening and closing square brackets are only necessary if you're not adding this to existing keybindings. If so, they should already be there. If they're not at the beginning and end of the file, add them.
Stolen From: http://codejury.com/fixing-some-of-sublime-texts-annoyances/
Written by Ryan Clark
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sublime text
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#