IntelliJ Idea Common settings

Source: Internet
Author: User
Tags try catch
IntelliJ idea is a very good Java editor, beginners can be some of these practices are very awkward, just started to use when I also feel very unaccustomed, in reference to some articles on the internet here to write some of my experience, I hope beginners can quickly adapt to it, Soon you will feel that programming is a pleasure.

Some of the Setup tips after installation:
1. How to display the perfect Chinese: settings->appearance override default fonts by (not recommended), set Name:nsimsun,size:12


2. How to let the cursor not randomly positioned: settings->editor remove allow placement of caret after the line.


3. How to display line number: Settings->editor->appearance label item, tick show lines numbers


4. How to let IntelliJ idea move without opening the project file: Settings->general remove reopen last project on startup.


5. Why can't I start Tomcat in IntelliJ idea: Please use the zip version of Tomcat

6. Default code hint and complement shortcut key with Input method conflict, how to solve: Settings->keymap


Copy a shortcut key scheme first.


Unfold again. As shown in figure:


Select the feature, and then add a new shortcut key


The remaining features, also want to change, such as the Blue font section above. I just changed the space in the original shortcut to ";", which is a semicolon, which is much more convenient.


IntelliJ Idea 5.0 shortcut keys
1. Ctrl + Space to complete the class, method, variable name automatic input
This shortcut is my most frequently used shortcut keys, it can complete the class, method, variable name of the automatic input, very convenient, now I write the program will not basically complete the input variable name, because of the tool to help you input, why do you have to knock the keyboard yourself.

2. CTRL + N (Ctrl + Shift + N) jump to the specified Java file (other files)
This function is very convenient, at least I do not have every time in a long list of files to find I want to edit the class file and JSP files
3. Ctrl + B jump to Definition
4. Ctrl + Alt + right/left jumps between the edited code locations (forward/backward)
5. Ctrl + ALT + T uses * to surround selected lines of code (* including if, while,
Try catch, etc.)
This function is also very convenient, the previous to do: ① first write If-else,② and then adjust the code
Indentation format, but also pay attention to whether the parentheses match, now use this function to do, more convenient
6. Ctrl + Alt + B jump to method implementation
7. Ctrl + W Press A word to select the operation
The shortcut function in idea is to first select the word at the character where the cursor is located, then select the source
The extension area of the code. For example, to the bottom of this statement
Java.text.SimpleDateFormat formatter =
New Java.text.SimpleDateFormat ("Yyyy-mm-dd hh:mm");
When the position of the cursor is in a string within double quotes, the string is selected first, followed by the equal sign
The expression on the right, and then the whole sentence. I usually use it when I make a new revision to the code.
It to select those long complex expressions, very convenient:
8. Shift + F1 Displays the specified Java docs in the browser
This should also be the function that almost all of the Java IDE provides, and it's not much to say.
9. Ctrl + Q Displays the Java Docs in editor window
This is a handy feature--because sometimes you just forget about one of the parameters in the method you wrote.
Meaning, at this time do not want to start a browser to view Java doc, at this time the benefits of this feature
It manifests itself.
Ctrl +/comment/anti-annotation specified statement
It can annotate and annotate the statement you select (using a single-line annotation symbol "//"),
You can also use CTRL + Shift +/To annotate multiple-line statements (that is, use multiline annotation symbol "/* ... * *")
F2/shift + F2 jump to bottom/previous Error statement
Idea provides a convenient jump function between error statements, and you can use this shortcut key to
Quick jumps between the statements that are wrong.
Shift + F6 provides a way to rename a variable
I use less of the Refector function for idea, compared to the function I use most
of it. There is nothing to say about this function, it is really convenient, try it quickly.

Ctrl + Alt + L format selected code based on template
Format your Java code according to the formatting in the template, but unfortunately only for Java files
Valid: (
Ctrl + Alt + I automatically indent selected code
This feature can also work when editing JSP files, providing a format for the top of the code
Functional supplements.
Ctrl + Alt + O optimize import
Automatic removal of useless import statements, quite a good feature.
Ctrl +/[Jump to end of code block/start

Ctrl+g (jumps to the specified line), CTRL+F4 (closes the current edit page), ctrl+f (search), and so on
Can go to Idea's official website to download a PDF document with idea 3.0 Default Keymap
(Http://www.intellij.com/docs/ReferenceCard.pdf), with shortcut keys on top
Detailed list and feature introduction if you feel the key combination of the shortcut keys defined by idea does not match your
If you use a habit, you can modify the Option--keymaps settings into your custom keys.


Ctrl+space//Complete Code, conflict with input method, change to Alt+s
Ctrl+d//row copy, or selected string copy
Ctrl + W Press A word to select the operation
CTRL + N (Ctrl + Shift + N)//jump to the specified Java file (other files)
Ctrl + B jump to Definition
Ctrl + Alt + B jump to method implementation
CTRL+J//Insert Code template
Alt+insert//Generate, generating constructor, setter, getter
Ctrl+o//Coverage method
Ctrl+i//Implementation method
Ctrl+alt+t//Surround With
ctrl+///Line Comment
Ctrl + Shift +/To annotate multiple-line statements (that is, use multiline annotation symbol "/* ... * *")
Ctrl + Alt + L//format code
Ctrl + Alt + O optimize import
Ctrl + Alt + T uses * to surround selected lines of code (* including if, while,
Try catch, etc.)
ALT+F7//Find usage
SHIFT+F6//renaming
F6//Mobile
CTRL+SHIFT+F7//Display string usage times
Alt+delete//Safe Removal
Ctrl + [Jump to end of code block/startThis article sources change idea background colorEditor-colors&font-general-default text put the background on the hook, and then set the favorite color.

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.