Sublime Forum

Command that fills find and replace fields


Hi, I’ve got a lot of small regex expressions in a file I use to convert various latex math equation environments and such. I’d like to make a plugin where I can search through them in the command palette and fill the “find” and “replace” fields in the replace panel similar to the “slurp_find_string” and “slurp_replace_string”. An additional bonus would be if the “Regular Expression” option would enable itself on its own.

I think the most universal approach would be make a command that takes any two regex or strings and fills the fields. Then one could just make their own .sublime-commands file according to their needs and potentially assign a keybinding to them.

My plugin making skills are very rusty and I have bigger fish to fry at the moment but if some else was also interested in such plugin or could potentially help me with it a bit, I’d certainly bump it up in my list of priorities.

Just as an example, here are a few of the slurps.

MathSlurps: \begin{equation} \end{equation} -> $$ $$
\$\$ \1 \$\$

MathSlurps: $$ $$ -> \begin{equation} \end{equation}

MathSlurps: $ $ -> ```math ```


Does this package do what you want ?