Xcode on your Mac is a fairly large IDE that can be developed quite a lot. But as programmers, there are times when we expect the Boulevard-to-Jane-a GCC compiler, a text editor. This is all the tools we expect when we learn the C language. (As for the Mac's vi really good, follow-up opportunity will also write some VI experience). Sublime Text 2 below.
(1) First we need to install GCC on the Mac, the method of self-baidu--of course, our Mac should be installed Xcode,xcode bring GCC, all with the XCODE,GCC installation this step is omitted.
(2) After installing sublime text 2, we do not see the result of C running in sublime Text 2. Then we need to configure the build System.
In sublime text, click Tools, build System, NEW build system ... A template that pops up a profile replaces the content in the template with the result:
{
"cmd" : ["gcc $file_name -o ${file_base_name} && ./${file_base_name}"],
"selector" : "source.c",
"shell" : true,
"working_dir" : "$file_path"
}
Then save to C.sublime-build, the location by default.
At this point, we can sublime text 2 to write a good program and run the program directly.
Set up C development environment with sublime Text 2 under Mac