Sublime имеет такое поведение, которое действительно раздражает, когда вам приходится вводить конструкции с большим количеством скобок. Когда вы набираете (
, он добавляет ()
и помещает курсор в середину, все отлично, если вы, однако, наберете )
, он беззвучно проглотит закрывающую скобку.
Это очень раздражает при наборе длинных регулярных выражений, потому что скобки становятся неуравновешенными довольно быстро, и это сводит меня с ума. Таким образом, вы получаете такие конструкции, как (([a-z])
.
Итак, вопрос в том, есть ли способ отключить это? Если я напечатаю закрывающий кронштейн, я хочу, чтобы он остался, не проглатывался.
Я проверил через Sublime configs, googled, но никто, кажется, не возражает против этого поведения. Я использую это неправильно?
Обновление
Возможно, вы захотите проверить Sublime: Jump out of matching brackets.
Полная версия, которая позволяет вам вводить текст с помощью ()
, но не будет проглатывать символ закрытия, если вы ввели какой-либо текст:
{ "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 },
{ "key": "preceding_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 },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[^(]$", "match_all": true }
]
},
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "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 },
{ "key": "preceding_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 },
{ "key": "preceding_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 },
{ "key": "preceding_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 },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }
]
}