[TxMt] new command: Universal Un/Comment (BBEdit-ish)

Chris Thomas chris at cjack.com
Tue Dec 21 21:32:50 UTC 2004


Ruby supports -e in the same manner as Perl. However, it's awkward with 
a multiline script, so most scripts I place in external files. This one 
I place in a file in my home directory called comment.rb, the TextMate 
command being thus:

  ruby -s "~/comment.rb" "$TM_FILEPATH"

Chris

On Dec 21, 2004, at 11:38 AM, Lang Riley wrote:

> Chris,
> For those of us new to Ruby, do we need to wrap your script in :
>
> ruby -e '<your script>'?
>
> Thanks
> On Dec 21, 2004, at 11:02 AM, Chris Thomas wrote:
>
>
>
>> On Dec 21, 2004, at 7:46 AM, Eric Hsu wrote:
>>
>>
>>
>>> This version is actually better than BBEdit's, in my opinion, because
>>> 1. it can uncomment many different comment formats for silly 
>>> languages like PHP that support several; and
>>> 2. it places comment delimiters at the original level of indent (and 
>>> not the first column like BB does); and
>>> 3. we can all customize it.
>>>
>>>
>> Here's what I use (requires Ruby 1.8). (I typically want to preserve 
>> the existing inline comments, so I don't personally find those first 
>> two properties desirable.)
>>
>>



More information about the textmate mailing list