2

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?

Jason
  • 15,017
  • 23
  • 85
  • 116

1 Answers1

3

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.

mbauman
  • 30,958
  • 4
  • 88
  • 123
  • Awesome...thanks. I had gone the route of writing a script that I called from a command but this is much easier. – Jason Jan 12 '10 at 23:50