IntelliJ IDEA sets the shortcut keys for code hints or auto-completion (with IntelliJ IDEA common shortcut keys)

IntelliJ Idea Common Shortcuts List

Alt+Enter to import packages, automatically correct
Ctrl+N Find classes
Ctrl+Shift+N Find files
Ctrl+Alt+L Format code
Ctrl+Alt+O Optimize imported classes and packages
Alt+Insert Generate code (such as get, set methods , constructor, etc.)
Ctrl+E or Alt+Shift+C Recently changed code
Ctrl+R Replace text
Ctrl+F Find text
Ctrl+Shift+Space Auto-completion code
Ctrl+Space Code hint
Ctrl+Alt+Space Class name or interface Name prompt
Ctrl+P Method parameter prompt
Ctrl+Shift+Alt+N Find a method or variable in a class
Alt+Shift+C Compare the most recently modified code
 
Shift+F6 Refactor-rename
Ctrl+Shift+Up key
Ctrl+X Delete Line
Ctrl+D Copy line
Ctrl+/ or Ctrl+Shift+/ Comment (// or /*...*/ )
Ctrl+J Autocode
Ctrl+E Recently opened file
Ctrl+H Show class diagram
Ctrl+Q Show comment Documentation
Alt+F1 Find the location of the code
Alt+1 Quickly open or hide the project panel
Ctrl+Alt+ left/right Return to the last browsed location
Alt+ left/right Switch code view
Alt+ Up/Down Quickly move positioning between methods
Ctrl+Shift+Up/Down Move code up/down.
F2 or Shift+F2 Highlight errors or warnings to quickly locate
 
the code label After inputting the label, press Tab to generate the code.
Select the text, press Ctrl+Shift+F7, highlight all the text, press Esc to highlight disappear.
Ctrl+W to select the code, press it continuously to have other effects
to select the text, press Alt+F3 to find the same text one by one and highlight it.
Ctrl+Up/Down The cursor jumps to the first or last line
Ctrl+B Quickly opens the class or method at the cursor


The most commonly used shortcut keys
1. Ctrl + E, can 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 the braces
4. Ctrl + Shift + Backspace can jump to the last edited place
5. Ctrl + F12 , can display the structure of the current file
6. Ctrl + F7 can query the reference of the current element in the current file, then press F3 to select
7. Ctrl + N, you can quickly open the class
8. Ctrl + Shift + N, you can quickly open the file
9. Alt + Q to see the current method 10.Ctrl + W can select
words, then statements, then lines, and then functions Generate constructor/Getter/Setter, etc. 15.Ctrl+Alt+V can introduce variables. For example, assign the SQL in parentheses to a variable 16. Ctrl+Alt+T can wrap the code in one block, such as try/catch 17.Alt+Up and Alt+Down can quickly move between methods. The following is not very useful 18. Press Alt+Enter in some places to get Some Intention Actions, such as changing "==" to "equals()" 19.Ctrl+Shift+Alt+N can quickly open symbols










20. Ctrl + Shift + Space can give Smart prompts in many cases
21. Alt + F3 can quickly find
22. Ctrl + / and Ctrl + Shift + / can comment code
23. Ctrl + Alt + B can jump to the implementation of abstract methods
24. Ctrl + O can choose the method of the parent class to re-implement Write
25. Ctrl+Q to see JavaDoc
26. Ctrl+Alt+Space is the automatic completion of class names
27. When quickly opening classes/files/symbols, you can use wildcards or abbreviations
28.Live Templates! Ctrl+J
29.Ctrl+Shift+F7 can highlight the current element in the current Use in the 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 to calculate the variable value

List of IntelliJ IDEA skills

In the process of using InelliJ IDEA, through searching for information and some of my own exploration, I found that there are many tips worth mentioning in this IDE that many Java programmers like. If you can skillfully apply them to the actual development process, I believe It will save you a lot of development time, and there will be a little sense of accomplishment that comes with it :) Try it!

1. When writing code, use Alt-Insert (Code|Generate…) to create getter and setter methods for any field in the class. 
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

2. Right-click the breakpoint marker (in the left column of the text) to activate the quick-check menu, you can quickly set the enable/disable breakpoint or condition its properties.

3. A special variable in the CodeCompletion property is that activating Ctrl-Alt-Space can complete class names in or not in the current file. The import flag is automatically created if the class is not imported.

