转载请注明本文出自Cym的博客(http://blog.csdn.net/cym492224103),谢谢支持!
Android Studio provides different keymaps (the mapping between shortcut keys and an action). You can see which keymap you are using in Settings->Keymap.
It wouldn’t be practical to list the shortcuts for every keymap so the following will be used:
Just as it says: it will copy the current line and paste it below without interfering with your clipboard. It can be pretty useful when it’s used with the move line shortcut!
This will contextually expand the current selection. e.g. it will select the current variable, then the statement, then the method, etc.
This can be used to wrap a block of code in some structure. Usually an if statement, a loop, a try-catch or a runnable.
If you have nothing selected, it will wrap the current line.
Using this, you get a searchable list of the most recently consulted files!
The live template is a way to quickly insert a snippet of code. The interesting thing with live templates is that they can be parameterized with sensible defaults and guide you through the parameters when you insert it.
Additional Tip:
This is like the Move Line shortcut but applied to whole methods. It allows you to move a method below or above another one without copy-pasting.
The real name of this action is Move Statement. Meaning that it moves any kind of statement. E.g. you can reorder fields and inner classes.
This will generate the missing code to complete a statement The usual use cases are:
Additional Tip:
This will make you navigate through the last changes you made. This is different from clicking the back arrow in the toolbar in that it makes you travel within your edition history and not your navigation history.
This is doing more than simulating the delete key at the end of the line! It will preserve formatting rules and it will also:
Additional Tip:
Takes the current file and asks you where to select it. The most useful shortcuts IMHO are to open in the project structure or in your file explorer. Note that each action is prefixed by a number or a letter, this is the shortcut to invoke it quickly.
Usually, I’ll go Alt+F1 then Enter to open in the project view and Alt+F1+8 to reveal the file in Finder on the Mac.
You can invoke this from a file or directly from the project view.
This will remove the surrounding code. It could be to remove an if statement, a while, a try/catch or even a runnable. This is exactly the opposite of the Surround With shortcut.