Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA highlight all occurrences of selected text

Currently, intellij highlights all occurrences of the word under the caret. How can I change it so that it doesn't do that, and instead will highlight all occurrences only when I select the word (eg: similar to sublime text) ?

like image 373
Vic Avatar asked Sep 17 '18 17:09

Vic


People also ask

How do I highlight all usages in an IntelliJ file?

If the highlighting of usages is disabled, press Ctrl+Shift+F7 to highlight all usages in the file. From the main menu, select Edit | Find Usages | Find Usages in File Ctrl+F7. IntelliJ IDEA selects the first usage occurrence in the file. With the Ctrl+F7 you can also highlight the exception name and places where the exception is thrown.

How do I find a specific exception in IntelliJ IDEA?

From the main menu, select Edit | Find Usages | Find Usages in File Ctrl+F7. IntelliJ IDEA selects the first usage occurrence in the file. With the Ctrl+F7 you can also highlight the exception name and places where the exception is thrown. Use the F3 and Shift+F3 shortcuts to navigate between highlighted symbols.

How do I find all usages in IntelliJ?

Search for usages in a file In the editor, select a symbol you want to find, IntelliJ IDEA automatically highlights all found usages in the file. If the highlighting of usages is disabled, press Ctrl+Shift+F7 to highlight all usages in the file. From the main menu, select Edit | Find Usages | Find Usages in File Ctrl+F7.

How do I filter search results in IntelliJ IDEA?

If the search results have too many entries, then IntelliJ IDEA shows the first hundred usages found and the more usages option on the bottom of the window which you can click to display another hundred usages, and so on until the search is finished. Use filters on the top of the window to show or hide the certain search entries.


2 Answers

https://plugins.jetbrains.com/plugin/201-browsewordatcaret

From the plugin description:

Allows to easily browse next/previous word at caret and highlight other appearances of selected word.

I'm using it and it works perfectly.

like image 111
maaw Avatar answered Oct 24 '22 11:10

maaw


The following worked for me in IntelliJ 2018.2.3:

  1. Disable automatic highlighting of usages by unchecking:

    Preferences | Editor | General | Highlight usages of element at caret
    
  2. Add mouse shortcut for Highlight Usages in File:

    Preferences | Keymap | Main menu | Edit | Find | Highlight Usages in File
    

My mouse shortcut was: Shift + Control + Double Click

like image 31
Mario Galic Avatar answered Oct 24 '22 11:10

Mario Galic