Is there a way to save/reuse regex search/replace patterns in atom or other Linux text editor?

2

I use BBedit on Mac OS, which has a great feature that allows you to store and reuse search patterns (including grep/regex patterns) in a popup menu inside the search/replace menu.

I'm using Ubuntu now because the Mac has gotten so slow after the latest OS update to Sierra. Does Atom have a feature or addon that has this feature? If not, is there another Linux editor that does?

Lido

Posted 2017-03-09T15:49:58.843

Reputation: 21

I use medit on Ubuntu, which handles regular expressions which are more or less compatible with grep and sed, with a few extra features. – AFH – 2017-03-09T15:56:27.570

Thanks @AFH for the tip. Are you able to store the patterns so they're easy to re-use? – Lido – 2017-03-09T18:54:18.203

medit does appear to remember search and replace strings between invocations, but I have never investigated their long-term permanency nor the associated buffer sizes. At the very least you can copy and paste from a text file open in another tab. – AFH – 2017-03-09T23:15:16.980

I've checked, and (on Ubuntu) medit saves its recent find and replace strings in ~/.cache/medit/state.xml, but I don't know how many entries are saved: mine currently has 12 finds and 10 replaces, but adding extra entries doesn't change the drop-down lists. If these are enough, you can copy over this file on each invocation. – AFH – 2017-03-10T17:50:53.850

Answers

3

https://atom.io/packages/replacing-pattern-collection

replacing-pattern-collection package

This package helps using find-and-replace. If you often use same complex pattern in find-and-replace, this package is helpful. This package save patterns to file, and load patterns from file.

See package docs for usage help.

Hawkeye Parker

Posted 2017-03-09T15:49:58.843

Reputation: 173