Last Updated: February 25, 2016
·
2.854K
· iamryo

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/