Mise à jour
Mise à jour de la base de données, veuillez patienter...
Site original : Sam & Max: Python, Django, Git et du cul
]
voire }
) juste à côté d’une AUTRE parenthèse fermante, le comportement de Sublime Text par défaut est de ne pas ajouter de parenthèse, mais d’avancer d’un caractère.
La raison est que Sublime ferme automatiquement toute parenthèse ouverte, cette fonctionnalité est donc là pour vous éviter de taper une parenthèse fermante de trop.
Je déteste cette fonctionnalité.
Je suis assez grand pour savoir quand insérer ma parenthèse ou non, et je n’ai pas Parkinson.
Heureusement, comme tout dans cet éditeur qu’il est merveilleux, c’est désactivable. Ouvrez “Preferences > Key Bindings – User” et ajoutez ceci à la configuration :
{ "keys": ["\""], "command": "insert", "args": {"characters": "\""}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true } ] }, { "keys": [")"], "command": "insert", "args": {"characters": ")"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true } ] }, { "keys": ["'"], "command": "insert", "args": {"characters": "'"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true } ] }, { "keys": ["]"],"command": "insert", "args": {"characters": "]"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true } ] }, { "keys": ["}"], "command": "insert", "args": {"characters": "}"}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true } ] }
Abracadabra !