Is there a way to either record or script a search & replace sequence?


I would be able to automate a search & replace sequence, I have a few cases for this – eliminate multiple new lines or spaces in CSS or HTML or replace some special characters / w diacritics.
One would’ve achieved that in ST with RegReplace.


I don’t know if there is a package for this kind of thing already, but there is plenty of API support for it. You could either write a package or just use the to create custom commands for the kind of thing you want.


If I would’ve been capable of writing my own package I might not have asked the question in the first place :confused:




@ldexterldesign Atom’s APIs allow this to be implemented in a package if anyone wants to give it a try.



Hope this is useful



atom-keyboard-macros does not even install for me.
is there at least a way to have a history of search and replace? Other text editors keep a cache in drop downs.


Yea, I’ve kinda given up on this - been waiting for a response for some basic features for a while now



I found html-special-character-replacer and swapped the default list with my own list. Most of the stuff that I wanted to replace was special characters, but I do not need the huge list provided. Big thanks for the person that developed this package: BRiL1201. I think he can rebrand it as a search and replace tool, and provide instructions how to customize it. It would be nice if it had an option to choose between js files. This is a start for me. Manually, someone could start Atom with different js files if more than one is needed.


function doreplacement(text)

text = text.replace(/“/g,'“');
text = text.replace(/”/g,'”');
text = text.replace(/…/g,'…');
text = text.replace(/–/g,'–');
text = text.replace(/—/g,'—');

return text;