Thursday, November 12, 2015

Android Studio (and intelliJ) supports Sublime style multiple selections

Here is how they work:
  1. Add/remove a selection:
    1. Alt + Shift + Mouse Click
  2. Select/unselect the next occurrence:
    1. Alt + J / Shift + Alt + J (Ctrl + G / Shift + Ctrl +G) for Mac OS X)
  3. Select all occurrences:
    1. Shift + Ctrl + Alt + J (Ctrl + Cmd + G for Mac OS X)
  4. Clone caret above/below
    1. The shortcuts are not mapped by default. Simply open studio's preferences and search for clone in the keyboard mappings. I personally mapped it to Ctrl + Alt + Cmd + up and down
  5. Remove all selections:
    1. Esc
Multiple selections work nicely together with features like Code completion,Select word at caretJoin linesCopy/paste, and the others. Here’s a little demo:

Big thanks to  Andrey Cheptsov for this awesome bit of news! (source)

No comments:

Post a Comment