IntelliJ navigate to next and previous highlighted variable

后端 未结 10 2233
野的像风
野的像风 2020-12-14 05:31

In IntelliJ 10.5 I have \"Highlight usages of element at caret\" enabled. When a variable/method/etc is selected, is there a way to move to the next and previous occurrence?

相关标签:
10条回答
  • 2020-12-14 05:59

    I usually do the following:

    1. Highlight the word
    2. Cmd + F (it will highlight all the matches in file)
    3. Cmd + G (next match)
    4. Cmd + Shift + G (previous match)
    0 讨论(0)
  • 2020-12-14 06:01

    Vote this request up for make them implement the feature.

    http://youtrack.jetbrains.com/issue/IDEA-59638

    0 讨论(0)
  • 2020-12-14 06:04

    I found something thay may more suite your needs : alt + mouse-wheel up/down.
    It goes to previous / next occurrence of identifier under caret.

    Shortcut name is "Go to next highlighted element usage".

    0 讨论(0)
  • 2020-12-14 06:04

    Look for next occurrence @ Keymap

    ^G = "select" the variable that you want to search for

    [shift]⌘G = [previous]next occurrence of selected variable

    All credits to @Igor Wojda for his comment in the accepted answer.

    0 讨论(0)
  • 2020-12-14 06:06

    Install Identifier Highlighter Reloaded and use Alt + Shift + Up/Down (can be redefined in Keymap settings) :)

    After you give it a shot and notice the 'hey, the highlight stays there after I move my cursor out of it' annoyance, consider upvoting this issue :)

    0 讨论(0)
  • 2020-12-14 06:06

    In the Mac OS, you can navigate to next highlighted usage by press control + option + up/down arrow.

    0 讨论(0)
提交回复
热议问题