Android Studio shortcut key, androidstudio

Source: Internet
Author: User
Tags code tag

Android Studio shortcut key, androidstudio

I believe that I am used to Eclipse's peers, and I am not used to using Android Studio. I am not used to shortcut keys. Of course, there are some ways on the Internet to set its shortcut keys like Eclipse, however, I think that since he designs it like this, it must have its own principle. He may not get used to it at first, but it will take a while. It can also learn different things, and there is no need to use the old set of Eclipse.


In File-Setting, we can see all the shortcut keys.



We need to gradually familiarize ourselves with it, and do not remember it all. We need to know which one we want to use, and gradually accumulate the shortcut keys we need most.


The following is my summary of my most commonly used shortcut keys. You are welcome to give me some advice and add them. I will update them slowly.


Alt + Enter: import other classes/prompt for operation
Ctrl + Q: View help documentation
Ctrl + W: gradually expand the selected range
Ctrl + Y: Delete the code.
Ctrl + U: Enter the parent class to view the method
Ctrl + O: override the method of the parent class
Ctrl + D: copy the code from the previous line to the next line.
Ctrl + G: Jump to the specified row
Ctrl + H: view the directory structure
Ctrl + J: quickly generate common code
Ctrl + B: Jump to the corresponding code, equivalent to Ctrl + K of eclipse
Ctrl + Shift/Alt + space: code prompt, equivalent to Alt +/of eclipse/
Ctrl + Alt + L: format the Code (it will conflict with the lock on QQ, So we click Code-> Reformat Code, no shortcut keys required)



Common shortcut keys for Android Studio

1. ctrl + D: copy and paste operations are set. If a selected part is selected, copy and paste the selected part. If no selected part is selected, copy and paste the row where the cursor is located.

2. Ctrl + space: when you enter the code, press this key combination to list the matched classes, method names, member variables, and so on. This can be used as a smart reminder. It is equally useful when editing XML files.

3. Ctrl + down arrow or Ctrl + Up Arrow: when there is an automatic match drop-down list, this shortcut will automatically turn off the drop-down list and move the cursor to the next/previous line.

4. Switch of the automatic match drop-down list arrangement mode: there is a "π" icon in the lower right corner of the automatic match drop-down list. After clicking it, you can choose to sort by: practicality or letters.

5. Ctrl + slash, Ctrl + shift + slash:

Ctrl + slash: Comment out or uncomment the current line or selected code block. The double slash is used as the "//"

Ctrl + shift + slash: Comment out or uncomment the selected code block. */"Method comment,

6. Ctrl + shift + Enter: automatically matches the corresponding syntax structure, such as if, do-while, and try-catch.

7. Ctrl + F: Search

8. Ctrl + period: in the auto-match drop-down list, select the first item

9. Exclamation point: in the auto-match drop-down list, select an item with the return result boolean by the up and down keys. The exclamation point will be automatically reversed:

10. Ctrl + Enter: in the auto-match drop-down list, if no item is selected, the first item is selected by default.

11. Ctrl + shift + A: Quickly search for menus in android studio.

12. Ctrl + N: quick search for class names and files

13. Ctrl + B: Jump directly to the class, method, and member variable definition. The same effect as Ctrl + left mouse button

14. Ctrl + Alt + B: queries which classes implement the interface where the cursor is located.

15. Ctrl + Alt + shift + I: Check Code, such as detecting variables or methods that are defined but not used. The purpose of detection is to improve code efficiency.

16. Ctrl + Alt + shift + N: Quickly open the input method or variable.

17. Ctrl + shift + F7: Mark some related items in the highlighted form. There are three main situations:

1. When the cursor position is in implement, the method name of the class that implements the interface is marked out;

2. When the cursor is at return, it indicates all exit points of the method;

3. When the cursor is at the keyword "try" or "throws", an exception occurs.

18. shift + mouse scroll: you can scroll horizontally on the editing page.

19. Ctrl + Alt + V: when calling a method, the input parameter is a complex expression, which can be used to reconstruct the variable to simplify the complexity of the Code.

Select the expression before the key combination.

20. Ctrl + D: compare two jar files. In the same project, select two jar files and press the combination key.

21. Ctrl + O: When the subclass wants to override the method of the parent class, press this combination key to display the methods of all parent classes. Ctrl + I

22. Ctrl + shift + I: to quickly view the method body and view how a method is implemented, move the cursor to the method and press the combination key.

23. Ctrl + Q: move the cursor to the method. Press this key combination to quickly view the instructions of the method.

24. Ctrl + ~ : Switch the style and shortcut key design of the editing interface.

25. Alt + shift + C: view the latest changes to the project.

26. Ctrl + E: Quick View of recently opened files.

