Sublime自动补齐括号后如何快速跳出

来源:互联网 发布:佛山各区签约大数据 编辑:程序博客网 时间:2024/04/30 04:54

在使用Sublime编辑器时,有自动补齐功能,补齐后要跳出常用的做法是去移动光标,这样操作比较麻烦,效率也慢,如下提供一种方式,稍做配置,可以实现补齐输入后,直接按Enter回车键快速跳出。

打开Sublime Text;
菜单栏 –>Preferences –> Key Bindings;
打开后,key-map-User中的中括号里边,输入如下文本,保存。

{"keys": ["enter"], "command": "move", "args": {"by": "characters", "forward": true}, "context":    [        { "key": "following_text", "operator": "regex_contains", "operand": "^[)\\]\\>\\'\\\"\\}\\;\\,]", "match_all": true },        { "key": "preceding_text", "operator": "not_regex_match", "operand": "^.*[\\[\\{]$", "match_all": true  },        { "key": "auto_complete_visible", "operator": "equal", "operand": false }    ]}