IntelliJ IDEA 13.1 RC Introduces Sublime Text Style Multiple Selections

We have two exciting pieces of news for you today.

First of all, IntelliJ IDEA 13.1 RC is now available for download, so you can try all the new features right away. By the way, this is the last chance to share your feedback before the release.

Second and probably more important (as you may have already guessed from the title), is that IntelliJ IDEA 13.1 introduces Sublime style multiple selections, the top voted editor feature in our tracker!

Here is how they work:

  • Add/remove a selection: Alt + Shift + Mouse Click
  • Select/unselect the next occurrence: Alt + J / Shift + Alt + J (Ctrl + G / Shift + Ctrl + G) for Mac OS X)
  • Select all occurrences: Shift + Ctrl + Alt + J (Ctrl + Cmd + G for Mac OS X)
  • Clone caret above/below (the shortcuts are not mapped yet)
  • Remove all selections: Esc

Multiple selections work nicely together with IntelliJ IDEA features like Code completion, Select word at caret, Join lines, Copy/paste, and the others. Here’s a little demo:

As cool as it is to use now, this feature 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!

Spread the word, and develop with pleasure!

About Andrey Cheptsov

Andrey Cheptsov is IntelliJ IDEA product marketing manager at JetBrains. He's passionate about productivity, programming languages and tools.
This entry was posted in New Features, Release Candidates and tagged , . Bookmark the permalink.