4. Use the Ctrl-Shift-V shortcut to insert the most recently used clipboard content selection into the text. When using, the system will pop up a dialog box containing clipping content, from which you can select the part you want to paste.

5. Use the CodeCompletion (code completion) attribute to quickly complete various statements in the 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 cheat list.

6. Use Ctrl-/ and Ctrl-Shift-/ to comment/uncomment lines and blocks of code. 
-/ Use a single-line comment marker (" //... ") to comment/uncomment the current line or selected block of code. Ctrl-Shift-/, on the other hand, encloses the selected block with block comment markers (“ /*…*/ ”). To uncomment a block of code just press Ctrl-Shift-/ anywhere in the block.

7. Press Alt-Q (View|Context Info) to view the declaration of the current method without moving the code. Press twice in succession to display the currently edited class name.

8. Use Refactor|Copy Class… to create a "copy" of the selected class. This is useful, for example, when you want to create a class that is mostly identical to an existing class.

9. In the editor, Ctrl-D can copy the selected block or the current line without the selected block.

10. The function of Ctrl-W (select word) in the editor is to first select the word at the caret, and then select the extension area of ​​the source code. For example, choose a method name, then the expression that calls the method, then the entire statement, then the containing block, and so on.

11. If you don't want the "bright ball" icon indicating the details of the event to be displayed in the editor, by pressing the Alt-Enter key combination to open the list of all events and clicking it with the mouse, you can set the bright ball attached to the event text to non Active status. 
This way there will be no brighter balls indicating special events in the future, but you can still use it with the Alt-Enter shortcut.

12. When using CodeCompletion, you can use the comma ( . ) character, comma (,) semicolon (;), space and other characters to enter the currently highlighted part in the pop-up list. The selected name is automatically entered into the editor along with the characters entered.

13. Use the Escape key in any tool window to move the focus to the editor. 
Shift-Escape not only moves the focus to the editor but also hides 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 see the value of any expression while debugging a program is to select the text in the editor (you can do this more efficiently by pressing Ctrl-W a few times) and then press Alt-F8.

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

16. With the Ctrl-F12 (View | File Structure Popup) keys you can quickly navigate in the currently edited file. At this point it will display a list of members of the current class. Highlight an element to navigate and press Enter or F4. To easily navigate to an entry in the list, just type its name.

17. Put the cursor on the marker or its checkpoint in the code and press Alt-F7 (Find Usages... in the right-click menu) to quickly find a class, method or variable used in the entire project s position.

18. Press Ctrl-N (Go to | Class…) and 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. 
In the same way you can open non-Java files in a project by using Ctrl-Shift-N ( Go to | File… ).

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

20. Put the cursor on the view point and press Ctrl-Alt-B to navigate to the implementation code of an abstract method.

21. To see the inheritance hierarchy of a selected class, press Ctrl-H (Browse Type Hierarchy). You can also activate the inheritance relationship view in the editor to view the inheritance relationship of the currently edited class. 22. Use Ctrl-Shift-F7 (Search | Highlight Usages in File) to quickly highlight the usage of a variable in the current file. Press Escape to clear the highlight.

23. Use Alt-F3 (Search | Incremental Search) to implement quick search function in the editor. 
Enter characters in the "Search for:" tooltip and use the arrow keys to search forward and backward. Press Escape to exit.

24. Press Ctrl-J to execute some Live Template abbreviations you can'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 code snippet below, select an expression in the code: Then press Ctrl-Alt-V .

26. The Ctrl-Shift-J shortcut combines two lines into one line and removes unnecessary spaces to match your code format.

27. Ctrl-Shift-Backspace ( Go to | Last Edit Location ) lets you go to the last place where the changes were made in the code. 
Press Ctrl-Shift-Backspace a few more times to see a deeper revision history.

28. Use Tools | Reformat Code… to format the code according to your code style reference (see Options | IDE Setting | Code Style). 
Use Tools | Optimize Imports… to automatically "optimize" imports (clean out useless imports, etc.) based on settings (see Options | IDE Setting | Code Style | Imports).

29. Use IDEA's Live Templates | Live Templates allows you to create a lot of typical code in the blink of an eye. For example, typing in a method. Press Tab again to see what happens. 
Use the Tab key to move through the different template fields. See Options | Live Templates for more details.

