Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Windows, I use Notepad++ which has the great feature of when I select a word, all instances of that word are also highlighted in the same document. I have found it very helpful for finding patterns in giant log files.

I am wondering if there is a similar feature in a text editor on the Mac. I have looked into the documentation for TextWrangler and TextMate to no avail. Hopefully there is a way to do this so I can be more productive when working on a Mac.

--

Note: in Notepad++ you do not have to do a keyboard shortcut to make this work... you just select some text and it does the highlighting for you automatically.

share|improve this question
    
What happens when you do a "Find" in TextEdit? Does it not highlight all the instances of the text (I apologize; I don't have my Mac in front of me at the moment)? –  jrc03c Jul 19 '10 at 16:20
    
In TextEdit, "Find" iterates through each match. I am looking for a way to avoid using a keyboard- or menu-shortcut... just select a word and highlight the other instances of that word in the document. –  jedierikb Jul 19 '10 at 16:24

7 Answers 7

up vote 4 down vote accepted

Sublime Text is able to do that.

share|improve this answer
    
FYI, a Textmate 2 solution is described below. ST is nice also :-) –  tim Mar 30 '13 at 21:21

Well, BBEdit does incremential search. Emacs/Aquamacs and Vim/MacVim do it too of course. This is really an essential feature for me and I am heartbroken that TextMate and SubEthaEdit still have no support for it.

share|improve this answer

Who said BBEdit couldn't do it?

With your document in the front window:

  • Choose Search > Live Search ⌥ ⌘ F
  • Enter your search string
  • Notice that all instances of that string are now highlighted in your document

To make Live Search go away, click the Done button.

Reference: BBEdit 9.5 User Manual, pages 159-160

share|improve this answer
    
This looks promising! (only been using TextWrangler...). However, reading the documentation, it appears I would still need to enter the query I want into the Live Search field instead of anything I select with the mouse becoming a new Live Search query. –  jedierikb Jul 19 '10 at 21:01
1  
Select the text, ⌘C, ⌥⌘F, ⌘V—and you're done. Yes, it's a couple of extra keystrokes, but I don't think that you'll get any closer. If you want to search based on selected text, there's also Use Selection for Find (⌘E), but I don't see that it works with Live Search. –  Dori Jul 19 '10 at 22:21
    
Works in TextWrangler also –  Nathan Grigg May 18 '11 at 20:47

Not exactly what you want but TextMate does also have an incremental search.

Hit Ctrl + S and start typing text. What you type will appear in the status bar at the bottom of TextMate window and will also be highlighted in the opened document, if the opened document contains that text..

Hitting Ctrl + S again will select the next match in the document. It is more immediate than Command + S

share|improve this answer

TextMate 2 does this.

  1. Select the word (^W)
  2. Enter the selection on the find pasteboard (⌘-E) then ⌥⌘F to find all (works on selection or document) making a multi-selection you can type into

Really nicely, you can import this macro [1], and then the first use of cmd-W will select a word, but once a selection exists, ^-W will add the next instance to the (mult-) selection: Really nice feature!

[1] It's just a macro bound to ^-W with a dyn.selection Scope selector

(
{   command = 'copySelectionToFindPboard:'; },
{   command = 'findNextAndModifySelection:'; },
)
share|improve this answer

Lifehacker.com says this is a nice alternative. http://www.fraiseapp.com/

I have no personal experience with it. But it looks nice.

share|improve this answer
    
just tried it -- alas, it does not seem to do what I am looking for. –  jedierikb Jul 19 '10 at 19:41
    
Damn. sorry. Was it at least any good (in general)? –  alpha1 Jul 21 '10 at 2:05
    
Well, it opened a text file and let me write it in it and save it! :-) –  jedierikb Jul 21 '10 at 3:01
    
For future reference, development has been stopped on this program. It is available as a "Mac App" under the name "Smultron" peterborgapps.com/smultron –  zourtney Mar 11 '11 at 3:08

When I have switched from Windows to OS/X, I was missing Notepad++. After some research I came into Textwrangler. A feature that I used a lot with Notepad++ was the highlighting of all occurrences of a selected word. Textwrangler did not have this feature so easily accessible. It have such feature but you have to use live search (F), but since the moment that the highlighted text is not filled into live search text box you have to copy the highlighted text (C), fire live search (C) and then paste the text (V)

So since I have a magic mouse and better touch tool installed, I have bound a magic mouse gesture to execute double click (to select the work where the cursor is) + C + F + V

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.