开发者

TextMate Code Formatter for C

开发者 https://www.devze.com 2023-01-21 07:24 出处:网络
I am working on a C assignment for uni, and I\'ve been coding in TextMate and compiling in the command line.

I am working on a C assignment for uni, and I've been coding in TextMate and compiling in the command line.

But开发者_如何学JAVA TextMate wont (or cant) format C code, as it would for say, HTML, Ruby or PHP (using SHIFT + CTRL + F).

Is there a plugin or some other tool I can use to fix my indenting and curly braces for .c files?


I use astyle. It has a lot of options to customize according to your coding style, and I think it is included in the major linux distributions.


indent is a command-line tool that will properly indent your C code. It is highly customizable but its basic usage is indent <input.c> <output.c>. See man indent for options. Installed by default with Mac OS X Developer Tools, which I assume you have installed because you are writing C on a Mac.


Try using Eclipse for C/C++ Developers. If has a formatting functionality. You can also compile and test within the IDE by just clicking a button. With Helios, the most current Eclipse release, there are more features.

Enjoy.

0

精彩评论

暂无评论...
验证码 换一张
取 消