Multiple Selections in Editor using the Mouse

As of IntelliJ IDEA 13.1, if you need to edit a document in the same way in several places, you can save efforts by using multiple selections feature. All you need to do is create a caret at each location using Alt+Shift+Mouse Click and make your changes – they will be applied at all locations simultaneously.

This however doesn’t solve the issue of wanting to select arbitrary selections of text before editing. This has now been solved in IDEA 14.1. You can drag the mouse while holding Alt+Shift and select the text required. This feature can also be used to copy-paste several pieces of text in one go.

multiSelection1

Similarly, you can now add a new rectangular selection to existing carets/selections by dragging the mouse while holding Ctrl+Alt+Shift (Cmd+Alt+Shift on Mac OS).

multiSelection2

Try this and other enhancements by downloading IntelliJ IDEA 14.1 EAP build. Share your feedback on the discussion forum and in our issue tracker.

Thanks!

This entry was posted in EAP Releases, New Features and tagged , . Bookmark the permalink.

10 Responses to Multiple Selections in Editor using the Mouse

  1. GNOK says:

    I can’t make it work with the laste version of Intellij on Mac. Can I do it from menu? so that I can figure out. Thanks.

  2. Adam says:

    Doesn’t work on Ubuntu 14.10 with default keyboard shortcuts.

    • Dmitry Batrak says:

      What product version are you using? Could you please also give some more details – i.e. what are your actions, and what is the result?

      • Andriy says:

        Neither Alt+Shift+Mouse Click nor Alt+Mouse Click combinations doesn’t work in PyCharm 4.0.5 on Linux Ubuntu 15.04 x64
        Other combinations work well.

        • Dmitry Batrak says:

          Alt+drag is usually mapped to dragging a window in Linux window managers. If you want to use Alt+click shortcuts, make sure you disable that in system settings.

  3. r34ch says:

    What is the Keymap name to search for to change the multiple text selection from Alt+Shift?

    • Dmitry Batrak says:

      It’s ‘Add or Remove Caret’.

      • r34ch says:

        Thanks. I’ve noticed in both 8 and the 9EAP that switching the ‘Add or Remove Caret’ (alt + left click) keymap with the ‘Declaration’ keymap (ctrl + left click) still brings up the declaration hover popup as if holding ctrl with the original keymap instead of the newly assigned alt.

        Where can I report this?

Leave a Reply

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