[TxMt] Snippet or command

Alain Matthes alain.matthes at mac.com
Fri Sep 21 09:20:46 UTC 2007


Le 21 sept. 07 à 09:30, Alain Matthes a écrit :
>
> hello Ben
>
>   How to make a test like :
>
>   if right = } then right =\\right
>
>

I found :

#!/usr/bin/env ruby

sel = STDIN.read.chomp
sel.match(/^(.+)(.)$/)
left = $~[1]
right = $~[2]
if right == '}'
    left = '\\{'
    right = '\\}'
  end
print "\\left#{left}\\right#{right}"

Regards Alain


More information about the textmate mailing list