124

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.

1

8 Answers 8

255

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

5
  • 1
    AFAIK ETA on 8.0 version is the end of June/beginning of July.
    – Kootli
    Apr 26, 2014 at 9:32
  • 6
    Taken from provided link, Alt+J on Windows, Ctrl-G on Mac OS X
    – Kiee
    Sep 26, 2014 at 8:42
  • Yes! Alt+J will select/unselect the next occurrence, on Windows.
    – Zenadix
    Oct 30, 2014 at 19:54
  • 1
    If ALT+J selects the next occurrance. How can I automatically select all occurrances? Mar 16, 2019 at 16:37
  • 9
    @anddero Ctrl+Alt+Shift+J or Ctrl-Cmd-G Mar 6, 2020 at 14:57
21

On Mac OS X, you can select the next occurrence with Ctrl+G

3
9

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

8

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)

1
  • 1
    Thank you, that's what I was looking for. May 22, 2016 at 17:49
5

On Windows

Alt+j - Multiple Select

Alt+Shift+j - Unselect Multiple Select

2

I think what you want to do is refactor it at all the place in the file at once. So in MAC machine the handy shortcut for it is shift + F6 (you may have have to use fn key before F6). Click on the text you want to change and then press shift + F6. It will highlight the text and then your change at all the place in the file. :)

It will do the job same as sublime ctrl + D

0
1

PhpStorm has a "Select Word at Caret", Ctl+W and Ctl+Shift+W respectively (you can check your keys by searching under Preferences > Keymap).

Detail here: http://www.jetbrains.com/phpstorm/webhelp/selecting-text-in-the-editor.html#d617165e275

Not entirely sure if it's the same as you mentioned, but it's mighty handy!

1
  • 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
    – Ngoc Pham
    May 11, 2014 at 16:56
0

Today, another option is to simply use the Sublime Key Mappings so that you don't have to learn a new set/rewire your muscle memory.

File -> Settings -> Keymap

Select one of the presets (VS Code, Sublime, Eclipse, etc.), or select Plugins & install a new set of Keymappings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.