sublime text 3 c/c++(11) 以及sublimeclang配置 windows

被同学一推荐,觉得挺好玩的。

可用的扩展很多,看起来很多功能都比codeblocks好~~



c/c++ 普通配置

工具-编译系统-新的编译系统

输入一下即可

这个配置中的runincommand可以额外运行到cmd.exe   

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++",

	"variants":
	[
		{
			"name": "Run",
			"cmd": ["cmd", "/c", "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "cmd", "/c", "${file_path}/${file_base_name}"]
		},
		{
			"name": "RunInCommand",
			"cmd": ["cmd", "/c", "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & pause"]
		}
	]
}

保存到D:\SublimeText3\Data\Packages\User   即可  

命名为:c++.sublime-build   确保后缀一样



c++11的配置

和上面一样~~

{
	"cmd": ["g++", "-std=c++11","${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",
			"cmd": ["cmd", "/c", "g++", "-std=c++11","${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & pause"]
		}
	]
}






接下来是关于sublimeclang的配置

由于sublime text 3 不支持下载

所以这里给出链接  完整的sublimeclang下载  http://pan.baidu.com/s/1mgjIluw

然后将这个文件放到D:\SublimeText3\Data\Packages

并在这个文件里面找到SublimeClang.sublime-settings  放入 D:\SublimeText3 \Data\Packages\User

然后进入sublime text 3 

打开   首选项->插件设计->sublimeclang->setting user   插入下代码  即可完成配置

    "options":
    [


         "-m32",
         "-w",
         "-ferror-limit=9",
         "-fgnu-runtime",
         "-fms-extensions",
         "-Wall",
         "-nostdinc", 

         
        "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/",
        "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1",
        "-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/",
        "-Wno-deprecated-declarations",
        "-isystem", "D:\\codeBlocks\\MinGW\\lib\\gcc\\mingw32\\4.7.1\\include",
        "-isystem", "D:\\codeBlocks\\MinGW\\lib\\gcc\\mingw32\\4.7.1\\include\\c++",
        "-isystem", "D:\\codeBlocks\\MinGW\\lib\\gcc\\mingw32\\4.7.1\\include\\c++\\mingw32",
        "-isystem", "D:\\codeBlocks\\MinGW\\include",
        "-isystem", "/usr/include",
        "-isystem", "/usr/include/c++/*",
        "-Wall"
    ],

重启即可~~~


ps...

我是直接拷贝default 里面的信息到user里面,然后找到user上面的这一段代码直接修改的~~


你可能感兴趣的:(sublime text 3 c/c++(11) 以及sublimeclang配置 windows)