How to select multiple places in code in Android Studio ?
I want to insert the same text in multiple places in my source code. Like a have more than one mouse cursor
On a mac I like to do ⌥ (option) + shift + mouse click on multiple lines in Android Studio 3.1.3.
Windows: CTRL + CTRL(Hold) + ↑ / ↓
Mac: ⌘ + ⌘(Hold) + ↑ / ↓
ESC will end multiline mode.
To add a custom Keymap, CTRL+SHIFT+A, type keymap
and click on the one with Settings
as subtext. Search for Clone Caret Above
and Clone Caret Below
.
I mapped mine to ALT+SHIFT+↑ / ↓.
Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.
For both Mac and Windows, just open the Context Menu and click on the "Column selection mode" to enable or disable the behaviour..
On a macOS you can use:
Tap: Control
+ Command
+ G
- Select all the same value
Tap: Control
+ G
- Every tap combination select the new same value
Hold: Option
+ Mouse Click
- Select multiline with a mouse
Hold: Option
+ Shift
and Tap: Mouse Click
- duplicate cursor for a each tap place
You can use Alt + Shift and click multiple locations to for multiple cursor.
To select similar occurrences in files use Alt + j.
For more details : Click Here
Press Shift
+ Alt
+ Insert
combination to edit in Column selection mode.