Sublime的一些设置
一、 Ctags的安装和设置
- 在sublime中借助install package自动安装ctags插件
- 在网上下载ctags的压缩包(其中有ctags.exe文件),解压到文件夹中
- 将ctags.exe的路径添加到ctags的setting-user中:e.g.
"command": "I:/Programming_tool/SublimeText3/ctags58/ctags"
- 在key building-user中绑定自己喜欢的快捷键
二、一些键的绑定,包括自动跳出括号、双引号、单引号
- Ctags快捷键:
/* Ctags 快捷键绑定 */
{
"command": "navigate_to_definition",
"keys": ["ctrl+]"]
},
{
"command": "search_for_definition",
"keys": ["ctrl+y"]
},
{
"command": "jump_prev",
"keys": ["ctrl+t"]
},
{
"command": "rebuild_tags",
"keys": ["ctrl+r"]
},
// 显示文件所有函数
{
"command": "show_symbols",
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
],
"keys": ["alt+s"]
},
// 显示工程所有函数
{
"command": "show_symbols",
"args": {"type": "lang"},
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
],
"keys": ["ctrl+alt+shift+s"]
},
// 显示工程所有函数和数据类型
{
"command": "show_symbols",
"args": {"type": "multi"},
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
],
"keys": ["alt+shift+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": "not_regex_match", "operand": "^.*\\{$", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
}