Android Studio shortcut key finishing sharing-sadieyu

Source: Internet
Author: User
Tags code tag

ALT + ENTER import package, auto fix

CTRL + N Find class

Ctrl+shift+n Finding files

Ctrl+alt+l Formatting Code

Ctrl+alt+o Optimizing 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 replacing text

Ctrl+f finding text

Ctrl+shift+space Auto-Complete code

CTRL + Space Code hints

Ctrl+alt+space class name or interface name hint

Ctrl+p Method Parameter Hints

Ctrl+shift+alt+n find a method or variable in a class

Alt+shift+c vs. recently modified code

Shift+f6 Refactoring-Renaming

ctrl+shift+ First up key

Ctrl+x Deleting rows

Ctrl+d Copying rows

ctrl+/or ctrl+shift+/annotation (//or)

CTRL+J Automatic Code

Ctrl+e recently opened files

CTRL+H Display class structure diagram

Ctrl+q displaying comment documents

Alt+f1 find where the code is located

Alt+1 quickly open or hide the engineering panel

ctrl+alt+ Left/right back to the last viewed location

ALT + Left/right Toggle Code View

ALT + Up/down Fast move location between methods

The Ctrl+shift+up/down code moves up/down.

F2 or SHIFT+F2 highlighting error or warning quick location

When 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 the disappear.

Ctrl+w selected code, continuous press will have other effects

Select the text, press ALT+F3, look down the same text, and highlight it.

Ctrl+up/down cursor jumps to the first or last line

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

Most 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

The following is not very useful

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

IntelliJ Idea Use Tips checklist

In the process of using Inellij idea, by looking for materials and some of their own groping, found that many Java programmers like the IDE has a lot of tips to mention, if you can skillfully apply them to the actual development process, I believe it will greatly save your development time, And then there will be a little bit of sense of accomplishment: Try it!

1, write code with Alt-insert (code| Generate ... You can create getter and setter methods for any field inside a class.

2. Right click on the breakpoint marker (in the left column of the text) to activate the Quick Search menu, you can quickly set the Enable/disable breakpoint or condition its properties.

3. A special variable in the Codecompletion (code completion) attribute is that the activation Ctrl-alt-space can complete the class name in or out of the current file. If the class is not introduced, the import flag is created automatically.

4. Use the Ctrl-shift-v shortcut to insert the most recently used Clipboard Content selection into text. The system pops up a dialog box with the contents of the clip, where you can select the part you want to paste.

5. Using the Codecompletion (Code completion) property allows you to quickly complete a variety of statements in your code by typing the first few letters of a class name and then using Ctrl-space to complete the full name. If there are multiple options, they are listed in the Quick list.

6. Use ctrl-/and ctrl-shift-/to annotate/reverse comment code lines and code blocks.

-/With single-line comment mark ("//... ") to comment/counter-annotate the current line or select a block of code. ctrl-shift-/can then enclose the selected block with a block annotation tag (""). To counter-annotate a block of code, press ctrl-shift-/anywhere in the block.

7, press Alt-q (view| Context Info) allows you to view the current method declaration without needing to move the code. Pressing two consecutive times displays the currently edited class name.

8. Using refactor| Copy Class ... You can create a "copy" of a selected class. This is useful, for example, when you want to create a class where most of the content is the same as the existing class.

9, in the editor ctrl-d can copy the selected block or not the selected block is the current row.

10, ctrl-w (select Word) in the editor function is to select the word at the caret, and then select the extension area of the source code. For example, select a method name, then the expression that invokes the method, then the entire statement, then the containment block, and so on.

11. If you do not want the "bright ball" icon that indicates the details of the event to be displayed on the editor, open all Events list by pressing Alt-enter key and click it with the mouse to set the event text attachment's bright ball to inactive.

There will be no bright balls to indicate special events, but you can still use Alt-enter shortcut keys.

12, when using Codecompletion, you can use a comma (. ) character, comma (,) semicolon (;), spaces, and other characters enter the current highlighted part of the popup list. The selected name is automatically entered into the editor with the characters entered.

13. Use the Escape key in any tool window to move the focus to the editor.

Shift-escape can not only move the focus to the editor but also hide the current (or last active) tool window.

The F12 key moves the focus from the editor to the most Recently used tool window.

14. An easy way to view any expression values when debugging a program is to select the text in the editor (you can do this more efficiently with a few ctrl-w key combinations) and then press ALT-F8.

15. To open the browser of the class or method Java document used by the editor caret, press Shift-f1 (External JavaDoc on the right-click menu).
To use this feature, you need to add the path to the browser and set it in the "General" option (Options | IDE Settings), and add the created Java document to the project (File | Project Properties).

16, with CTRL-F12 (View | File Structure Popup) key you can quickly navigate through the files you are currently editing.
It then displays a list of the members of the current class. Select an element to navigate and press the Enter key or the F4 key. To easily navigate to an entry in the list, simply type its name.

17. Place the cursor in the code on the marker or its checkpoint and press Alt-f7 (Find Usages in the right-click menu ...). ) will quickly find the location of a class, method, or variable used throughout the project.

18. Press Ctrl-n (Go to | Class ... Then type the name of the class to quickly open any class in the editor. Select the class from the drop-down list that appears.
The same method you can do by using Ctrl-shift-n (Go to | File ... ) to open a non-Java file in the project.

19. To navigate the declarations of classes, methods, or variables used in some places in the code, place the cursor over the viewing item and press Ctrl-b. You can also switch to the declaration by pressing the Ctrl key while clicking the mouse button on the viewing point.

20. Place the cursor over the viewing point and press Ctrl-alt-b to navigate to the implementation code of an abstract method.

21. To see the inheritance level of a selected class, press Ctrl-h (Browse Type Hierarchy). You can also activate the inheritance relationship view in the editor to see the inheritance relationship for the current editing class. 22. Using Ctrl-shift-f7 (Search | Highlight Usages in file) can quickly highlight where a variable is used in the current file. Press Escape to clear the highlight.

23. Using ALT-F3 (Search | Incremental search) implements the Quick Find function in the editor.

Enter the characters in the "Search for:" Prompt tool and use the arrow keys to search forward and toward the back. Press Escape to exit.

24. Press Ctrl-j to perform some of the Live Template abbreviations that you don't remember. For example, key "it" and then press Ctrl-j to see what happens.

25. Introduce Variable integration helps you simplify complex declarations in your code. For example, in the following code snippet, select an expression in the code: then press CTRL-ALT-V.

26, Ctrl-shift-j shortcut key to the two lines of the composition of a row and unnecessary space to remove to match your code format.

27, Ctrl-shift-backspace (Go to | Last Edit location) lets you switch to the final place where the changes in your code are made.

Press Ctrl-shift-backspace a few times to see a deeper revision history.

28. Using Tools | Reformat Code ... Reference according to your code style (view Options | IDE Setting | Code Style) formatting codes.

Using Tools | Optimize Imports ... Can be based on settings (View Options | IDE Setting | Code Style | Imports) automatically "optimizes" imports (eliminating useless imports, etc.).

29. Live Templates with Idea | Live Templates lets you create a lot of typical code in the blink of an eye. For example, in a method, type

Press the TAB key again to see what's going on.

Use the Tab key to move within a different template field. View Options | Live Templates get more details.

30. To view the local history modified in a file, activate the native VCS in the right-click menu | Show history .... Maybe you can navigate the different versions of the files and see how they differ and roll back to any previous version.

Using the same right-click menu entry, you can also see the history of changes in a directory. With this feature you will not lose any code.

31. If you want to understand the purpose of each entry in the main menu, move the mouse pointer over the menu entry and the status bar at the bottom of the application frame will show some of their short descriptions, which may be helpful to you.

32. To display the separation line between the methods in the editor, open the options | IDE Settings | Editor, select the "Show method separators" check box (checkbox).

33. Use alt-up and Alt-down keys to move quickly between different methods in the editor.

34. Use the F2/SHIFT-F2 key to jump between the highlighted syntax errors.

With the ctrl-alt-down/ctrl-alt-up shortcut, you can jump between compiler error messages or the results of a find operation.

35. By pressing Ctrl-o (Code | Override Methods ... It is easy to overload the base class ground method.

To complete the method of the current class implements (or abstract basic Class) interface, use Ctrl-i (Code | Implement Methods ... )。

36. If the cursor is placed between the parentheses of a method call, pressing CTRL-P displays a list of available parameters.

37. To quickly view the Java documentation for the class or method used at the editor caret, press Ctrl-q (in Show quick JavaDoc in the popup menu).

38, like Ctrl-q (show Quick JavaDoc display concise Java document), ctrl-p (show Parameter info display parameter information), Ctrl-b (Go to Declaration jump to declaration), SHIFT-F1 (External JavaDoc external Java documentation) and other shortcut keys can be used not only in the editor, but also in the code completion right-click List.

39. CTRL-E (View | Recent files) pops up the most recently accessed right-click List. Select the file and press Enter to open it.

40. In idea, you can easily rename your classes, methods, and variables and automatically correct them wherever they are used.

Try to place the editor caret on any variable name and press Shift-f6 (Refactor | Rename ... )。 Type the new name you want to display in the dialog box, and then press Enter. You will browse to all places using this variable and press the "Do Refactor" button to end the rename operation.

41. To be quick in any view (Project view, Structure view, or other view)

Select the current edit section (class, file, method, or field), press Alt-f1 (View | Select in ... )。

42. If you instantiate a known type object after the "new" character, you may use the Smarttype code to complete this feature. For example, type

Press Ctrl-shift-space again:

43. It is also very easy to create an entire anonymous implementation of an interface in idea by using the Smarttype code, for example, for some listener (listeners), you can type





);


Then press Ctrl-shift-space to see what happened.

44. It is also helpful to complete the Smarttype code when you need to set the value of an expression of a known type. For example, type

String s = (

Then press Ctrl-shift-space to see what will happen.

45. Quick check is available in all views: You can quickly navigate to an entry by typing a character in the tree.

46. When you want to catch an exception with a code snippet, select the fragment in the editor and press Ctrl-alt-t (code | Surround with ... Then select "Try/catch". It automatically generates a snap block of all exceptions thrown in the code fragment. In Options | File Templates | You can also customize the template that generates the capture block yourself in Code tab.

Other items in the list can be surrounded by other structures.

47, when using the code to complete, use the Tab key to enter the highlighted section of the pop-up list.

Unlike using the ENTER key to accept input, the selected name overwrites the other parts of the name on the right of the caret. This is especially useful when replacing another with a method or variable name.

48. When declaring a variable, the code completion feature will show you a suggestion name. For example, start typing "private FileOutputStream" and then press Ctrl-space

Android Studio shortcut key finishing sharing-sadieyu

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.