# Looking for Mac text editor that can do on-the-fly highlighting

**URL:** <https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590>\
**Category:** In My Humble Opinion\
**Created:** [June 9, 2013, 11:06pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590 "2013-06-09T23:06:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roadfood](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@Roadfood](https://boards.straightdope.com/u/Roadfood)\
**Post date:** [June 9, 2013, 11:06pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/1 "2013-06-09T23:06:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tellyworth](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@tellyworth](https://boards.straightdope.com/u/tellyworth)\
**Post date:** [June 9, 2013, 11:36pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/2 "2013-06-09T23:36:38Z")

</div>

It might be possible to do that in Textmate using a combination of bundles and syntax highlighting. But not out of the box, and I couldn’t tell you exactly how.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [June 10, 2013, 3:05am UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/3 "2013-06-10T03:05:51Z")

</div>

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.

It’s free to try.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [June 10, 2013, 3:17am UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/4 "2013-06-10T03:17:50Z")

</div>

Wow.  
Believe it or not, Apple’s _Pages_ will do this. You can specify a _style_ that includes highlighting, and then search and replace text, applying the style you want.

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [June 10, 2013, 12:18pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/5 "2013-06-10T12:18:41Z")

</div>

The logical answer to this question is [Emacs](https://en.wikipedia.org/wiki/Emacs) - the question is not whether Emacs **can** do what you want (it can), but **how** to make Emacs carry out this operation (involves LISP).

There is a Mac OS X port.

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [June 10, 2013, 12:25pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/6 "2013-06-10T12:25:03Z")

</div>

And a [highlight extension](http://nschum.de/src/emacs/highlight-symbol/) that at least starts you in the right direction.

---

<div class="post-metadata">

**Author:** ![Roadfood](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@Roadfood](https://boards.straightdope.com/u/Roadfood)\
**Post date:** [June 10, 2013, 4:43pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/7 "2013-06-10T16:43:03Z")

</div>

> [@si\_blakely](#):
>
> The logical answer to this question is [Emacs](https://en.wikipedia.org/wiki/Emacs) - the question is not whether Emacs **can** do what you want (it can), but **how** to make Emacs carry out this operation (involves LISP).
> 
> There is a Mac OS X port.

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.

---

<div class="post-metadata">

**Author:** ![Roadfood](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@Roadfood](https://boards.straightdope.com/u/Roadfood)\
**Post date:** [June 10, 2013, 4:54pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/8 "2013-06-10T16:54:59Z")

</div>

> [@beowulff](#):
>
> Wow.  
> Believe it or not, Apple’s _Pages_ will do this. You can specify a _style_ that includes highlighting, and then search and replace text, applying the style you want.

Ok, I hadn’t thought of that, and it does work. But it’s a pretty tedious process. What I want is a syntax-highlighting editor that gives me more than the two keyword groups that TextWrangler allows.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [June 10, 2013, 4:58pm UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/9 "2013-06-10T16:58:38Z")

</div>

> [@Roadfood](#):
>
> Ok, I hadn’t thought of that, and it does work. But it’s a pretty tedious process. What I want is a syntax-highlighting editor that gives me more than the two keyword groups that TextWrangler allows.

Try Tex-Edit. It’s amazingly full-featured, and very scriptable.

---

<div class="post-metadata">

**Author:** ![Askance](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/askance/32/8281_2.png) [@Askance](https://boards.straightdope.com/u/Askance)\
**Post date:** [June 12, 2013, 3:21am UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/10 "2013-06-12T03:21:51Z")

</div>

You might check out [TextWrangler](http://www.barebones.com/products/textwrangler/)and, failing that, its big brother BBEdit. While I haven’t the time to 100% confirm it will do it, I’ll be surprised if it doesn’t.

ETA: already tried by OP :smack: Maybe BBEdit though?

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [June 12, 2013, 8:05am UTC](https://boards.straightdope.com/t/looking-for-mac-text-editor-that-can-do-on-the-fly-highlighting/660590/11 "2013-06-12T08:05:26Z")

</div>

Two well-known and elaborately featureful third-party text editors for Winders can do this: [UltraEdit](http://www.ultraedit.com/) and [TextPad](http://www.textpad.com/). 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](http://www.ultraedit.com/) 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.)

ETA-2: [UltraEdit for the Mac](http://www.ultraedit.com/products/mac-text-editor.html) page.
