Summary of useful shortcut keys for Android Studio

Summary of useful shortcut keys for Android Studio

  The following are some shortcut keys that are commonly used when developing with Android Studio on the Windwos system. Although there are not many, they all feel quite practical, so record them. If you forget it accidentally, you can turn it over. That would be very useful!

  1.Ctrl + B

  Jump in/out of methods or resource files. Position the mouse cursor to the calling place of a method or resource id, press Ctrl + B, it will jump into the method or resource file, and the function is equivalent to Ctrl + left mouse button. If the mouse cursor is positioned at the method definition or inside the resource file, pressing Ctrl + B will return to the caller.

  2.Ctrl + O

  View the methods in the parent class, and can select the parent class method to override. Position the mouse cursor anywhere in the code in the class, press Ctrl + O, you will see all non-private methods in all parent classes in the opened panel, select a method and press Enter to override the parent class method.

  3.Ctrl + K

  SVN commit code.

  4.Ctrl + T

  SVN update code.

  5.Ctrl + H

  View the upper and lower inheritance relationship of the class. Position the mouse cursor at any position in the class, and then press Ctrl + H, a panel will open, in which all parent classes and subclasses of the current class will be displayed according to the hierarchy.

  6.Ctrl + W

  Select the code block. Pressing Ctrl+W multiple times will gradually expand the selection.

  7.Ctrl + E

  Displays recently opened files, which can be quickly reopened.

  8.Ctrl + U

  Quickly jump to the parent class, or quickly jump to a method in the parent class. Position the mouse cursor on the class name, press Ctrl + U, the parent class of the current class will be opened, if the current class has multiple parent classes, the parent class to be opened will be prompted. If a method in a class overrides a method in its superclass, position the mouse cursor over the subclass's method, press Ctrl+U, and

It will jump to the overridden parent class method.

  9.Ctrl + G

  Displays the number of lines/columns in the code file at the current position of the mouse cursor. It can be understood as the horizontal and vertical coordinates of the cursor in the code.

  10.Ctrl + F12

  View all variables, methods, inner classes, inner interfaces in a class. Position the mouse cursor to any position of the current class file, press Ctrl + F12, a dialog box will pop up showing all variables, methods, inner classes, and internal interfaces in the class, and then press the ↑↓ key to select a variable, method, and inner class , the internal interface, and then press Enter to quickly locate the variable

Quantities, methods, inner classes, inner interfaces.

  11.Ctrl + F11

  Add bookmarks. Add a bookmark to the line where the mouse cursor is located. If there is a lot of code in the file, bookmarks will be a very useful function, which can help us mark important positions in the code, so that we can quickly locate these important positions next time.

  12.Shift + F11

  View bookmarks. You can quickly view previously marked bookmarks.

  13.Ctrl + Shift + F12

  Quickly resize the code editing window.

  14.Ctrl + ↑↓

  Fixed cursor moving code up and down.

  15.Alt + ↑↓

  Jump between inner interfaces, inner classes, and methods.

  16.Ctrl + Shift + Backspace

  Go back to the last edited position.

  17. Alt + Number

  Open the panel for the corresponding number. If the number corresponding to the terminal console panel is 6, pressing Alt + 6 can quickly expand or close the console panel.

  18.Ctrl + Shift + I

  Quickly view the contents of a method, class, interface. Position the mouse cursor on a method, class name, interface name, and then press Ctrl + Shift + I, the content of the method, class, and interface will be displayed at the current cursor position.

  19.Shift + Esc

  Close the currently open panel.

  20. Alt + J

  Select multiple keywords, methods, classes, and interfaces with the same name and change them at the same time.

  21.Ctrl + Tab

  Switch panels or files, similar to Alt + Tab in Windows. In the dialog box for switching panels/files, select a panel or file, and then press Backspace to close the panel or file.

  22.trl + Shift + Enter

  Fast completion statement. Such as if() {}, switch(){} code blocks, just enter if or switch (or even sw), and then press Ctrl + Shift + Enter to quickly complete the code block.

  23.Ctrl + Alt + M

  Fast extraction method. Select a code block and press Ctrl + Alt + M to quickly extract the selected code block into a method.

  24.Ctrl + Alt + T 

  Quickly wrap code blocks. Select a piece of code, and then press Ctrl + Alt + T, you can choose the operation to be performed on the selected code block, such as: if / else, do / while, try / catch / finally, etc.

  25.Ctrl  + Alt + L

  Code formatting.

  26.Ctrl + N

  Find classes quickly. Press Ctrl + N to pop up a dialog box for entering the class name. Enter the class name you want to find in the search box of the dialog box, and you can start the fuzzy search, so that you can quickly find the class you need to find, which is very common in class files. It is especially useful in the project.

  27.Ctrl + Shift + N

  Find files quickly. The function is similar to Ctrl + N, but in addition to searching for class files, you can also search all files under the current project, which is also a particularly useful function that is often used.

  28.Double Shift

  Global search. The function is similar to Ctrl + N, Ctrl + Shift + N, but the search scope is wider, and it supports symbol retrieval. In addition to the retrieval content of Ctrl + N and Ctrl + Shift + N, you can also search for variables, resource IDs, etc.

  29.Ctrl + Alt + Space

  Class name or interface name hint. Enter an incomplete class name or interface name, press Ctrl + Alt + Space, it will give a prompt for the complete class name or interface name.

  30.Ctrl  + Q

  Display annotated documentation. Position the mouse cursor on a class name, interface name or method name, and press Ctrl + Q, the comments of the class, interface and method will be displayed.

  31.Ctrl + PageUp/PageDown

  Position the cursor to the first/last line of the current file.

  32. Shift + Left Click (tab of current file)

  Close the current file.

  33.Ctrl + Alt + B  

  Jump to the implementation of the abstract method. Position the mouse cursor on an abstract method, and then press Ctrl + Alt + B to quickly jump to the concrete implementation of the abstract method. If the abstract method has multiple concrete implementations, a selection box will pop up for selection.

  34.Ctrl + Shift + U 

  Fast case conversion.

  35.Ctrl + Shift + Alt + S

  Open the Project Structure panel.

  36.Ctrl + F

  Searches the entered content in the current file.

  37.Ctrl + R

  Replace the entered content in the current file.

  38.Ctrl + Shift + F

  Global search.

  39.Ctrl + Shift + R

  Global replacement.

  40.Shift + F6

  Quick rename. After selecting a class, variable, resource id, etc., you can quickly rename it. As long as you change one location, all other places will be automatically renamed.

  41. Alt + F7

  Quickly find where a class, method, variable, resource id is called.

  42.Ctrl +Shift + Alt + I

  Review the project. Press Ctrl + Shift + Alt + I, and an input box for searching for review items will pop up. Enter keywords to search for the content that needs to be reviewed. For example, enter unused resource to search for resource files that are not used in the project. In addition, select Analyze—Inspect Code in the menu bar or right-click the current project—Analyze—Inspect Code to perform Lint review on the project.

  43.Ctrl + D

  Quickly copy lines.

  44.Ctrl + Shift + ↑↓

  Move the code up and down. If it is code in a method, it can only be defined within a method, not across methods.

  45.Shift + Alt + ↑↓

  Move the code up and down. Can be moved across methods.

  46.Shift + F10

  Start the Module.

  47.Shift + F9

  Debug Module.

  48.Ctrl + F9

  Make Project。

  49.Alt + Insert

  Insert code quickly. Constructors, Getter/Setter methods, etc. can be quickly generated.

  50. Alt + Enter

  Quickly fix bugs.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324728615&siteId=291194637