[TxMt] Re: How to save find/replace patterns?

Carsten Hoever hoever at gmx.de
Thu Apr 21 15:39:36 UTC 2011


On 21 Apr 2011, at 16:44, Martin Wilhelm Leidig wrote:

> another thing: in Alpha one can save and edit any find/replace (F/R) pattern for later use.  I’m using this feature heavily because I’m frequently editing TeX documents converted from Word format where one often has very similar F/R tasks such as formatting citations, references, or bibliographical material.  At the same time one cannot do this using some external script because there’s still a wide variance of constructs depending on how the Word author worked.
> 
> That all boiling down to: is there a way to save, edit, and reload F/R patterns?


I would suggest having a look at TM's capability of recording macros. I just recorded a simple search and replace as a macro and used "Save last recording..." to store it in my personal bundle. Now it can be easily called again, e.g. with an assigned keyboard shortcut. After you created the first search macro it is also quite easy to create successive ones, you simply create a copy of the macro in the bundle editor and edit the shown options, which e.g. in my case read:

{
    action = replaceAll;
    findInProjectIgnoreCase = 1;
    findString = PhD;
    ignoreCase = 0;
    replaceAllScope = document;
    replaceString = Doctor;
    wrapAround = 1;
}

HTH,

Carsten


More information about the textmate mailing list