IntelliJ Idea Common settings

Source: Internet
Author: User
Tags try catch tomcat

Article reprinted from: http://www.cnblogs.com/sky100/archive/2009/01/22/1379949.html


IntelliJ idea is a very good Java editor, beginners can be some of the ways to feel very uncomfortable, just beginning to use when I also feel very unaccustomed, in reference to some online articles here to put my experience written out, I hope beginners can quickly adapt to it, You will soon feel that programming is a pleasure.
Some setup tips after installation:
1.
How to display the perfect Chinese: settings->appearance check override default fonts by (not recommended), set Name:nsimsun,size:12

2.
How to make the cursor non-arbitrary: settings->editor Remove allow placement of the caret after end of the line.

3.
How to display line numbers: Settings->editor->appearance tab items, tick show lines numbers

4.
How to make 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 hints and complement shortcut keys conflict with IME, how to resolve: Settings->keymap

Copy a shortcut key scheme first.

then expand. As shown in figure:

Select a feature, and then add a new shortcut key

The rest of the function, but also to change, such as the Blue font section above. I just changed the space in the original shortcut key to ";", which is a semicolon, which makes it much easier.



IntelliJ Idea 5.0 shortcut keys
Source: Acumen 1. Ctrl + Space completes automatic input of classes, methods, variable names
This shortcut is I most often use the shortcut key, it can complete the class, method, variable name automatic input, very convenient, now I write the program basically will not complete the input variable name, because there is a tool to help you enter, why do you have to hit the keyboard?

2. CTRL + N (Ctrl + Shift + N) jumps to the specified Java file (other file)
This function is very convenient, at least I do not have to every time in a long list of file list to find I want to edit the class file and JSP file
3. Ctrl + B jump to Definition
4. Ctrl + Alt + right/left jump between edited code locations (forward/backward)
5. Ctrl + Alt + T with * to surround the selected line of code (* includes if, while,
Try catch, etc.)
This function is also very convenient, put the previous to do: ① first write If-else,② and then adjust the code
Indentation format, 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 an action
In idea, the shortcut function is to select the word at the character where the cursor is located, then select the source
The extended area of the code. For example, the statement below
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 quotation marks, 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 change to the code.
It is to choose the long compound expression, it is very convenient:)
8. Shift + F1 Displays the specified Java docs in the browser
This should also be a feature that almost every Java IDE has to offer, and not much to say.
9. Ctrl + Q displays Java Docs in the editor window
This is handy-because sometimes just forgetting one of the parameters in a method you've written
Meaning, at this point, and do not want to start a browser to view the Java doc, the benefits of this feature is
Show it.
Ctrl +/Comment/counter-comment The specified statement
It can annotate and counter-annotate the statement you have selected (using a single-line comment symbol "//"),
You can also use CTRL + Shift +/To annotate multiple lines of statements (that is, use the multiline comment symbol "/* ... */")
F2/shift + F2 Jump to the next/previous Error statement
Idea provides a convenient jump between error statements, and you can use this shortcut to
Shortcut jumps between the statements that are faulted.
Shift + F6 provides renaming of methods and variables
I use less of the Refector function provided by idea, compared to the function I use most
of the. For this function there is nothing to say, it is very convenient, try it quickly.

Ctrl + Alt + L format the selected code according to the template
Format your Java code according to the formats set in the template, but unfortunately only the Java files
Valid: (
Ctrl + Alt + I automatically indent the selected code
This function also works when editing JSP files, providing a format code for the top
Functional supplement.
Ctrl + Alt + O optimize import
Automatic removal of useless import statements, pretty good one feature.
Ctrl +/[Jump to end of code block/start

Ctrl+g (jump to the specified line), CTRL+F4 (Close the current edit page), ctrl+f (search), etc.
You can download a PDF of Idea 3.0 Default Keymap on the official website of Idea
(http://www.intellij.com/docs/ReferenceCard.pdf) with shortcut keys on it
Detailed list and feature brief, if you feel that the key combination of the shortcut keys defined by idea does not match your
Using the habit, you can change the set to your custom keying combination in Option--keymaps.


Ctrl+space//Complete Code, conflict with IME, change to Alt+s
Ctrl+d//row copy, or selected string copy
Ctrl + W Press A word to select the action
CTRL + N (Ctrl + Shift + N)//jump to the specified Java file (other file)
Ctrl + B jumps to the 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 lines of statements (that is, use the multiline comment symbol "/* ... */")
Ctrl + Alt + L//format code
Ctrl + Alt + O optimize import
Ctrl + Alt + T uses * to surround the selected line of code (* includes if, while,
Try catch, etc.)
ALT+F7//Find usage
SHIFT+F6//Rename
F6//Mobile
CTRL+SHIFT+F7//Display string usage times
Alt+delete//Safe Removal
Ctrl +/[Jump to code block end/Start

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.