IntelliJ idea usage tips and common shortcut keys

Source: Internet
Author: User
Tags try catch

That kind of acid is cool, can't tell —————————————————————————— By:jimi no Bond.
Who's Jimi? It's batting practice!

Just beginning to learn to write Java, with the eclipse, after the formal work, the main use of the MyEclipse, early last year in the recommendation of predecessors, in 20 percent bought a genuine IntelliJ idea and pycharm,12.0 version of the lifetime use, one year update.
Used long ago heard its name, is said to be the best Java development tools.
At first it was very unaccustomed, but it took a lot of money to use it.
Just a week, totally fell in love with it! It's spicy, sour and cool! --------------------------------------------------------------is dedicated to Cheese's doubts about embracing idea.

JetBrains (the company's name translates "Brain jets?"). The company's propaganda says so: Develop with pleasure! (with Happy development!) )

Why?
How can they be so confident?
What kind of a tool is this?

Come with me and count the places where idea is particularly long:

A. Black Theme Darcula



The eye is comfortable, the most important is cool!
Setting Mode: File--settings--edit--colors&fonts--scheme name

Two. Smart Tips

When creating or introducing a project, the missing package is automatically introduced, and you can find the search in the net
When typing code, case-sensitive smart hints, automatic introduction of the package, if there is a duplicate name will list all the choices, but more clever than myeclipse, as to how a clever method, you have to try to know.

Three. Tool integration

Basically all of the commonly used tools are integrated and basically in a location you can easily touch.
Tell me more about what I'm used to:

1.ant
You know

2.maven
You know it.

3.SVN
In contrast, the SVN submission of idea provides more options and functionality
Both sides of the submitted interface display a partial comparison of the current file and modifications, which makes it very easy to check and modify the file.
Before submission:
(1). selectable Automatic Formatting
(2). option to automatically ignore unused imports
(3). Selectable Analysis Code
(4). Check if there are todo
After submission, you can even choose to upload changes to a specific directory

4. System Terminal
With this thing, you don't have to switch windows frequently.
Open mode: Tools--open Terminal

5.SSH Tools
Open mode: Tools--start SSH session

6. Database Connection Tool
Open mode: View--tool windows--database

7.IDEA Talk
Magical things, you can contact other idea users in the LAN, you can easily show your code to your colleagues
Open mode: View--tool Windows--idea Talk

8.Changes
Very convenient changes view, it will color display all your changed files, and can easily compare with local history or online history
Open mode: View--tool windows--changes

There are git, GitHub, CVS, groovy Consle and so on, and so on, you can also:
File--settings--plugins

Four. Powerful Drawing tools

Read the source can not understand the project structure? Writing an article drawing class diagram good trouble?
Right-click Diagram help you

The previous example diagram:

Right-click Show Categories have a surprise, what range, method, constructor, inner class all have

Five. Seamless access to eclipse and MyEclipse

Idea can open a project with a. project file directly, or you can export your own project as an Eclipse project.
And because the project configuration file for idea is 1. iml files plus a separate folder. Idea,
So as long as you put both into the Ignore directory, even if you personally use idea and the team uses other Ides, it will not cause trouble for others.

Export method: File--export to eclipse

six. Smaller volume, faster speed

used the myeclipse you know

In conclusion, I think you should be able to understand why writing code with idea is so enjoyable, It's so sour, it's so disappointing!


Then share some of the shortcuts that I used more often in development:

one. Find a file to find the code for references

1. Double-click Shift
  Find all the directories in the project, you want to see what you don't want to see, and you never thought you could see it.

2.ctrl+f
Current file Find specific content

3.ctrl+shift+f
Current project find files with specific content

4.ctrl+n
Find class

5.ctrl+shift+n
Find file

6.ctrl+e
Recent files

7.alt+f7
A very, very frequent use of a shortcut key that can help you find all references to your function or variable or class where

two. Edit related

1.shift+enter
Another line

2.ctrl+r
Current file Replace specific content

3.ctrl+shift+r
Replace specific content with current project

4.shift+f6
A very, very, very easy shortcut key , you can rename your classes, methods, variables, and so on, and this renaming can even optionally replace the contents of the comment

5.ctrl+d
Copy the current line to the next line

6.ctrl+x
Cut the current line

7.ctrl+c \ ctrl+v 
everyone knows.

8.ctrl+z
Revoke

9.ctrl+shift+z
Cancel undo

10.ctrl+k
Submit code to SVN

11.ctrl+t
Update code

12.alt+insert
Very, very handy for a key combination, don't believe you look down
use in class:

can automatically generate constructors, Getter/setter, and so on common methods
To use on the project directory:

Can be used to create new types of files.

13.alt+enter
Another big kill, how much to kill?
Example 1:
What do you find the code is "yellow"?

Mouse Move Up meow:

Try Alt+enter:

Choose Simplify to see

I take a go, the code is simple, there are wood!

PS: Yellow warning compile can pass, do not affect the normal operation of the program, generally are some recommendations for code optimization, I have encountered the following:
(1). can be simplify
Code can simplify
(2). Variable is never use
Declared variables have never been used
(3) Unnecessary boxing
Unnecessary declaration of packaging

And so on and so on, pay more attention to some of the details of the code to better understand.

Example 2:
Write a class to implement an interface, plus implements Runnable you will find this red wavy line:

Let's try a alt+enter on this line:

Moved to cry with wood there? You thought of the idea that you didn't think of.
See the code hint of the various red xx, try Alt+enter it! What does not throw the exception ah no try catch ah can be fixed.

14.ctrl+alt+l

Auto-format code, I have developed the habit of writing the code to get out.
You can personalize your own code style: file--Settings--codestyle

—————————— cut —————————— cut —————————— cut —————————— cut —————————— cut ——————————

There are pros and cons, idea is also a double-edged sword, and finally say that it is not good place

1. The most important thing is "expensive"!
Professional version of the personal license 20 percent can accept, 50 percent small expensive, no discount mulberry can't afford!!! Embarrassed rz~
The consumption of American knives has deterred most of the apes struggling on the silk thread of the country.
Fortunately, there is a community version of JetBrains, and recently there is a free key for students.
For the use of cracked version of the small partner, it is recommended that you use the good, not too quiet.

Users develop good software payment habits to make our work more and more valuable.

2. Integration is perfect.
The integrated tools are fully capable of coping with most of the work needs, and for superficial understanding and lazy cheese, direct use, and possibly a lot of tools, you will not understand, and will not understand.
For example: maven,ant

3. Do not bring your own JDK
is not the disadvantage of the disadvantage, MyEclipse is integrated


Almost, that's the code.
These are just a few of the things I've learned about using idea 1.5.
Limited capacity, a brick pat.
If you have a more powerful means of lethality, welcome to the exchange.

PostScript: Recently accidentally found that this article was reproduced, and did not indicate the source, the egg hurts.
In this reiterated, reproduced, please indicate the source.
From: http://www.blogjava.net/rockblue1988/archive/2014/10/24/418994.html

IntelliJ idea usage tips and common shortcut keys

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.