IntelliJ idea Common shortcut key list and technique encyclopedia

Source: Internet
Author: User
IntelliJ idea Common shortcut key list

ALT + RETURN import package, automatic correction
CTRL + N Lookup Class
Ctrl+shift+n Find Files
Ctrl+alt+l Format Code
Ctrl+alt+o optimization of imported classes and packages
Alt+insert generate code (e.g. Get,set method, constructor, etc.)
Ctrl+e or Alt+shift+c recently changed code
Ctrl+r Replace text
Ctrl+f Find text
Ctrl+shift+space Auto-complement 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 comparison with recently modified code

Shift+f6 Refactoring-Renaming
ctrl+shift+ the first key
Ctrl+x Delete Rows
Ctrl+d Copy Rows
ctrl+/or ctrl+shift+/annotations (//or/*...*/)
CTRL+J Automatic Code
Ctrl+e recently opened files
CTRL+H Display class structure diagram
CTRL+Q Display Note document
Alt+f1 find the location of your code
Alt+1 quickly open or hide the engineering panel
ctrl+alt+ Left/right back to the last browsed location
ALT + Left/right switch code view
ALT + Up/down Fast move positioning between methods
Ctrl+shift+up/down code moves up/down.
F2 or SHIFT+F2 highlight error or warning quick positioning

When the Code label entry is complete, press TAB to generate the code.
Select the text, press CTRL+SHIFT+F7, highlight all the text, and press ESC to highlight and disappear.
Ctrl+w Select Code, successive press will have other effects
Select the text, press ALT+F3, look down the same text one by one, and highlight it.
Ctrl+up/down cursor jumps to the first or last line
Ctrl+b the class or method at which the cursor is quickly opened


Most common shortcut keys
1.ctrl+e, you can display a list of recently edited files
2.shift+click can close the file
3.ctrl+[or] can jump to the beginning of the curly braces
4.ctrl+shift+backspace can jump to the last edit place
5.CTRL+F12, you can display the structure of the current file
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 a class
8.ctrl+shift+n, you can quickly open a file
9.alt+q can see the declaration of the current method
10.ctrl+w can select words, then statements, and then functions.
11.ALT+F1 can position the elements being edited in each panel
12.ctrl+p, you can display parameter information
13.ctrl+shift+insert can select Clipboard contents and insert
14.alt+insert can generate constructors/getter/setter and so on
15.ctrl+alt+v can introduce variables. For example, to assign the SQL in parentheses to a variable
16.ctrl+alt+t can wrap code inside a piece, such as Try/catch
17.alt+up and Alt+down can move quickly between methods
The following is not very useful
18. In some places press Alt+enter can get some intention Action, for example, change "= =" to "Equals ()"
19.ctrl+shift+alt+n can quickly open symbols
20.ctrl+shift+space in many cases can give smart hints
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 be overridden by selecting a method of the parent class
25.ctrl+q can look at Javadoc
26.ctrl+alt+space is the class name is completed automatically
27. When you open a class/file/symbol quickly, you can use the wildcard character, or you can use the abbreviation
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 can quickly jump to search results
31.ctrl+shift+j can consolidate two lines
32.alt+f8 is the value of the calculated variable


IntelliJ Idea use skill list
In the process of using Inellij idea, find data and some of your own groping, found that many Java programmers like the IDE has a lot of tips, 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 a sense of achievement: Try it.


1, write code with Alt-insert (code| Generate ... You can create getter and setter methods for any field in the class.
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml"/>


2, right click on the breakpoint mark (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 key to insert the most recently used clipboard contents into the text. When used, the system pops up a dialog box containing the contents of the clip, from which you can select the part you want to paste.


5, using the Codecompletion (code completion) attribute can quickly in the code to complete a variety of different statements, the method is to first type a class name of the first few letters and then complete the full name with Ctrl-space. If you have multiple options, they are listed in the Quick Search list.


6, with ctrl-/and ctrl-shift-/to annotate/reverse code lines and code blocks.
-/with Single-line comment mark (//...). ") to annotate/reverse the current line or select a block of code. ctrl-shift-/, however, can surround the selected blocks with a block annotation tag ("/*...*/"). To annotate a code block, press ctrl-shift-/anywhere in the block.


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


8. Use 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 line.


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


11, if you do not want to indicate the details of the "bright Ball" icon on the editor display, by pressing Alt-enter key combination to open all the list of events and then click on it can be the event text attachment of the light ball into an inactive state.
Then there will be no bright balls to indicate special events, but you can still use the Alt-enter shortcut keys.


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


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 value in the debugger is to select the text in the editor (you can perform this operation more effectively by ctrl-w the key combination several times) and press Alt-f8.


15. To open the browser of the class or method Java document used by the editor, press SHIFT-F1 (External JavaDoc of the right 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 Java document you created to the project (File | Project Properties).


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


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


18, press Ctrl-n (go to | Class ... And then type the name of the class to quickly open any one of the classes in the editor. Select the class from the displayed Drop-down list.
The same way you can use Ctrl-shift-n (go to | File ... ) to open a non-Java file in the project.


19, to navigate the code in some places to use the class, method or variable declaration, put the cursor on the view item and then press Ctrl-b. You can also switch to the declaration by pressing the Ctrl key and clicking the mouse button at the view point.


20, put the cursor on the view point and then press Ctrl-alt-b can navigate to an abstract method of implementation code.


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 current editing class. 22. Use Ctrl-shift-f7 (Search | Highlight Usages in file can quickly highlight where a variable in the current file is used. Press Escape to clear the highlighting.


23, with ALT-F3 (Search | Incremental search) in the editor to achieve a quick lookup function.
In the search for: tool, enter the characters and use the arrow keys to search the front and rear. Press Escape to exit.


24, press Ctrl-j key combination to perform some of the Live Template abbreviation that you do not remember. For example, the key "it" then press Ctrl-j to see what happens.


25. Introduce Variable consolidation helps you simplify complex statements 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 composite line and remove unnecessary space to match your code format.


27, Ctrl-shift-backspace (Go to | Last Edit Location lets you switch to the final place of the changes in the code.
Press a few more times ctrl-shift-backspace to view a deeper revision history.


28, with Tools | Reformat Code ... Refer to your code style (see Options | IDE Setting | Code Style) to format it.
Use Tools | Optimize Imports ... Can be set to view Options | IDE Setting | Code Style | Imports) automatically "optimize" imports (eliminate unwanted imports, etc.).


29. Live Templates Using Idea | Live Templates let you create a lot of typical code in the blink of an eye. For example, type in a method. And then press the TAB key to see what's going on.
Use the Tab key to move through different template fields. View Options | Live Templates to get more details.


30, to view a file modified local history, activate the right-click menu of the locals VCS | Show History .... Maybe you can navigate the different versions of the files, see their differences and roll back to any previous version. You can also see a history of changes in a directory 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 entry in the main menu, move the mouse pointer over the menu item and the status bar at the bottom of the application frame will show some of their brief descriptions that might be helpful.


32. To display the divider 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 syntax errors highlighted. ctrl-alt-down/ctrl-alt-up shortcut keys allow you to jump between compiler error messages or lookup action results.


35, by pressing Ctrl-o (Code | Override Methods ... can easily overload the base-class method. To complete the method of the interface of the current class implements (or abstract basic Class), use Ctrl-i (Code | Implement Methods ... )。


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


37, to quickly see the editor out of the characters used in the class or method of the Java document, press Ctrl-q (in the pop-up menu show Quick JavaDoc) can be.


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 the Declaration), SHIFT-F1 (External JavaDoc external Java documentation) and other shortcut keys can be used not only in the editor, but also in the right list of code completion.


39, ctrl-e (View | Recent files) pops up a list of recently accessed file right keys. Select the file to open by pressing Enter.


40. In idea, you can easily rename your classes, methods, and variables and automatically correct them wherever they are used. Try to put the editor off the character 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 portion of the current edit (class, file, method, or field) in any view (Project view, Structure view structure, or other view), press Alt-f1 (View | Select in ... )。


42. When instantiating a known type object after the "new" character, you may use Smarttype code to accomplish this feature. For example, type and then press Ctrl-shift-space:


43. By using Smarttype code, it is also very easy to create an entire anonymous implementation interface in idea, 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's happening.


44, it is also helpful to use Smarttype code when you need to set the value of a known type of expression. For example, type
String s = (<caret is here>
Then press Ctrl-shift-space to see what's going to happen.


45, in all views provide a quick search function: In the tree, you can simply type the characters to quickly navigate to an entry.


46. When you want to use code snippets to catch exceptions, select this fragment in the editor, press Ctrl-alt-t (code | Surround With ... Then select "Try/catch". It automatically produces a catch block of all the exceptions thrown in the code fragment. In Options | File Templates | In Code tab you can also customize the template that produces the capture block. You can surround other structures with other items in the list.


47, in the use of code completion, with the TAB key can be entered in the pop-up list highlighted part. Unlike using the ENTER key to accept input, this selected name overrides the other part 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 suggested name. For example, start typing "private FileOutputStream" and press Ctrl-space on the Options | IDE Setting | The Code Style can also customize names for local variables, parameters, instances, and static fields.  

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.