Sublime Text3 配置C/C++11开发环境

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
	"cmd": ["bash", "-c", "g++ -Wall -std=c++11 -O2 '${file}' -o '${file_path}/${file_base_name}' && osascript -e 'tell application \"Terminal\" to activate do script \" cd \\\"${file_path}\\\" &&start_ms=\\$(ruby -e \\\"puts (Time.now.to_f * 1000).to_i\\\")&&clear&&\\\"${file_path}/${file_base_name}\\\" &&elapsed_ms=\\$((\\$(ruby -e \\\"puts (Time.now.to_f * 1000).to_i\\\") - start_ms))&& read -p \\\"Press Enter to exit(\\$elapsed_ms ms).\\\"&&exit\"'"],
 	"file_regex": "^(..{FNXX==XXFN}*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",
	"variants":
	[
		{
			"name": "Run",
			"cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
		}
	]
}