sublimtext3 自定义编译环境

sublime text是一个非常神奇到编辑器,对于我这种小白来说,感觉比vim好用,但是如果用sublime自带到编译环境到话,是没法向程序汇总输入数据的,所以要自己新建编译命令

{
  "cmd": ["g++", "$file", "-o", "${file_path}/${file_base_name}"],
  "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
  "working_dir": "${file_path}",
  "selector": "source.c, source.c++, source.cxx, source.cpp",
  "variants":
  [
      {
          "name": "Run",
          "shell": true,
          "cmd": ["gnome-terminal -e 'bash -c "${file_path}/${file_base_name};echo;echo;  echo Press ENTER to continue; read line;exit; exec bash"'"]
      }
  ]    
}

 然后保存为新的编译命令并且使用之就可以了。

原文地址:https://www.cnblogs.com/superxuezhazha/p/5673265.html