IntelliJ Idea shortcut key Daquan

Source: Internet
Author: User

Recently contacted IntelliJ this tool, with a few days, a lot of operations are not very familiar. I've been using eclipse before, and it's a bit unaccustomed to use this tool. But there are some aspects of the tool that are really good, such as JavaScript auto-completion, HTML page authoring, and so on, which is much better than other IDE tools. Here are some shortcut keys for this tool. But some are not too common, for reference only. Where the red part denotes common use.

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

after the code label input is complete, press TAB to generate the codes.

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

The following is the shortcut key Daquan, if you can not find in the above common area to try to see this area:

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.

-/Use a single-line comment mark ("//...") to comment/reverse-annotate the current line or the selected 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 the comma (.) character, comma (,) semicolon (;), spaces, and other characters to enter the current highlighted part of the pop-up 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.

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.

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 quickly select the current editing section (class, file, method or field) in any view (Project view, Structure view, or other view), 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.

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

Component Component;

Component.addmouselistener (

New <caret is here>

);

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 = (<caret is here>

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.

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 = (<caret is here>

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.

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 = (<caret is here>

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.

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 press Ctrl-space in Options | IDE Setting | The Code style also allows you to customize names for local variables, parameters, instances, and static fields.

IntelliJ Idea shortcut key Daquan

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.