Ash
Ash

Reputation: 25642

TextMate Code Formatter for C

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

But 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?

Upvotes: 0

Views: 877

Answers (3)

Igbanam
Igbanam

Reputation: 6082

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.

Upvotes: 0

Jens Gustedt
Jens Gustedt

Reputation: 78903

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.

Upvotes: 2

greg
greg

Reputation: 4953

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.

Upvotes: 1

Related Questions