[TxMt] Re: Align code

Ross Ahmed rossahmed at googlemail.com
Thu Dec 5 10:18:17 UTC 2013


Still can’t get this to work.

Here’s what I’ve done:

1. Duplicated a settings file, called in “Alignment Patterns R” and have
entered source.R in the scope selector
2. Copied and pasted your code below
3.  Tried it on this text in code in TextMate
foo <- foo
foofoo <- foo
foo <- foo
foofoofoo <- foo


On 09/11/2013 19:51, "Tim Bates" <timothy.c.bates at gmail.com> wrote:

>hi: what language?
>It works using settings for each language. Just duplicate one of the
>settings and rename it and edit to suit the language you need.
>
>This is a complex example (for R):
>
>{	shellVariables = (
>		{	name = 'TM_SOURCE_ALIGNMENT_PATTERN';
>			value = '[
>      { 
>        "comment" : "align on assignments",
>        "regexp" : "=|<-|->",
>        "minimum_spacing_before" : " ",
>        "minimum_spacing_after" : " ",
>        "padding" : "before"
>      },
>      { 
>        "comment" : "align right-hand side formulae assignments",
>        "regexp" : "~",
>        "minimum_spacing_before" : " ",
>        "minimum_spacing_after" : " ",
>        "padding" : "before"
>      },
>      { 
>        "comment" : "align any stacked assignments on a line",
>        "regexp" : ";",
>        "minimum_spacing_before" : "",
>        "minimum_spacing_after" : " ",
>        "padding" : "before"
>      },
>      {
>        "comment" : "align any comments",
>        "regexp" : "#",
>        "minimum_spacing_before" : " ",
>        "minimum_spacing_after" : " ",
>        "padding" : "before"
>      }]';
>		},
>	);
>}
>
>On 9 Nov 2013, at 19:33, Ross Ahmed <rossahmed at googlemail.com> wrote:
>
>> Thanks for that. Unfortunately It doesn¹t work as well as hoped however.
>> This code:
>> 
>> foo <- foo
>> fooFooFoo <- foo
>> fooFoo <- foo
>> fooFooFoo <- foo
>> fooFooFooFoo <- foo
>> 
>> 
>> Aligns to:
>> 
>> foo     <- foo
>> fooFooFoo   <- foo
>> fooFoo     <- foo
>> fooFooFoo    <- foo
>> fooFooFooFoo  <- foo
>> 
>> 
>> Ross
>> 
>> 
>> 
>> 
>> On 09/11/2013 10:12, "Tim Bates" <timothy.c.bates at gmail.com> wrote:
>> 
>>> #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
>>>-wKU
>> 
>> 
>> 
>> _______________________________________________
>> textmate mailing list
>> textmate at lists.macromates.com
>> http://lists.macromates.com/listinfo/textmate
>
>
>_______________________________________________
>textmate mailing list
>textmate at lists.macromates.com
>http://lists.macromates.com/listinfo/textmate




More information about the textmate mailing list