Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select multiple places (sublime) in code in Android Studio?

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. I used to do it in VS2012 so easily though not sure how to do it in Android Studio ?

like image 916
Amir Ziarati Avatar asked Oct 09 '16 15:10

Amir Ziarati


People also ask

How do I backspace multiple lines in Android Studio?

“android studio multi line backspace” Code Answer In Visual Studio and most other half decent IDEs you can simply do "SHIFT+TAB".


2 Answers

I found how and lets share this cool feature with you. I found three cool features:

  1. For multiple selection just hold alt + shift then select whenever you want to change by mouse click then type some thing you can write at multiple places at the same time.

  2. Another cool feature is column selection. This lets you to click in a great manner and greatly of help especially when you are refactoring.

In most systems it works with holding middleMouseButton and dragging over your code and in others it works by holding alt and selecting code it acts like below:

It selects like this

  1. the third cool feature is sublime selection it finds the same word in code and let you change that or append that easily. you can do that by pressing alt + j on Windows / Linux and ctrl + g in mac. Look how it works:

its great for refactoring

Also as @Narayana said in comments, Ctrl + Shift + Alt + j selects all occurrences in one shot, for one-shot refactoring.

like image 106
Amir Ziarati Avatar answered Sep 28 '22 22:09

Amir Ziarati


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

like image 43
iamdeowanshi Avatar answered Sep 28 '22 22:09

iamdeowanshi