What’s Mining: Multiple Cursors and Selection

Hello everyone,

If you, as me, often dream of being in several places at once you will like this new feature coming to RubyMine from IntelliJ platform side! Please welcome multiple cursors and selection that you can already try in the last EAP version:


It was the top voted editor feature in our tracker and we hope you will like it. Let me go through this short demo in more detail and show you all the tricks.

Set multiple cursors

Let’s start with the very beginning. Using Alt with the mouse click you can set the cursors in all places you need (please note that you may always change the shortcut in Settings -> Keymap -> Editor Actions -> Add or Remove Caret):



You can also use keyboard. Please go to Settings -> Keymap -> Editor Actions and set up the shortcuts for Clone Caret Above and Clone Caret Below actions:



To switch off the multiple cursors and get back to single one, please press ⎋/Escape.

Edit your code simultaneously

Now, when multiple cursors are set, you can make some changes. For example, select the first words with Move Caret to Next Word with Selection (⌥⇧→/Ctrl+Shift+Right) action and move them to the end of lines with Cut (⌘X/Ctrl+X), Move Caret to Line End (⌘→/End) and Paste (⌘V/Ctrl+V) actions:



Or you can go back to the beginning of lines with Move Caret to Line Start (⌘←/Home) and capitalise the first letters with Right with Selection (⇧→/Shift+Right) and Toggle Case (⌘⇧U/Ctrl+Shift+U) actions:



Use code completion in multiple places at once

We’ve added an opportunity to use autocompletion and live templates with multiple selection as well. The context is determined from primary cursor’s location, resulting changes are applied to all cursors:



Find code occurrences to change

You can also easily change any repeating code fragment with Select All Occurrences (⌃⌘G/Ctrl+Shift+Alt+J) and Select/Unselect Next Occurrence (⌃G and ⇧⌃G/Alt+J and Shift+Alt+J ) actions:



Multiple cursors and selection feature as cool as it is to use now, it still has a long way to go: its implementation remains to be refined, and some limitations need to be dealt with. So we would really appreciate your feedback about it. Share your thoughts in our discussion forum and submit bug reports to the issue tracker. Thanks!

Develop with pleasure!
JetBrains RubyMine Team

This entry was posted in What's New (EAP). Bookmark the permalink.

28 Responses to What’s Mining: Multiple Cursors and Selection

  1. awesome!

    but i’m curious to know what will happen with vim plugin enabled

    who knows?!

  2. Pingback: RubyMineでマルチカーソル/選択 | JetBrains ブログ

  3. Pingback: RubyMine Hinoki Goes Beta! | JetBrains RubyMine Blog

  4. Ron Elliott says:

    I have been waiting for this feature for a while. Sadly it’s still not enough for me to move back from sublime text. The VERY simple key combos used it ST still make it king of this feature. Jetbrains needs to deemphasize the mouse and long key combos.

  5. Georg says:

    Activating this dangerous feature by default was a completely stupid idea!

    • Tatiana Vasilyeva says:

      What is wrong with the feature?

      • Matti Airas says:

        It’s lovely already as it is – the feature I missed the most when I switched from ST to PyCharm. In a way I agree with Georg, however. Multiple cursors is a feature that needs to be learned – it’s not discoverable at all. Since the feature is a very advanced one, I’m not sure if you can do much about it. Maybe pop-up a non-modal dialog when it’s enabled for the first time?

        If you stumble upon it without knowing, I’m sure it’s easy to wreak a lot of havoc with it, so maybe it could be disabled by default. I think you could argue for either.

    • olol says:

      You mean, in an environment where you’re supposed to use a VCS and commit often, using an editor that provides

      – autosave
      – ctrl + z
      – local history


  6. allbutone says:

    In Sublime, I can select multiple lines and press “Ctrl + Shift + L” to split into lines, then edit them with “multiple select” fluently, but in IDEA, I can’t find the same feature. will this feature be added ?

  7. allbutone says:

    I know I can set shortcut for “unselect occurrence”, but I can’t skip this occurrence and select the occurrence next to it, In Sublime, I can simply press “Ctrl + K, D” to achieve that, will this feature be fixed ?

  8. Pingback: WebStorm: IDE for Javascript | datajs

  9. Michael K. says:

    Saw this in the new Tips and Tricks video just uploaded by jetbrains. I already used the syncedit plugin for a longer time and missed this feature for some time that the syncedit stopped working in IntelliJ very much. It’s good that the multiple cursor works in a similar way but it does not fully replace syncedit. I know that the plugins (there was a version 2 from a different author) are very old and not updated since years but the functionality is very good and unique and could maybe move into IntelliJ in this context.

  10. Pingback: Python:Is there multiple cursor-like functionality in PyCharm? – IT Sprite

  11. Ben Creasy says:

    The Sublime trick of multiple cursors over a selection with CMD+SHIFT+L is requested at https://youtrack.jetbrains.com/issue/IDEA-122181 so you can vote for it if you want it.

    • Boris says:

      what about aligning multiple carets vertically with a shortcut?

      in order to go from here
      a |: 1,
      aaaa |: 2,
      aa |:3,
      aaaaaa |:4,

      to here:
      a |: 1
      aaaa |: 2
      aa |: 3
      aaaaaa|: 4

  12. Boris says:

    is there a way aligning the multi cursor in one vertical line like in sublime?


  13. Umer farooq Mughal says:

    Is there a way to increment numbers when using multiple cursors?

  14. David says:


    How do you move the multi-caret over logical elements
    blah(“|One Word”, blah.toString());
    blah(“|Two Words Here”, blah);
    blah(“|Three Words are here”, blah);

    I can’t get the carets over the complete strings in quotes going from start position.
    Also can’t work back from end of line because of blah.toString() vs blah

Leave a Reply

Your email address will not be published. Required fields are marked *