Sublime Text 3 includes two build systems you might be interested in: C++ and Make. The C++.sublime-build
file is as follows:
{
"shell_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",
"shell_cmd": "g++ "${file}" -o "${file_path}/${file_base_name}" && "${file_path}/${file_base_name}""
}
]
}
To use it, go to Tools -> Build System
and select C++
. You can now use CtrlB to run the build (top command), or CtrlShiftB to run the Run
variant.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…