Hi all
I recently posted asking how to align code at <- . For example, I would want these two lines of code
foo <- test fooFooFoo <- test
To look like
foo <- test fooFooFoo <- test
Somebody suggestted installing the align bundle and using the keyboard shortcut CMD + CONTROL + 9. I've trice this but unfortunately it doesn't run and throws a message box saying 'Failure running Align Source'.
Can anyone come up with a hacky way of aligning code at <- ?
Ross
it needs an updated pulled.
Either replace this line #!/usr/bin/env ruby -W0
with this #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
or install the bundle from
https://github.com/tbates/align.tmbundle
On 9 Nov 2013, at 09:10, Ross Ahmed rossahmed@googlemail.com wrote:
Hi all
I recently posted asking how to align code at <- . For example, I would want these two lines of code
foo <- test fooFooFoo <- test
To look like
foo <- test fooFooFoo <- test
Somebody suggestted installing the align bundle and using the keyboard shortcut CMD + CONTROL + 9. I've trice this but unfortunately it doesn't run and throws a message box saying 'Failure running Align Source'.
Can anyone come up with a hacky way of aligning code at <- ?
Ross
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Here is a version that I adapted from the command in the align bundle for use with scala. It aligns on <=, =, ->, and <-
https://gist.github.com/sellmerfud/7385988
Note that I have not upgraded to Maverics yet. If you have then the shebang line should be updated as mentioned by Tim.
On Sat, Nov 9, 2013 at 4:12 AM, Tim Bates timothy.c.bates@gmail.com wrote:
it needs an updated pulled.
Either replace this line #!/usr/bin/env ruby -W0
with this #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
or install the bundle from
https://github.com/tbates/align.tmbundle
On 9 Nov 2013, at 09:10, Ross Ahmed rossahmed@googlemail.com wrote:
Hi all
I recently posted asking how to align code at <- . For example, I would
want these two lines of code
foo <- test fooFooFoo <- test
To look like
foo <- test fooFooFoo <- test
Somebody suggestted installing the align bundle and using the keyboard
shortcut CMD + CONTROL + 9. I've trice this but unfortunately it doesn't run and throws a message box saying 'Failure running Align Source'.
Can anyone come up with a hacky way of aligning code at <- ?
Ross
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Hmm. Seems to work for me. With the same input I get :
foo <- foo fooFooFoo <- foo fooFoo <- foo fooFooFoo <- foo fooFooFooFoo <- foo
Are you using a fixed width font?
On Sat, Nov 9, 2013 at 8:29 AM, Curt Sellmer sellmerfud@gmail.com wrote:
Here is a version that I adapted from the command in the align bundle for use with scala. It aligns on <=, =, ->, and <-
https://gist.github.com/sellmerfud/7385988
Note that I have not upgraded to Maverics yet. If you have then the shebang line should be updated as mentioned by Tim.
On Sat, Nov 9, 2013 at 4:12 AM, Tim Bates timothy.c.bates@gmail.comwrote:
it needs an updated pulled.
Either replace this line #!/usr/bin/env ruby -W0
with this #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
or install the bundle from
https://github.com/tbates/align.tmbundle
On 9 Nov 2013, at 09:10, Ross Ahmed rossahmed@googlemail.com wrote:
Hi all
I recently posted asking how to align code at <- . For example, I would
want these two lines of code
foo <- test fooFooFoo <- test
To look like
foo <- test fooFooFoo <- test
Somebody suggestted installing the align bundle and using the keyboard
shortcut CMD + CONTROL + 9. I've trice this but unfortunately it doesn't run and throws a message box saying 'Failure running Align Source'.
Can anyone come up with a hacky way of aligning code at <- ?
Ross
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
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@gmail.com wrote:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
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@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@gmail.com wrote:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
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@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@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@gmail.com wrote:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
[Last email sent too early by mistake]
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
4. Pressed CMD + CONTROL + 9 which outputted this:
foo <- foo foofoo <- foo foo <- foo foofoofoo <- foo
The font I am using is calibri. Any ideas what I’m doing wrong?
Cheers Ross
On 09/11/2013 19:51, "Tim Bates" timothy.c.bates@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@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@gmail.com wrote:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate