windows下配置sublime-C++

参考文献

1、这里运行错误:‘D:\Sublime’不是内部或外部命令,也不是可运行的程序或批处理文件引用

2、windows下安装MinGW及C++的环境配置

c++插件

AStyle中的ctrl+s保存时自动格式 需要在配置文件中 false改为true
windows下配置sublime-C++_第1张图片

build system

修改xxxx.sublime-build文件内容、也可以新建build system,其中RunInCMD可以调出cmd,弥补sublime不能输入的问题

{
	"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}\""
		},
		{
			"name": "RunInCMD",
			"shell_cmd": "cmd /c start cmd /c \"${file_path}/${file_base_name} & pause"
		}
	]
}

你可能感兴趣的:(C++)