Does IntelliJ have a `Ctrl` + `K`,`Ctrl` + `D` Sublime equivalent? How do I skip a match when using Alt+J for multiple selections in Android Studio?

Intellij IdeaAndroid StudioKeymapping

Intellij Idea Problem Overview


I want to have the 'Ctrl'+'K','Ctrl'+'D' functionality of Sublime in Android Studio, how do I do it?

> Perfectly similar to this question, but with respect to Android Studio. https://stackoverflow.com/questions/11548308/how-do-i-skip-a-match-when-using-ctrld-for-multiple-selections-in-sublime-text

I use Ctrl+D to add to selection (discrete multiple select) the next occurrence of the string (or substring) highlighted. And to skip adding next immediate selection to selection but the one after it, I use Ctrl+K, Ctrl+D. How do I do the same in Android Studio.

I just know Alt+J is similar to Ctrl+D (found from Keymappings in Android Studio).

> And to deselect the last selected it's Alt+Shift+D.

But how do I skip next occurrence?

>My question is in no way related to: https://stackoverflow.com/questions/12500502/does-intellij-idea-have-a-ctrl-k-ctrl-d-equivalent. That's Visual Studio equivalent. I want the SublimeText equivalent.

Intellij Idea Solutions


Solution 1 - Intellij Idea

Check http://blog.jetbrains.com/idea/2014/03/intellij-idea-13-1-rc-introduces-sublime-text-style-multiple-selections/

Select next occurrence: Alt + J (Ctrl + G for Mac OS X)

Unselect next occurrence: Shift + Alt + J (Shift + Ctrl + G for Mac OS X)

Solution 2 - Intellij Idea

It is described in this Issue that was initially created because this skip-next was missing.

Anyhow you just press F3 to skip next possible selection.

Solution 3 - Intellij Idea

If you are using OSX, there are two answers, depending on what keymap you have selected in Preferences:

Keymap : Mac OS X 10.5+

  • To start / add to your discrete multiple selection : CTRL+G
  • To skip the current selection and move to the next : CMD+G

Keymap : Mac OS X

  • To start / add to your discrete multiple selection : CTRL+G
  • To skip the current selection and move to the next : F3
  • (this mode is really awkward IMO - no flow)

If you have more follow up questions I had success asking support via this thread : https://youtrack.jetbrains.com/issue/IDEA-121956

Solution 4 - Intellij Idea

Go To Settings -> Keymap -> Main Menu -> Edit -> Find

OR Search for the following options in Settings -> Keymap

Set the shortcuts for the following (Linux/Mac) :

Add Selection for Next Occurrence : Ctrl + D/Cmd + D

Find Next/ Move to Next Occurrence : Ctrl + K/Cmd + K

You might also want to setup Unselect occurrence:

Unselect Occurrence : Ctrl + U/Cmd + U

Carefully remove/replace/override any other existing bindings with these shortcuts according to your needs. You should have Sublime Text Ctrl+D, K behaviour working.

Note: Test these shortcuts for functionality with the default key bindings first. This will ensure, you get working shortcuts with your favourite shortcut keys.

Solution 5 - Intellij Idea

I needed to use sublime's Ctrl+D (switch between multiple selected).

The F3 key worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSaravanabalagi RamachandranView Question on Stackoverflow
Solution 1 - Intellij IdeaAldo CanepaView Answer on Stackoverflow
Solution 2 - Intellij IdeamabaView Answer on Stackoverflow
Solution 3 - Intellij IdeazayquanView Answer on Stackoverflow
Solution 4 - Intellij IdeakrozaineView Answer on Stackoverflow
Solution 5 - Intellij IdeaHessvacioView Answer on Stackoverflow