TextMate Php Command

Textmate is an editor I use a lot! Simple in use, but very powerful. Today I’ve been working on some PHP code where I needed to backslash a lot of double quotes. The solution: Use predefined commands!

Not really spectacular, but I just wanted to share this with you guys.

Screen shot 2010-07-22 at 17.15.59

Open the bundle editor in TextMate and create a command in PHP.

Screen shot 2010-07-22 at 17.17.14

Here you can define a command. Here is the command for adding slashes in your selected text:

sed 's/['"'"'"]/\\&/g'
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • YahooMyWeb

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">