30. To view the local history of modifications in a file, activate Local VCS | Show History… in the right-click menu. Maybe you can navigate the different file versions, see how they differ and roll back to any previous version. The history of modifications in a directory can also be viewed using the same right-click menu entry. With this feature you won't lose any code.

31. If you want to understand the purpose of each item in the main menu, move the mouse pointer over the menu items and then the status bar at the bottom of the application frame will display some brief descriptions of them, which may help you.

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

33. Use the Alt-Up and Alt-Down keys to quickly move between different methods in the editor.

34. Use F2/Shift-F2 to jump between highlighted syntax errors. Use the Ctrl-Alt-Down/Ctrl-Alt-Up shortcuts to jump between compiler error messages or search results.

35. By pressing Ctrl-O (Code | Override Methods… ) you can easily override the basic class methods. To complete the methods of the interface of the current class implements (or of the abstract base class), 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 of the class or method used at the editor's caret, press Ctrl-Q (in the Show Quick JavaDoc in the pop-up menu).

38. Like Ctrl-Q (Show Quick JavaDoc to display concise Java documentation), Ctrl-P (Show Parameter Info to display parameter information), Ctrl-B (Go to Declaration to jump to the declaration), Shift-F1 (External JavaDoc External Java documentation ) and some other shortcuts 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 a right-click list of recently accessed files. 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 everywhere you use them. To try it out, place the editor caret on any variable name and press Shift-F6 ( Refactor | Rename… ). Type the new name to be displayed in the dialog box and press Enter. You will browse to all places where this variable is used and press the "Do Refactor" button to end the rename operation.

41. To quickly select the currently edited part (class, file, method or field) in any view (Project View, Structure View or other views), press Alt-F1 (View | Select in… ).

42. You may use SmartType code to complete this feature when instantiating an object of a known type after the "new" character. For example, type and press Ctrl-Shift-Space:

43. By using SmartType code completion, it is also very easy to create the entire anonymous implementation of the interface in IDEA. For example, for some listeners, you can type 
Component component; 
component.addMouseListener( 
  new <caret is here>  
);

Then press Ctrl-Shift-Space again to see what happens.

44. SmartType code completion is also helpful when you need to set the value of an expression of a known type. For example, type 
String s = ( <caret is here>  
and press Ctrl-Shift-Space to see what comes up.

45. Quick search function is provided in all views: just type characters in the tree to quickly locate an item.

46. ​​When you want to use a code snippet to catch exceptions, select the snippet in the editor, press Ctrl-Alt-T (Code | Surround with… ) and select "try/catch". It automatically generates catch blocks for all exceptions thrown in the snippet. In the Options | File Templates | Code tab you can also customize the templates for generating capture blocks. Other structures can be surrounded by other items in the list.

47. When using code completion, use the Tab key to enter the highlighted part in the pop-up list. Unlike the Enter key to accept input, the selected name overwrites the rest of the name to the right of the caret. This is especially useful when substituting one method or variable name for another.

48. The code completion feature will show you a suggested name when declaring a variable. For example, start typing " private FileOutputStream " and then press Ctrl-Space In Options | IDE Setting | Code Style you can also customize names for local variables, parameters, instances and static fields.

 

The modification method is as follows:

Click on the File menu (File) –> Click on Settings (Settings… Ctrl+Alt+S), –> to open the Settings dialog.

Click KeyMap in the left navigation box. 
Then select Main menu –> Code –> Completion in the tree box on the right. 
Then you need to do two things: 
1. Remove the Alt+/ shortcut key binding of the original Cycle Expand Word. 
2. Right-click on Basic, remove the original Ctrl+space binding, and then add the Alt+/ shortcut.

Then Apply, OK.

 

copy to  http://www.cnblogs.com/jx17/p/6244491.html

 

 

Donor sharer

          I didn't like programming before, but now I am an IT fan obsessed with programming. I would like to share some things I have sorted out and optimized here, hoping to help IT fans, with joy and sweat, and at the same time I also hope that everyone can support it. Of course, if you have money to support a money field (support Alipay and WeChat donations, join the it data center buckle group), but have no money to support a personal field, with your support, we will be more motivated and do better, thank you Ladies and gentlemen.

 

Guess you like

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