Sublime Forum

Saving search pairs

#1

This falls among ‘feature request’, ‘plug-in development’ and maybe someone already knows. Pardon me if this has been answered elsewhere. I have done some research but can not find what I am looking for.

I edit e-books (epub and mobi) a lot and Sublime is my principal editor of choice now that Sigil is no longer being developed. A feature that was tremendously handy was Save search pairs. A user could define a search string and optionally its related replacement. Using a short-cut, they could then choose a pair among those defined and the strings would load in the search and replace fields without executing right away. In other words, the saved pair of strings served as a model or template and could be tweaked for the actual need of the epub being worked on before executing.

If someone has already developed a plug-in like this, please share. My google searches have not yielded results. There are some search and replace plug-ins out there but the search and replace strings are defined and then executed when called with no opportunity to refine them at the moment.

I am not a python programmer, unfortunately. If this is plug-in someone would like to take on a develop, then this is criteria of functionality I and I think others would like to see:

  • Store a replacement string only as an option. To be accepted and saved, a replacement field can be blank and is not mandatory.
  • Search and replacement strings can be regular expression or simple text string. If possible, the pair would also have the data if the RegEx button is turned on or off and appropriately set that option when the pair is loaded in the fields.
  • The plug-in can load in the standard Search & Replace or all files (ctrl+shift+F) dialogues.

Thanks for taking the time to read this.

1 Like

#2

I was looking into this and discovered that it might not be easily possible for a plugin to set the Find What: or Replace With: values, without messing around with the text and selections in the document (slurp_find_string and slurp_replace_string commands), so I have asked a question on SO.

0 Likes

Initializing search terms
How to make a hotkey to search for a certain string?
#3

Thanks, kingkeith. We’ll see what develops. :slightly_smiling:

0 Likes