[TxMt] C indentation prbs

James Perry james.perry at frontiernet.net
Fri Jun 8 13:46:40 UTC 2007


Hello all...

Speaking of external indenting apps, I download and build  
'astyle' (Artistic Style) and set up a bundle command Ctrl-Option- 
Command-[ to run it on the selection or the entire document. Works  
like a charm. Tons of indentation and style options!

 From the Artistic Style web page:

"Artistic Style is a source code indenter, source code formatter, and  
source code beautifier for the C, C++, C# and Java programming  
languages."

Have a look at http://astyle.sourceforge.net/ and see if it's what  
you need. I don't know how it compares with 'indent', any comments on  
that?

JP


On Jun 8, 2007, at 9:15 AM, Steve King wrote:

> On Thu, 7 Jun 2007, Pavan Gunupudi wrote:
>
>> The following pieces of code are indented incorrectly by "Indent  
>> Selection" - ⌥⌘[ . Any fixes?
>
> FWIW, I find the best way to handle re-formatting C code is to  
> filter it through the external 'indent' command.  It's *highly*  
> customizable and comes with reasonable defaults for a number of  
> standard formatting styles (GNU, K&R, BSD).  The indent package is  
> available through MacPorts or can be compiled from source.
>
> That said, it would be nice if TM's formatter was a little smarter  
> about what it does while you're typing, but I can live with it as- 
> is for now (at least until 2.0 comes out!)
>
> -- 
> Steve King, <steve at narbat.com>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list