» » Most popular hotkeys in Android Studio - Personal opinion

Most popular hotkeys in Android Studio - Personal opinion

Every android developer has thought about improving performance more than once. And so I want to dwell on the analysis of the most popular hotkeys for me (for Windows), which make my life easier.

Most popular hotkeys in Android Studio - Personal opinion

Move operators (Cmd/Ctrl + Shift + ↑/↓)
This is useful when you want to move an operator/function/class instead of cutting/pasting it.

Comment with inline comment
(Cmd/Ctrl + /) and block comment (Cmd/Ctrl + Shift + /).

Expand Selection (Option + ↑ / Ctrl + w). You can also shrink the selection (Option + ↓ / Ctrl + Shift + W).

Generate Code (Cmd + N/Alt+Insert) You can implement methods, getters, setters, constructors, hashCode/equals, toString, new file, new class).

You can select multiple cursors by simply holding (Alt and start selection), or you can use (Alt + Shift + clicks) to place the cursors in different places.

Optimize Imports (Control+Option+O/ Ctrl+Alt+O): This will optimize and remove all unused imports. If you are using version control, go to Settings -> Version Control -> Commit -> Enable Code Reformatting and Import Optimization. It will do all the work for you every time you commit.

Delete Line
(Cmd + Backspace/ Ctrl + Y).

Duplicate line/selected lines and (Cmd/Ctrl + D).

Rename (Shift + F6). This will allow you to rename classes, functions, variables, etc. If you need more options, such as renaming comments, you can double-click (Shift + F6).

Create method (ALT + Insert).

Smart connection lines (Control + Shift + J/ ). This is really useful when you want to concatenate strings or function signatures, etc.

Change Function Signature (Cmd + F6): This will take care of refactoring all function calls when you want to add/remove or change the position of any parameter in a function.

Selected Code Refactoring (Control + T): This is the fastest way I use to refactor my code as it will show you all previous keyboard shortcuts and more.

Inject Interface (Control + T + Inject Interface): Use it when you want to extract some methods from the current class into an interface.
Example: When you port your code to a clean architecture or want to introduce some abstraction.

Search by symbol (CTRL + ALT + SHIFT + N ).

Well, and probably my favorite (Ctrl + Shift + L) allows you to format your code in the selected file.

I really hope that in this article you have found something new that will help you be even more productive!

PS write your favorite combination of hotkeys in the comments! Thank you :-)

Related Articles

Add Your Comment

reload, if the code cannot be seen

All comments will be moderated before being published.