一:下载安装
http://www.sublimetext.com/(官网)
二:MinGW
建议下载Devc++(腾讯软件中心下载即可),直接用包里面的。
三:环境
将Devc++中的bin目录的路径添加到系统环境的path变量中。
四:Sublime
进入sublime,Tools->Build System->New Build System
将下面代码存为"C++.sublime-build",路径默认。
{
"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 \""
}
]
}
选择C++
Tools->Build System->C++
Ctrl+Shift+b(二选一)
C++ - Run (显示在sublime界面)
C++ - RunlnCmd (显示窗口)