3

Is there any way that i can select some words to be highlighted and their instances as well. This feature i especially used when viewing log files in Notepad++

3
  • 1
    When you select a word, its occurrences are already highlighted. Or do you mean "select" them? – slhck Sep 3 '13 at 6:16
  • I just want to highlight them then move on with the cursor. Used to assist in viewing logs. Selection is sepearate – Basit Anwer Sep 4 '13 at 15:35
  • How do you mean "move on with the cursor"? – ruffin Apr 27 '17 at 22:35
2

Here are some useful key combos for selecting words in Sublime Text.


CtrlG - selects all occurrences of the current word (AltF3 on Windows/Linux)

D - selects the next instance of the current word if it is already selected, otherwise selects the current word (CtrlD)

  • K,D - skips the current instance and goes on to select the next one (CtrlK,CtrlD)
  • U - "soft undo", moves back to the previous selection (CtrlU)

E, H - uses the current selection as the "Find" field in Find and Replace (CtrlE,CtrlH)


If you start with an empty selection, D and CtrlG will search by whole words automatically. If you start with a non-empty selection, it will search for any instance of the text (disregarding word boundaries).

3
  • 2
    I just want to highlight them then move on with the cursor. Used to assist in viewing logs. Selection is separate – Basit Anwer Sep 6 '13 at 14:53
  • 1
    Agree. I don't need to select them all. Just want to double click to select a word then all occurrences are highlighted to help quickly examining the document. How hard is that? After 2 years seems that this one is still not fully implemented. – Jim Raynor Feb 14 '16 at 16:01
  • @JimRaynor You can do that if "Highlight matches" is turned off in search. (Came here hoping to find a way to have both highlight at the same time. Looks like this might do it.) – ruffin Apr 27 '17 at 22:29
0

It's possible, but just through the Find tool:

  1. select the desired word (double-click on it; or click on it and press D)
  2. open the Find tool (with F) and ensure Hightlight matches is selected
  3. navigate through the word instances (with G / ShiftG)

Or, as mentioned already, WordHighlight plugin would fit your specific need.

The native way is not as straightforward & fast as with the plug-in, but it's pretty fast anyway; with the benefit of not having the multiple highlighting always happening regardless you want it or not.

And double-click + F is fast enough for me 😉

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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