The most common shortcut keys for Android Studio (Mac version)
How to Set important shortcut keys:
Android Studio-> References-> Keymap
1. expand and contract the Code:
Setting Method: Main menu-> Code-> Folding-> Expand/Collapse
2. Global Search:
Setting Method: Main menu-> Edit-> Find in Path
3. Global replacement (super practical ):
Setting Method: Main menu-> Edit-> Find-> Replace in Path
4. View and replace the current file
Setting Method: Main menu-> Edit-> Find-> Replace
5. jump from the layout file to the associated Activity or from the Activity to the associated layout file:
Setting Method: Main menu-> Navigate-> Relate Symbol
6. Go back to the last editing point:
Main menu-> Navigate-> Back
Main menu-> Navigate-> Forward
7. Go to the source file
Main menu-> View-> Jump to Source (such as methods, variables, and classes)
Main menu-> Navigate-> Declaration (for example, click the view id of findViewById to enter the R file instead of the layout file. You can use this shortcut key)
In this way, there are two shortcut keys for entering the Source file: [Jump to Source, Declaration ]. It is troublesome to use, and you need to distinguish between scenarios.
You can delete the shortcut keys of Main menu-> View-> Jump to Source. You can only use the shortcut keys set by Main menu-> Navigate-> Declaration, in this way, it can be used in the association layout or in the class.
8. Move the code up/down
Main menu-> Code-Move Statement Up/Move Statement Down
9. Comment on the shortcut key:
Single Line Comment: Main menu-> Code-> Comment By Line Comment
Code Block Comment: Main menu-> Code-> Comment By Block Comment
10. Select the string in uppercase and lowercase letters.
Editor Actions-> Editor Toggle Case
11. Run the project shortcut:
Main menu-> Run-> run
Run in Debug mode: Main menu-> Run-> debug
12. Column/Block Selection
For example, you only need to select the first five characters of the two lines.
Enable and disable: Main menu-> edit-> Column Select Mode
Alternatively, you can press and hold the Alt key without using the shortcut key, and then select the mouse.