I’ve been googling my brains out looking for a Mac text editor that can do one thing, but it’s looking like I’m the only person who’s ever wanted to do this. As my last hope, I thought I’d ask here and see if anyone knows of something I haven’t found.
What I want to be able to do: As I’m looking through a text document, I select a word (e.g. “cow”) and tell the editor “highlight every occurrence of this in blue.” So now all "cow"s in the file are blue. Now I select another word, say “horse”, and tell it “highlight every occurrence of this in red”, and now all "horse"s are red, and all "cow"s are still blue. Now I select “camel” and tell it it to highlight them in red. Etc. As many words in as many colors as I want, all highlighted as I tell the editor. I can also bring up the list of highlighted words and their colors so that I can edit it, change the colors, delete words, etc. That list is automatically saved and I can easily apply it to any other text file that I open.
On Windows, I had been using ConTEXT which came the closest that I’ve ever found to what I want. It let me define arbitrary lists of words and specify the highlight color, but it did require a restart for changes to take effect.
So far, on the Mac, the closest I’ve found is TextWrangler, but near as I can tell I can only define two sets of words (BBLMKeywordList and BBLMPredefinedNameList) in any given language module.
I think Tex-Edit Plus might do it, but you’ll need to do some scripting.
It can easily search-and-replace text and specify a text color, and it can specify arbitrary highlight colors, but I think it will take a script to search-and-replace specifying a highlight color.
Well, I figured that Emacs could be made to do what I want, but as a non-Emacs user, I was really hoping that something off-the-shelf already existed so that I wouldn’t have to climb up the Emacs/Lisp learning curve.
Two well-known and elaborately featureful third-party text editors for Winders can do this: UltraEdit and TextPad. I have no idea if either of these is available in a Mac version. Check them out and see if you can find out.
ETA: Just took a peek at the UltraEdit home page. Yesssss! There’s a Mac version! This is the editor you need to take a look at! (Didn’t see any Mac version mentioned on the TextPad page.)