杂项 sublime编译系统
一 \(~~\) c++编辑环境
新建编译系统
”编译-编译系统-新建编译系统“ 新建一个编译系统,命名为“C++.sublime-build”,删除所有代码后复制为:
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["cmd", "/c", "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "cmd", "/c", "${file_path}/${file_base_name}"]
},
{
"name": "RunInCommand",
"cmd": ["cmd", "/c", "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & pause"]
}
]
}
绑定快捷键
完成上步之后,已经可以用ctrl+shift+b选择编译方式了。要想更加方便一些:按ctrl+b仅编译、按ctrl+f11编译并运行,可以通过绑定快捷键达到。
“首选项-快捷键设置”,在配置中添加
{ "keys": ["ctrl+f11"], "command": "build", "args": {"variant": "RunInCommand"} },
完成!
二 \(~~\) python编辑环境
新建编译系统
”编译-编译系统-新建编译系统“ 新建一个编译系统,命名为“Python3.sublime-build”,删除所有代码后复制为:
{
"cmd": ["python","-u","$file"],
"selector": "source.python",
"file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name":"RunInCMD",
"shell": true,
"cmd": ["start","cmd","/c", "python $file &echo. & pause"],
"working_dir": "${file_path}",
}
]
}
绑定快捷键
“首选项-快捷键设置”,在配置中添加
{ "keys": ["ctrl+f11"], "command": "build", "args": {"variant": "RunInCMD"} },
标签:name,cmd,快捷键,file,path,编译系统,sublime
From: https://www.cnblogs.com/ticmis/p/17015902.html