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, 2013 at 6:16
  • I just want to highlight them then move on with the cursor. Used to assist in viewing logs. Selection is sepearate Sep 4, 2013 at 15:35
  • How do you mean "move on with the cursor"?
    – ruffin
    Apr 27, 2017 at 22:35

3 Answers 3

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 Sep 6, 2013 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, 2016 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, 2017 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 😉

0

Install this package in sublime text

https://packagecontrol.io/packages/WordHighlight

Add this content in the preferences -> package settings -> WordHighlight -> Settings User

{
"color_scope_name": "comment",
"case_sensitive": false,
"draw_outlined": true,

"mark_occurrences_on_gutter" : true,
// valid types: dot, circle, bookmark and cross
"icon_type_on_gutter" : "dot",

"highlight_delay": 0,
"highlight_when_selection_is_empty": false,
"highlight_word_under_cursor_when_selection_is_empty": false,
"highlight_non_word_characters": true,

"file_size_limit": 4194304,
"when_file_size_limit_search_this_num_of_characters": 20000
}

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.