Search code examples
phpstorm

Keyboard shortcut to select instances of word under caret further down


Is there a keyboard shortcut in PhpStorm that works similarly to CTRL+D in VS Code when a word is highlighted?


Solution

  • Look into the menu -> Edit -> Find -> Select All Occurrences.

    The keyboard shortcut seems to be Ctrl-Alt-Shift-J on all keymaps except for "Eclipse" and "Eclipse (Mac OS X)".

    Update:

    As @LazyOne points out, in the same menu, right under "Select All Occurrences" entry there are the "Add Selection for Next Occurrence" and "Unselect Occurrence" commands that can be used to select and unselect individual occurences. Their keyboard shortcuts are Alt-J and Alt-Shift-J on my instance of PhpStorm (using the "Default" keymap on Linux).

    The shortcuts can be different on a different keymap and/or OS; Ctrl-J and, I guess, Ctrl-Shift-J are another possibility. Check your menu.