Go Common shortcut keys for Android Studio

Source: Internet
Author: User

(will continue to be updated) this side of the commonly used shortcut keys is to finish keymap to eclipse, not pure Android studio, here are mainly about some of the more commonly used shortcut keys:

CTRL+G/CTRL+ALT+SHIFT+G: The query variable or function or class where is used or called, the latter is the former complex performance, you can choose the scope of the query and so on.

Alt+h: Find function, global find

F4: Viewing class inheritance Relationships

F2: View document description (function usage instructions)

Ctrl+e: View recently opened files

Ctrl+shift+e: View recently edited files

Double Shift: Global lookup, this view and alt+h slightly different, this is the global file lookup, to the file name level.

Ctrl+shift+r: Quickly navigate to the file you want to open.

Ctrl+k: When a variable is selected, quickly navigate to the next place where the variable is used (although this shortcut now has some bugs, see:after Android Studio keymap to eclipse, find the next same variable shortcut key ctrl+k invalid )

Alt+↑: The line of code where the cursor is located moves upwards

Alt+↓: The line of code where the cursor is located moves down

Ctrl+d: Delete the line of code where the cursor is located

Ctrl+x: The line of code where the cursor is clipped

ALT+SHIFT+↓/CTRL+C: Copy cursor line code to next line

Ctrl+o: Quick Find functions in the current class, variables

Ctrl+shift+r: Modify Name

Alt+enter: Importing Packages

alt+←: Back, go to the last view or edit location

alt+→: Move forward, for example, after you locate the last point, want to go back, you can use this shortcut key

ctrl+/: When line comment, counter-comment press once again

ctrl+shift+/: module comments, counter-comment and then press once, Note that this "/" can not use the keypad

ctrl+shift+ keypad/: Folding Code (ctrl+shift+ small keyboard * This is not the spirit, today is not free, the latter will be addressed to solve this problem, and update up), of course, the notebook does not have a small keyboard, you can change the shortcut key

Ctrl+alt+s: Open Settings interface

Ctrl+alt+shift+s: Open the Project Structure interface

Alt+shift+x: Running (run)

Alt+shift+d: Debug Run (Debug)

CTRL+F9: Compiling the project

Ctrl+shift+k:push file to server (git)

Debug class shortcut keys

F5: But does not debug into the inside of the function.

F7: The call is returned from within the function.

F8: Executes to the next breakpoint, and execution completes without a breakpoint.

ctrl+alt+f8/double-click the mouse: directly see the value of the selected location, these two shortcuts slightly different, the specific difference please see this:Android Studio Debugging process in the shortcut to see the value of the variable at the breakpoint (ctrl+shift+i invalid)?

Here's a new shortcut for Android Studio to see which function variables are not used in the current class and which are not. Eclipse does not have, very useful, in inspect Code with Editor settings is, you can configure yourself to use the shortcut keys, configuration process, if found that you want to configure the shortcut keys are used, how to understand and what conflicts, how to resolve, please poke this: How does Android stuido view shortcut key conflicts?

----Common shortcut keys

1.ctrl+e, you can display a list of recently edited files

2.shift+click can close files

3.ctrl+[or] can jump to the beginning of the curly brace

4.ctrl+shift+backspace can jump to the last edited place

5.CTRL+F12, the structure of the current file can be displayed

6.ctrl+f7 can query the current element's reference in the current file, and then press F3 to select

7.ctrl+n, you can quickly open the class

8.ctrl+shift+n, you can quickly open files

9.alt+q can see the declaration of the current method

10.ctrl+w can select words followed by statements followed by functions.

11.ALT+F1 you can position the element you are editing in each panel

12.ctrl+p, can display parameter information

13.ctrl+shift+insert can select Clipboard contents and insert

14.alt+insert can generate constructors/getter/setter, etc.

15.ctrl+alt+v can introduce variables. For example, to assign a variable to a SQL in parentheses

16.ctrl+alt+t can wrap code inside a piece, such as Try/catch

17.alt+up and Alt+down can be moved quickly between methods

----infrequently used shortcut keys

18. In some places, press Alt+enter to get some intention Action, for example, change "= =" to "Equals ()"

19.ctrl+shift+alt+n to quickly open symbols

20.ctrl+shift+space can give smart hints in many cases

21.ALT+F3 can quickly find

22.ctrl+/and ctrl+shift+/can annotate code

23.ctrl+alt+b can jump to the implementation of an abstract method

24.ctrl+o can choose a method of the parent class to override

25.ctrl+q can see Javadoc

26.ctrl+alt+space is the class name auto-complete

27. When opening a class/file/symbol quickly, you can use wildcards or use abbreviations

28.Live templates! Ctrl+j

29.ctrl+shift+f7 can highlight the current element's use in the current file

30.ctrl+alt+up/ctrl+alt+down can quickly jump to search results

31.ctrl+shift+j can integrate two lines

32.alt+f8 is the value of the calculated variable

Shortcut keys

For many of the students who turn to eclipse, the most important thing is the shortcut key section, studio default shortcuts and eclipse is very different, but studio is a powerful place to set up you can always use the Eclipse style shortcut keys, This saves a lot of learning costs to those who transition from eclipse.

Preferences - Keymap then you can choose the shortcut you want, here you can choose not only eclipse, but also Emacs,Net Beans Shortcut keys for the editor

For the novice or the eclipse does not like the students, certainly want to learn the default studio shortcut keys, the following collation of the following commonly used some shortcuts, more shortcut keys also need to get accustomed to their own adaptation. (I chose Mac OS X 10.5+ myself)

Action Mac OSX Win/linux
Comment Code (//) CMD +/ Ctrl +/
Comment Code (/**/) CMD + Option +/ Ctrl + Alt +/
Formatting code CMD + Option + L Ctrl + Alt + L
Clear Invalid Package reference Option + Control + O Alt + Ctrl + O
Find CMD + F Ctrl + F
Find + Replace CMD + R Ctrl + R
Move code up and down Option + Shift + up/down Alt + Shift + up/down
Delete Row CMD + Delete Ctrl + Y
Expand Narrow Selection Option + Up/down Ctrl + W/ctrl + Shift + W
Quick Build Structure CMD + Option + T Ctrl + Alt + T
Quick Overwrite Method Ctrl + O Ctrl + O
Quick position to beginning/end CMD + left/right Ctrl + left/right
Collapse Unwind code block CMD + Plus,minus Ctrl + Plus/minus
Collapse Expand all code blocks CMD + Shift + plus,minus Ctrl + Shift + plus,minus
File method Structure CMD + F12 Ctrl + F12
Find the location of the call Ctrl + Option + H Ctrl + Alt + H
Uppercase and lowercase conversions CMD + Shift + U Ctrl + Shift + U

(PS: The above shortcuts do not try to confirm in the win platform, welcome feedback error and supplement)

Automatic Guide Package

Finally, we introduce one of the most useful settings, we only have to refer to some classes each time we have to guide the package, and studio can be set by automatic Guide package, simply too practical.

To Preferences , Editor , Auto Import , Java put the following options on the OK

Since then the world is quiet ...

Go Common shortcut keys for Android Studio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.