转载请注明本文出自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:
This will take the current variable, parameter or field and show you the path it has taken to get here! This is very useful when you are entering an unfamiliar place in the code base and you want to understand how this parameter got there.
There is also the reverse operation “Analyze Data Flow from Here” that will show you where your variable, field or return type will end up.
Shortcut : There is no keyboard shortcut for this…
This one is particularly nice!
It will take the current selection, select the next occurrence and add a cursor there. This means that you can have multiple cursors in the same file! Everything you type will be written at each cursor.
Shortcut :
Enable column selections, also known as block selection. Basically, if you select down, it will go down and not bother wrapping to the end of the line.
This will also put a cursor after each line of the block selection from where you can type.
Shortcut :
This one is not very intuitive but still pretty powerful. Basically, it is a way to wrap the current statement in something else without having to press the left key a bunch of times to get there.
E.g. to iterate a list, you could go “myList.for”, press tab and it would generate the for loop for you.
You can get a list of what you can type by typing a dot after a statement and looking through the options after all the possible completions.
Some of my personal favorites:
This will take the current selection and do a diff with the content of your clipboard.
Shortcut:
This will stop the currently running task or show a list of possible tasks to stop if there is more than one.
Pretty useful to stop debugging or abort a build.
Shortcut :
This will put the cursor back to where you are debugging right now.
The usual case is:
Shortcut (when debugging) : Alt+F10
This will show you the most frequent version control operations. If your project is not under git or another sytem, it will at least give you a local history maintained by Android Studio.
Shortcut :
Assuming that your project is under Git, you can compare the current file or folder with another branch. Pretty useful to get an idea of how much you have diverged from your main branch.
Shortcut :