In general, the more keyboards with fewer mouse use, then write code to the higher efficiency; The common shortcut keys must have been mastered, and then I will share some very useful shortcuts that you may not know about.
All shortcut keys below are based on the following keymap
Windows:default
Linux:default
Osx:mac OSX 10.5+
is the auto-completion time enter or Tab?
Auto-Complete enter and tab differences
EnterThere are some subtle differences in the behavior of using auto-completion Tab :
- Use
Enter the statement that will fill your selection
TabIf you use it, it will replace your previous content (delete the following statement until you encounter the dot, comma, semicolon)
In this case we will often encounter, such as to replace the ID of a resource (r.id.a_xxx_xxx), presumably most people are first to choose to a.xxx_xxx Delete, then enter new content, or vice versa, in fact, in the Tab most elegant way.
Shortcut keys: (at the time of completion)Enter/Tab
Return to editor window
Return to editor window
When writing code, a lot of actions will leave the focus out of the editor, such as Find Usage, Logcat, switch to Project structure view, type inheritance tree, etc. if the view switches how to quickly cut back to the editor to continue writing code? Simple mouse click on the editor, but in fact there are two options:
Esc: Let the editor window get the focus, then you can enter the code
Shift + Esc: This will get the editor to focus and help you close the window you just opened.
Individual likes the second kind; Find usage is complete, Shift + Esc elegance ~
Esc: Return to Editor
Shift + Esc: Returns the editor and closes the current window
Returns the last tool window opened
Returns the last tool window opened
After that function, if you Shift + Esc write a little bit of code, what do you do when you find that you need to open the window? This scene usually occurs in Logcat this tol window, read the log, write code, write the code to look at the log, how to quickly switch?
Shortcut keys:F12
Quick Open Window
Open a window with a numeric shortcut
There's a wooden window with a number on it. Such a window (tool window) we can open quickly!
- Mac:
Cmd + 数字
- Windows/linux:
Alt + 数字
Any window switch
Window switch
The above switch is still unable to meet your requirements? Remember Mac Cmd + Tab , Windows? Alt/Win + Tab Android Studio also has this similar feature that allows you to switch to any window!
When the switch window is open, you can switch directly to the corresponding tool window by the number, or enter the letter to search the right editor window, if you need to close a window, click on it BackSpace .
Shortcut keys:Ctrl + Tab
Hide All windows
Hide All windows
Well, having learned so many skills to open windows, what if you want to close those messy windows and write the code quietly?
- Mac:
CMD + Shift + F12
- Windows/linux:
Ctrl + shift + F12
If you need to restore all windows, press this shortcut again.
Parameter hints
Parameter hints
This feature is estimated by a lot of people, but it's still a bit of a mention. After auto-completion, if a method parameter is super long, you don't know what to do with the parameter? You can try this.
- Mac:
CMD + P
- Win/linux:
Ctrl + P
Android Studio shortcut keys You don't Know (a)