2016.9.8更新:
linux(Ubuntu16.04)下的配置,編譯后用終端運行,解決了不能輸入的問題
{ "encoding": "utf-8", "working_dir": "$file_path", "shell_cmd": "g++ \"$file_name\" -o \"$file_base_name\"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.c++", "variants": [ { "name": "Run", "shell_cmd": "g++ '$file' -o '$file_base_name' && gnome-terminal -x bash -c \"'${file_path}/${file_base_name}';read -p '\nPress any key to continue...'\"" } ] }
————————
因為喜歡Sublime Text 3 的高亮配色,於是想在這里寫程序。從emacs配置時連配置文件在哪都不知道到vim配置了半天很有成就感,我對配置文件算是更了解了。不過Sublime Text 3 沒那么麻煩。配置C++編譯運行的方法大概就是配置一個Build System。在cmd窗口運行且解決了中文亂碼問題的c++編譯配置如下:
{ "encoding": "utf-8", "working_dir": "$file_path", "shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file_name\" -o \"$file_base_name\"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.c++", "variants": [ { "name": "Run", "shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\"" } ] }