Idea Entry level

Source: Internet
Author: User
Tags code tag

The most intelligent IDE
Smart Tips Refactoring Code
More user-friendly code hinting features
What do you mean smart?
Powerful error-correcting capability
Idea's basic configuration
Configuration of the JDK
Idea's personal configuration and common operations
The personal configuration of idea
Idea's common operation shortcut keys

The most intelligent IDE

The biggest advantage of idea over eclipse is that it is smarter than eclipse. To what extent is it clever? Let's look at a few simple examples.

Smart Tips Refactoring Code

If the code you're writing is too complex, or there's a better way to replace the code you're writing, then idea will give you a hint that you can have a better way. Such as:

, compare the two add operations to see that idea is helping us to optimize the code.

A second example:

When we learned Java, we learned about the enhanced for loop, in fact its scientific name is called a foreach statement, the above code uses a normal for loop, and Idea tells me that using a foreach statement is better.

More user-friendly code hinting features

Use eclipse should be clear, if you want to enter the StringBuffer, then you have to enter in order, directly to lose SB is not, but in idea you can enter.

Not only that, see the next example

You can also prompt this.

These are just some simple examples, but they are strong enough.

What does intelligence mean?

The above is actually a very basic function, the idea is really smart place is that it will continue to analyze your code, and intelligent feedback. Let's look at a simple example.

This is an ordinary structs program. An action is defined in the configuration file and two different return values are set. Open our action and we can see that you can find the shortcut button to jump to the corresponding profile right from the left side of the code. If one of your methods is overriding the parent class method, you can also view the parent class method directly. More humane, idea can analyze which interfaces your action method can jump to. Do you have a little heart too?

Powerful error-correcting capability

We always make some low-level mistakes, such as an inattentive to the wrong letter, may have been looking for a long time can not find the error, idea of error correction ability may be able to help you, look at an example.

We learn from the most basic links.

Of course, before we do that, we have to install idea.

IDEA official:

https://www.jetbrains.com/idea/

Idea's basic configuration

Download good idea and avoid some configuration and personal settings. Some setup issues and actions I put at the end, because it doesn't affect our use. Let's talk about JDK configuration first.

The configuration of the JDK.

On the home page click Configure, find project structure, open. Go to the project directory, add the SDK, choose Add JDK, select the directory where you installed the JDK.

Idea's personal configuration and common operation idea's personal configuration

Modifying the Code Editor

The new idea defaults to using the Vim editor (a tool under Linux), although proficiency can improve productivity, but the learning cost is very high, not used to choose to close.

Modify theme and font size

This is a complete look at a person's liking.

Setting code hints is case insensitive

Case sensitivity: For example, we enter StringBuffer in the Java code file IntelliJ idea will not help us hint or code to add, but it is inconvenient if we enter StringBuffer to prompt and supplement the code.

Set code Check Level

This is in the bottom right corner of the interface, an old man icon (open code file to see). The control that can be dragged is the set code check level.

    • Inspections for the highest level check, you can check the spelling of words, syntax errors, variables used, calls between methods and so on.
    • Syntax can check the spelling of the words, simple grammatical errors.
    • None does not set the check.

Set up automatic guide packages

As shown in callouts 1 and 2, the default IntelliJ idea is that there is no automatic import package enabled.

    • Tick the label 1 option, IntelliJ idea will automatically help us optimize the imported package when we write the code, such as automatically removing some unused packages.
    • Tick the label 2 option, IntelliJ idea will automatically help us to import the required packages when we write the code. However, for those packages with the same name, or you need to manually ALT + Enter for import, IntelliJ idea is not smart enough to make judgments for us.

Power Saving Mode

IntelliJ idea has a state called power-down mode that IntelliJ idea turns off code checking and code hinting when this mode is turned on. So in general I would also think that this is a reading mode, if you encounter the development process of sudden code files can not be checked and prompted to see if there is a way to turn on this feature.

Slicing windows

Idea supports vertical or horizontal grouping of code. Generally in the large file modification, some changes in the file, some content under the file, if the back and forth operation may be very inefficient, this method can be much better. Of course, the premise is that your browser resolution is high enough.

Spell check

Idea by default is to turn on the word spell check, some people may have OCD do not like to see the word below the wavy line, you can remove the tick. But I personally suggest that this should not be closed, because spell checking is a good feature, when everyone's name is standard, this can be handy to help us find the code because of the spelling error caused by the bug.

TAB menu multi-line display

When many files are open, IntelliJ idea defaults to displaying all open file name Tab lines. But my personal habit is to use multiple lines, more efficient than a single line, because the single line will hide more than the interface part of the Tab, so find files inconvenient.

Open Idea Settings

When this option is checked, the last used item is opened by default when you start IntelliJ idea. This is good if you have only one project, but if you have more than one project, it is advisable to close it, so when you start IntelliJ idea you can choose a project that you recently opened.

The following option is set when we have opened a project window, and then open a Project window is the choice of how to open the way.

    • The Open Project in New window is opened each time by using a newer one.
    • The open project in the same window replaces the currently open project each time, so that there is only one Project window on the desktop.
    • Confirm window to open project in each pop-up prompt, let's choose to open or replace the current project window with a new window.

Adjust code font Size

You can check this setting by adding Ctrl + mouse wheel shortcuts to control the display of code font size.

Common actions for Idea (shortcut keys)

ALT + ENTER   Import package, automatically fix  
ctrl+n  find class  
ctrl+shift+n  find file  
ctrl+alt+l  Format code  
ctrl+alt+o  optimize 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  Replace text  
ctrl+f  find text  
ctrl+shift+space  Auto-complete code  
Ctrl + SPACEBAR   code hint  
ctrl+alt+space  class name or interface name hint  
ctrl+p  method parameter hint  
Ctrl + shift+alt+n  find a method or variable   in a class;
alt+shift+c  Compare recently modified code

Shift+f6 Refactoring-Renaming
Ctrl+x Deleting rows
Ctrl+d Copying rows
ctrl+/or ctrl+shift+/Comments (//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

When the code tag is entered, press TAB to generate the code.
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

Idea Entry level

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.