I often need to do complex regex-based find-replace operations in Intellij and apparently, the automatic search history only stores the latest dozen or so expression pairs.
Is there a way to permanently store the find/replace pairs for future reuse? It is a bit cumbersome to have to copy-paste the expressions elsewhere.
Sometimes I might spend several minutes writing a one-off complex regex thinking I won't need later, but then when it turns out I do need to replay it a couple of days later, and it is not in the history anymore.
Is there a built-in way to have the expressions stored permanently, e.g. mark a specific find/replace expression as permanent?
Use an existing template (field declaration) In the Structural Search dialog, under the Java | Class-based node, select All Fields of a Class which will look for all field declarations and click Find. As a result, in the Find tool window, IntelliJ IDEA shows all the fields declared in our Java code.
You could use Edit > Find > Replace Structurally
and save your Search and Replacement expressions as templates.
More details in the docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With