views:

34

answers:

1

I'm looking to create a command in a textmate bundle that when run will:

  1. Search the document for a given string
  2. Replace that string with another given string

The strings will always be the same

Search for <? replace with <?php

I know I can use textmate's find and replace functionality - I'm just trying to automate a little.

This should only make changes on the current page, not the entire project.

Is this possible?

A: 

Yes, you can do this with a Macro.

Simply go to Bundles -> Macros -> Start Recording, and then execute your Find and Replace as you wish it saved. Stop and Save the recording, and then you can assign it a command in the Bundle Editor.

Matt B.
Awesome...thanks. I had gone the route of writing a script that I called from a command but this is much easier.
Jason