Sublime Text 3 C++ 配置
先将MinGW\bin
添加至环境变量中,然后打开Sublime Text,菜单Tools->Build System->New Build System...
{
// "shell_cmd": "make"
"encoding": "utf-8",
"working_dir": "$file_path",
"shell_cmd": "g++ -Wall -std=c++0x \"$file_name\" -o \"$file_base_name\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.cpp",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ -Wall -std=c++0x \"$file\" -o \"$file_base_name\" && \"${file_path}/${file_base_name}\""
},
{
"name": "RunInCmd",
"shell_cmd": "g++ -Wall -std=c++0x \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause \""
}
]
}
两种模式,Run
直接在Sublime Text中输出;RunInCmd
则弹出cmd窗口
Ctrl+B
Build,Ctrl+Shift+B
切换模式