How can I select next occurrence in IDEA editors

47,065

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

Here is the Docs

Solution 5

On Windows

Alt+j - Multiple Select

Alt+Shift+j - Unselect Multiple Select

Share:
47,065

Related videos on Youtube

kbtz
Author by

kbtz

Updated on February 01, 2020

Comments

  • kbtz
    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.

  • Kootli
    Kootli about 10 years
    AFAIK ETA on 8.0 version is the end of June/beginning of July.
  • Ngoc Pham
    Ngoc Pham almost 10 years
    Yeah 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
    kbtz almost 10 years
  • Zac Rolland
    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
    Kiee over 9 years
    Taken from provided link, Alt+J on Windows, Ctrl-G on Mac OS X
  • Zenadix
    Zenadix over 9 years
    Yes! Alt+J will select/unselect the next occurrence, on Windows.
  • Tomas Votruba
    Tomas Votruba almost 8 years
    Thank you, that's what I was looking for.
  • arefindev
    arefindev about 7 years
    Awesome solution. Thank you!
  • Snackoverflow
    Snackoverflow about 5 years
    If ALT+J selects the next occurrance. How can I automatically select all occurrances?
  • Orkhan Alikhanov
    Orkhan Alikhanov about 4 years
    @anddero Ctrl+Alt+Shift+J or Ctrl-Cmd-G
  • Tim Bogdanov
    Tim Bogdanov over 2 years
    Thank you, exactly what I was looking for!