How can I select next occurrence in IDEA editors
Solution 1
I believe they recently added this to the latest IntelliJ release, and I would assume PhpStorm as well. As the bindings are system specific, take a look at http://blog.jetbrains.com/phpstorm/2014/03/working-with-multiple-selection-in-phpstorm-8-eap/. Looks like that version is available through EAP, so don't know when they will release it for general consumption (or if they have already).
DEFAULT SHORTCUTS
Alt+J on Windows and Linux, Ctrl+G on Mac OS X
Solution 2
On Mac OS X, you can select the next occurrence with Ctrl+G
Solution 3
In the settings window, search for ”Add Selection for Next Occurence” (PhpStorm 8.0.1)
On mac the default is ctrl+G, but you can change it to ctrl+D (or cmd+D on mac)
Solution 4
Currently its mapped with
for selection, Alt + J
for unselection, Alt + Shift + J
but if you're familiar with sublime shortcuts like Ctrl + D
Jetbrains give you an option to change settings,
Settings -> Keymap -> Editor Actions
search for multiple selection, find Alt + J then right click -> select change keyboard shortcuts
set shortcuts you want as like sublime, Ctrl + D
Solution 5
On Windows
Alt+j - Multiple Select
Alt+Shift+j - Unselect Multiple Select
Related videos on Youtube
kbtz
Updated on February 01, 2020Comments
-
kbtz about 4 years
Ctrl+D performs the
find_under_expand
command in sublime. This basically searched for the next occurrence of the already selected text and selected it, so when I edit, it's edited on both places at the same time. I'm currently trying to move to IDEA editors (such as WebStorm, PHPStorm, PyCharm, etc) but didn't find something like this command in this IDE yet.-
ryanyuyu over 8 yearsThis post is used as an example for this meta discussion
-
-
Kootli about 10 yearsAFAIK ETA on 8.0 version is the end of June/beginning of July.
-
Ngoc Pham almost 10 yearsYeah it's not what OP asked for, but thanks to your link, I can find the shortcut for this "Select Word at Caret" under Mac. I'm a newbie with PHPStorm :D
-
kbtz almost 10 yearsThis isn't the "Go to line" command? jetbrains.com/phpstorm/documentation/PhpStorm_ReferenceCard.pdf
-
Zac Rolland almost 10 years@cvsguimaraes command+G = go to next occurrence, command+ctrl+g = go to previous, and ctrl+G = also select next occurrence (works for me at least).
-
Kiee over 9 yearsTaken from provided link,
Alt+J
onWindows
,Ctrl-G
onMac OS X
-
Zenadix over 9 yearsYes!
Alt+J
will select/unselect the next occurrence, on Windows. -
Tomas Votruba almost 8 yearsThank you, that's what I was looking for.
-
arefindev about 7 yearsAwesome solution. Thank you!
-
Snackoverflow about 5 yearsIf ALT+J selects the next occurrance. How can I automatically select all occurrances?
-
Orkhan Alikhanov about 4 years@anddero
Ctrl+Alt+Shift+J
orCtrl-Cmd-G
-
Tim Bogdanov over 2 yearsThank you, exactly what I was looking for!