70 Responses to IntelliJ IDEA 13.1 RC Introduces Sublime Text Style Multiple Selections

  1. Benjamin says:

    I made the suggestion at march 13: http://youtrack.jetbrains.com/issue/IDEA-103937

    I’m glad this finally is about to be launched! Great work!

    Just a little side note about the screencast gif in this article. The correct german sentence must be:

    Mit Vernügen entwickeln!

    replace u with ü

    • Andrey Cheptsov says:

      Thanks for the kind words and spotting the mistake in the sentence. I hope users will forgive me for that.

    • Josiah says:

      I like the mouse idea, but adding in keyboard finding support would also add power. The refactoring features (such as renaming variables and methods) solve some of the use cases, but not all. I would look at vim multiple cursors for inspiration (even though its implementation is a bit incomplete). I miss being able to find every occurrence of a code sample in vim and be able to perform something more complicated than find and replace on all instances.

      Also, this feature could be better integrated with the vim plugin for IntelliJ. Multiple cursors doesn’t seem to work in visual or insert modes (normal mode is the only one).

  2. lolwat says:

    Sublime didn’t invent nor did they pioneer multiple text selections.

    • Andrey Cheptsov says:

      Agree, but this feature is really well-known because of Sublime. And to mention this is what we have been asked for in the original request (submitted by a Sublime user). Anyway, thanks for a point.

  3. Terence Martin says:

    Woo, I reported a bug over a year ago! Maybe that’ll be fixed sometime this year too. Glad to see that more new features are being added, but it would be nice if the existing features worked properly first. (does that count as feedback?)

  4. at least, some Emacs love !!!

    • Marcin says:

      My colleague and I also wonder when/if it will be supported. PhpStorm EAP and WebStorm EAP are already supporting this.

      My colleague tried to compile PyCharm from 135 or 136 source tree and multiselection kind of worked but not very well. I think that this eventually will be available but some work needs to be done to update PyCharm to newer core version. Current 3.1.2 RC is using version 133.

  5. Michael Kreich says:

    But how do you paste three different texts into three different lines simultaneously? (in the first part of the demo) did you copy the three lines from another editor first? (line 1 would be “Develope with pleasure” line 2 “Mit Vergnügen entwickeln” etc)

  6. nevvermind says:

    And here I tought of the innovative spirit of Notepad++ which already had those, but not THIS sort of complex multi-editing. Good job. Looks great.

  7. Moody says:

    Thanks for the great news! Any idea how to install it for PHPStorm?

  8. Sean Kent says:

    Thank you so much for adding this! It has been one of my favorite features of Sublime, and miss it in every other editor that doesn’t support it. You guys make an awesome product!

  9. Roosevelt P says:

    You guys really nailed it this time! Cannot wait to download IDEA :D!

  10. Will it go into PyCharm also when it’s official?

  11. Jerry says:

    Interesting. As a developer of a Mac app, I want my pasteboard support to be compatible with this feature.

    Does pasting into multiple selection support both one text item (with newlines), and multiple text items (each without any newlines)?

    What happens if the number of lines on the pasteboard doesn’t match the number of cursors in the editor?

    • Dmitry Batrak says:

      Paste command splits clipboard contents into lines and tries to match that against existing carets. I think you can discover all the details by trying :)

      • Jerry says:

        Unfortunately, as a programmer in 2014, I already have 100 poorly-documented third-party libraries and services that I have to integrate. Asking anyone to reverse-engineer a new undocumented feature pretty much ensures that it goes to the bottom of their to-do list.

        I truly hope that multiple paste already works perfectly ‘out of the box’ for every user in every situation. Reverse-engineering complete pasteboard support for an app can take hours, because of how many little details there can be, and I can’t justify that for another app right now.

        You asked for feedback, and that is mine: you should document your work, especially features that interoperate with other software. A blog post with an animated GIF is cool but it is no substitute for real documentation.

        • Dmitry Batrak says:

          To pass data into IDEA via clipboard, you’ll need to prepare a text with a line per supposed caret. There’s nothing more you can do at the moment, in terms of integration.
          If it doesn’t work for your use case, please let us know, we’ll try to fix it.

        • Martin says:

          In the time it took you to write this rant, you could have probably experimented with this and find how it works… go out a little bit more, you need it.

          This is something that I won’t be using all the time, but it’s nice to know it’s there.

  12. d1egoaz says:

    This feature will be in Intellij CE?

  13. Cameron says:

    Hello

    While I have played around with Sublime Text, I never used it enough to learn the benefits of this feature. I guess my question is this: What can I do with multiple cursors that I can’t easily do in previous versions IntelliJ (or some other editor.)

    Does anyone know of any tech articles out there outlining some clever tricks that utilize this feature?

    • Jerry says:

      It seems like a more visual way of doing most of what people use keyboard macros for, in other editors. IntelliJ IDEA looks more visual than structural (like, say, Emacs), so it’s probably more consistent with their overall design, even if it’s a little bit less powerful in some cases.

      I’m more used to macros, myself, but I think it’s a clever idea, as long as it can be done without confusing the existing meaning of the cursor and the selection.

  14. Danijel says:

    Those fonts look so blury on Linux! Any plans to fix the fonts rendering on Linux?

  15. I’ve used this feature while editing CSS files in Sublime a lot. But I’m not sure how this would come in handy while coding in Java. Anyway, thanks for this.

  16. Vladimir Kravets says:

    Any chance to see updated plugin for Python in nearest future? Or why 135 branch don’t exists on the github? release 13.1 rc was 2 days ago but bruch still doesn’t exists… I’m not have ability even to compile python plugin from source =(

    Please fix or update this =)

    Best Regards,
    Vladimir

  17. Tibor says:

    Hello,

    nice feature. However I don’t like that when I am done with multiple selection editing and press Esc, the carret is set to the last selection. I would prefer the caret to be positioned where it was before doing multiple selection editing.

  18. Colin Fleming says:

    Is there any documentation anywhere for third-party plugin authors who want to support this feature?

  19. groovybayo says:

    The SVN integration is completely broken. I updated from 13.1 EAP to RC yesterday and it is forcing me to upgrade the working copy to 1.8 format. That wouldn’t have been a problem if it worked ;(.

    I have spent countless hours fiddling with it and still no joy. Would have to rollback to 13.0.2 at this point which at least works with 1.7 format with no issue.

    Why can’t 13.1 EAP still stay compatible with 1.7 format? I know there are probably technically reasons, but if you are going to drop backward compatibility, please make sure things work!

    I have commented on the issue @ http://youtrack.jetbrains.com/issue/IDEA-118548 and will be more than happy to log another issue if it needs its own ticket.

    Please fix this ASAP. This is totally not cool! [quite unhappy]

  20. Matt says:

    Glad to see this feature added and hopefully it evolves. Right now it is still to rough around the edges to use. Arrow keys, home and end key, backspace, delete, etc do not seem to move all the cursors with it. I look forward to this feature getting ironed out and improving. For now I’m assuming only alphanumerical keys work with this?

    • Dmitry Batrak says:

      All the cases your are describing are supposed to work with multiple cursors. The issues could be caused by some plugins. Could you please try after disabling all third-party plugins?

  21. Bob Bobson says:

    The new feature is great. One thing I cannot do however is use it with the existing text search. If I press Cmd F (on Mac) and use Regex matching, can I get multiple selections for each found occurrence?

  22. Roger says:

    What are the key combinations for multi-selecting on the mac.

    I see “alt shift” (option shift) but it sure don’t work! ;)

  23. Shawn Fumo says:

    Is there any support (now or planned) for being able to skip selecting a match? It turns out to be really helpful (I use it in ST2 fairly often), more than it may seem at first. You might select “lex” and as you add matches you realize you have a “flex” in the middle you didn’t mean to match. Instead of starting over you can just skip it and continue. Similar to how the unselect command helps with the “whoops I selected one too many” situation, both play into the interactive feedback loop of multi-select IMO.

    The multi-select as it is is still very helpful. I think the skip is the only missing piece for me right now.

  24. Fidelacchius says:

    Omg. Just installed 13.1 and have been playing with it.

    This program officially does everything I want. Now i can stop with that sublime text trial bugging me to buy it :D

    I never thought I would be happy to spend 200 bucks on software. No regrets :)

  25. Ataxexe says:

    I love this feature. But I found one thing that could be improved:

    If I select a piece of code and type a “[", the editor surrounds the selection with a "[${SELECTION}]“, but, in multiple selections, the editor only surrounds the last selection.

  26. Steve says:

    Clone caret above/below states “these key shortcuts have not been mapped yet”. Did they get mapped in 13.1 GA ? If so what are they?

    • Andrey Cheptsov says:

      Right now we’re considering different options for shortcut mapping and it will take us some time, I hope the shortcuts will be available in one of the upcoming updates for 13.1. So far you can map it manually via Settings -> Keymap.

  27. hzamir says:

    A very useful fancy editing feature! But there is one more basically useful editing feature that IntelliJ IDEA editor does not have that I wish it would borrow from emacs: Narrow Mode. The ability to narrow the scope temporarily of all editing operations to just a part of the file.

  28. Samir says:

    My only issue with it is that it breaks the vim IntelliJ plugin pretty badly. The combination of visual mode and multi cursor selection is very broken.

    Also, when you’re using the multicursor and I try to autocomplete something, the behavior is inconsistent. (Again it might be an issue of vim +MC that’s breaking things )

  29. Denis Stoyanov says:

    Hi! What tool do you use for create a preview of shortcut?

  30. Pingback: ออกแล้ว Android Studio 0.5.2 | Devahoy

  31. Kevin Mandeville says:

    I can’t seem to get this to work on mac and can’t find the keymaps in the preferences to change mappings. What am I missing?

  32. Marty Gentillon says:

    It would be handy if we could activate this on all usages of a symbol in a file (sort of like the rename refactoring).

  33. Oscar Miguel Amezcua Estrella says:

    Hiyas one question i want to use RubyMine wit Inteli Idea for develop wit Java/Android or Ruby on rails

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">