27. shift + F6: You can rename classes, methods, and variables. The names are automatically updated when used.

28. Alt + F1: Quickly open the project view, structure view, and other elements to view the corresponding elements.

29. Ctrl + Alt + F7: view the usage of a class, method, and member variable throughout the project.

30. Ctrl + shift + space: Lists method names and member variable names that match the type when values are assigned or when parameters are required in the method.

31. Ctrl + Alt + T: select a piece of code and press this combination key to quickly add statements such as if, for, and try/catch.

32. Ctrl + Tab: Open the interface switch window, hold down the Ctrl key, and select the window to open.

33. Ctrl + W: select the word (a member variable or a method name) where the cursor is located. Press the statement once to select the cursor,

Press it again to select the code block... And so on. Each addition will expand the range of primary selection.



Alt + press enter to import the package, automatically corrected

Ctrl + N lookup class

Ctrl + Shift + N search for files

Ctrl + Alt + L format the code

Ctrl + Alt + O optimized imported classes and packages

Alt + Insert generate code (such as get, set method, constructor, etc)

Ctrl + E or Alt + Shift + C recently changed code

Ctrl + R replace text

Ctrl + F search for text

Ctrl + Shift + Space auto-completion code

Ctrl + space code prompt

Ctrl + Alt + Space class name or interface name prompt

Ctrl + P method parameter prompt

Ctrl + Shift + Alt + N find methods or variables in the class

Alt + Shift + C compare the recently modified code

Shift + F6 reconstruction-Rename

Ctrl + Shift + TOP key

Ctrl + X Delete rows

Ctrl + D copy rows

Ctrl +/or Ctrl + Shift +/comment (// or /*...*/)

Ctrl + J Automatic Code

Ctrl + E recently opened files

Ctrl + H display class structure diagram

Ctrl + Q show comments document

Alt + F1 locate code

Alt + 1 quickly open or hide the project panel

Ctrl + Alt + left/right return the previous browsing position

Alt + left/right switch Code view

Alt + Up/Down fast moving and locating between methods

Ctrl + Shift + Up/Down code move Up/Down.

F2 or Shift + F2 highlight error or warning quick locating

After the code tag is entered, press Tab to generate the code.

Select the text, press Ctrl + Shift + F7, highlight all the text, and Press Esc to highlight and disappear.

Press Ctrl + W to select the code, which has other effects.

Select the text, press Alt + F3, search for the same text one by one, and highlight it.

Ctrl + Up/Down Jump cursor to the first line or the last line

Ctrl + B quickly open the class or method at the cursor


Most common shortcut keys

1. Ctrl + E to display the list of recently edited files

2. Shift + Click can close the file

3. Ctrl + [or] can jump to the beginning and end of braces

4. Press Ctrl + Shift + Backspace to jump to the Last edited location.

5. Press Ctrl + F12 to display the structure of the current file.

6. Ctrl + F7 can query the reference of the current element in the current file, and then press F3 to select

7. Ctrl + N to quickly open the class

8. Ctrl + Shift + N to quickly open the file

9. Alt + Q: You can see the declaration of the current method.

10. Ctrl + W can select the word and then the statement and then the row and then the Function

11. Alt + F1 can locate the elements being edited in each panel

12. Press Ctrl + P to display the parameter information.

13. Press Ctrl + Shift + Insert to select and Insert the clipboard content

14. Alt + Insert can generate Constructors/Getter/Setter, etc.

15. Ctrl + Alt + V can introduce variables. For example, assign the SQL statement in parentheses to a variable.

16. Ctrl + Alt + T can wrap the code in one piece, such as try/catch

17. Alt + Up and Alt + Down can be quickly moved between methods


Below is not very useful

18. In some cases, press Alt + Enter to get some Intention actions. For example, change "=" to "equals ()"

19. Ctrl + Shift + Alt + N can quickly open the symbol

20. Ctrl + Shift + Space provides Smart prompts in many cases.

21. Alt + F3 can be quickly searched

22. Ctrl +/and Ctrl + Shift +/can comment out the code

23. Ctrl + Alt + B can jump to the implementation of the abstract Method

24. Ctrl + O you can select the parent class method for rewriting.

25. Ctrl + Q to view JavaDoc

26. Ctrl + Alt + Space is automatically completed by Class Name

27. wildcard characters or abbreviations can be used to quickly open a class/file/symbol.

28. Live Templates! Ctrl + J

29. Ctrl + Shift + F7 can highlight the use of the current element in the current file

30. Ctrl + Alt + Up/Ctrl + Alt + Down to quickly jump to the search results

31. Ctrl + Shift + J can be integrated into two rows

32. Alt + F8 is the variable value.



To be continued ......








Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.