The ape wants to be good, and he will Ide-intellij idea.

Source: Internet
Author: User
Tags code tag

The ape wants to be good, and he will Ide-intellij idea.

If money is the yardstick of goods, then time is the measure of efficiency. Therefore, for a lack of efficiency, it will pay a high price. --Bacon

My colleague has been recommending idea to me, saying that compared to eclipse is the Stone Age tool, I have always been able to use the eclipse as a tool, so I have been sticking to it, but I have seen the idea function, there are a few more attracted me, 1 can be full keyboard operation, 2 double bar display, 3 Multi-window display, 4 plug-in integration is more convenient than Eclipse, 5 interface is very beautiful. So it is decided to try the idea, if it is really so good, can improve efficiency why not?

Download Installation

IDEA has 2 versions, Community version and commercial version, the community version is free commercial version is charged (commercial version to provide more features than Community version).
"Official website address Download" "Baidu Cloud Disk Download 2016 Business Edition" (I still want to support the genuine (Purchase license link), just 499 knife/year for me or too expensive, so can only silently in the heart support, the way to crack can refer to http://idea.lanyus.com/ , offline hack best in a local license server, there are a lot of coverage jar files on the web, I tried a few did not succeed. Offline hack tutorial link) installation Although no eclipse as green Compression Direct decompression is OK, but the next step is not encountered any obstacle.

First Impressions

Start the page or see the familiar progress bar, but after the progress bar is gone, you can not go directly to the work page, but need to select an item first. Here is also an important difference between idea and Eclipse, Eclipse has the concept of workspace, a workspace inside can have multiple project,project between is relatively independent, and idea without workspace concept, The top of the list is Project,project can build several module, although the hierarchical relationship is two layers, but not exactly equal, idea of the module is more flexible than eclipse. Bury a pit behind and say. The first impression of idea is still very good.

HELLO World

For programmers, all sermons are not as good as a helloword on the screen. Before we start, we need to clear our brains and forget about the habits we used to eclipse, starting with 0 completely. Idea gives us almost all the possibilities for new projects, create new project.


Entering the next step is create project form template equivalent to selecting a template project, which can be skipped, entered project name with project location the project's name and the project storage path. Click Finish to complete a new project. srcRight Button new package Everything is still so familiar, create a familiar Helloword class. ctrl+F9compile and shift+F10 compile the run.

If you find that I'm not the same as your interface, it's because I modified the configuration to accommodate the difference between eclipse and idea, and later on how to configure Eclipse. Here to fill in the pit of project and workspace, just now the new project process is almost the same as the new project process in Eclipse, and there is not much difference. But many online say Eclipse's workspace is equivalent to project in idea. I don't think this is the way to understand, first of all we should be clear whether workspace or project is provided to us by the IDE to facilitate the management of the project, in Java there is no such concept, for Java only need to execute a similar command can be, Don't care how you manage the project,

D:\work\java\JDK1.6.0_34\ Bin\java-didea.launcher.port=7534 "-didea.launcher.bin.path=d:\work\jetbrains\intellijIdea 2016.1.1\ Bin"-dfile.encoding=utf-8-classpath" D:\work\java\JDK1.6.0_34\jre\lib\charsets. Jar;d:\work\java\JDK1.6.0_34\jre\lib\deploy. Jar;d:\work\java\JDK1.6.0_34\jre\lib\ext\dnsns. Jar;d:\work\java\JDK1.6.0_34\jre\lib\ext\localedata. Jar;d:\work\java\JDK1.6.0_34\jre\lib\ext\sunjce_provider.jar;d:\work\java\JDK1.6.0_34\jre\lib\ext\sunmscapi. Jar;d:\work\java\JDK1.6.0_34\jre\lib\ext\SUNPKCS11.jar;d:\work\java\JDK1.6.0_34\jre\lib\javaws. Jar;d:\work\java\JDK1.6.0_34\jre\lib\jce. Jar;d:\work\java\JDK1.6.0_34\jre\lib\jsse. Jar;d:\work\java\JDK1.6.0_34\jre\lib\management-agent.jar;d:\work\java\JDK1.6.0_34\jre\lib\plugin. Jar;d:\work\java\JDK1.6.0_34\jre\lib\resources. Jar;d:\work\java\JDK1.6.0_34\jre\lib\rt. jar; H:\ideawork\test01\out\production\test01;d:\work\jetbrains\intellijIdea 2016.1.1\lib\idea_rt.jar "Com.intellij.rt.execution.application.AppMain com.baidu.test01.Test01

So eclipse provides a way of workspace management, and workspace project is relatively independent, for example, when project compiles, it will be generated in its own bin directory. Eclipse prefers multiple project management, and Idea prefers the management of a single project, and the relationship between module and project in project is a attribution relationship. But Eclipse workspace and project don't have this concept, but the module in idea is in project, and Idea's module is more like the concept of module in Maven, Multiple module is just a different layer of project, but the idea of the module can also be done in a similar independent, the module can also have no dependencies, so it feels like project in Eclipse is similar, But this is not the idea of the original design, there is a point to reflect the relationship between project and module is the output path in idea, all the module output path under Project is the Project/out/production directory, So it's not recommended that you put multiple projects in one project as a different module to manage, but you can open ideas.

This is my tool!

The idea was pretty, but it was too far ahead for me, who used to be a spoiled eclipse. So let it get used to it.

Open Configuration Management

First of all remember this shortcut key ctrl+alt+s , click to know, settings out, with the previous eclipse in the window->Preferences same, configuration items, but most of us do not use.

Modify Theme Style

Idea gives us three kinds of themes, DARCLA black style is too high, I still change back to the default IntelliJ bar,--- ctrl+alt+s appearance&behacior appearancetheme

code hint key

alt+/In eclipse, this key can be said to be a divine key, but in idea it does not work, idea inside the code hint shortcut key is CTRL + SPACE (very familiar, and switch keyboard shortcut key conflict changed to our familiar alt+/bar)
ctrl+alt+sThe keymap mainmenu->code->completion original CTRL + Space is deleted and the alt+/is deleted, and then add alt+/save OK.

code font is not good to see the font size is too small?

Looking at the font of Eclipse, looking at the courier font of the idea code is too uncomfortable, and the font size is too small,--look is ctrl+alt+s edit color&fonts font(这里需要新建一个,字体courier size14) not much better. We also console font changed the following console font by the way.

Show Line Numbers

The line number is definitely not less, but idea is not as easy as Eclipse. Right-click Show lines Number,idea also need---- ctrl+alt+s editor general appearanceshow line numbers

double-column display code

This really is eclipse can not compare, to write code really is too practical. Operation is very simple, experience a bit but no sublime text is easy to use. But it's good, and the window can be taken out, which is beyond the reach of Eclipse.

let Idea go first .

Maven
The MAVEN plugin has been integrated in idea, does not need to be downloaded again, can be used almost without modifying the configuration, but we are still accustomed to modify the version of Maven, to ensure that we do not appear in the process because of the version caused by the problem.

Version Control
Whether you're using SVN, git, or GitHub to get started quickly in idea, there are a variety of version control plugins built into idea.

First download SLIKSVN (you can not download the SVN tool, directly using the idea of the SVN tool, I encountered the first time in use SVN commit can not be submitted, so it is recommended to download the SVN tool) after the installation is complete, configureuser command line clientSvn.exe's path, like mine.D:\Work\SlikSVN\bin\svn.exe
git needs to install Git's client first
Windows git version point I download (msysgit link) This download if there is a problem, provide a Baidu cloud point I download (Baidu Cloud link) 2.7.4
After the installation is complete, modify the Ideagit configuration:

You can use version control as easily as eclipse.
(Version control has a configuration that is recommended to tick on:Show directories with changed descendantsWith the eclipse of the effect is the same, if the file is modified, then the long layer of the file all the directories have become the modified identity)
compiling a Web project
In fact, the idea that all the third-party operation of the project is basically the same, such as we use MAVEN to compile the project, before in eclipse need to right-clickrun asThe parameters of Maven can be configured to run, similar to the idea.

And then the configuration of eclipse is almost exactly the same, the configuration of the boot name before eclipse can not be duplicate, there is no limit, and then select the running project, execute the command.

Runtime only need to select Run Configurationshift+F10
run the Web project
Tomcat
First you need to download and install Tomcat. Download tomcat, configure boot configuration after installing Tomcat, 1 Add a Tomcat boot configuration 2 configuration TOMCAT3 Select Tomcat Security Directory 4 Configure startup name 5 tick off start auto start browser

6 Switch to Deployment and add the project we want to deploy to Tomcat.

Start the Tomcat OK deployment complete.

Let idea help you, God .

Idea has super many shortcut keys can be convenient for us to use, this is a list of shortcut keys are interested to print out, more try to use the shortcut key operation.

Idea shortcut keys
shortcut Keys Description
Ctrl+shift + Enter Statement completion
“! ” Negation is complete, press "!" when you enter an expression. "Key
Ctrl+e Recent files
Ctrl+shift+e Recently changed files
Shift+click Can close files
Ctrl+[or] Can run to the beginning and end of curly braces
Ctrl+f12 The structure of the current file can be displayed
Ctrl+f7 You can query the current element's reference in the current file, and then press F3 to select
CTRL + N You can quickly open classes
Ctrl+shift+n can open files quickly
Alt+q You can see the declaration of the current method
Ctrl+p can display parameter information
Ctrl+shift+insert You can select the contents of the Clipboard and insert
Alt+insert Constructor/getter/setter can be generated, etc.
Ctrl+alt+v Variables can be introduced. Example: NewString (); Auto import variable definition
Ctrl+alt+t The code can be wrapped within a block, for example: Try/catch
Ctrl+enter Import package, auto fix
Ctrl+alt+l Formatting code
Ctrl+alt+i Automatically indent the selected code, which can also work when editing a JSP file
Ctrl+alt+o Optimizing imported classes and Packages
Ctrl+r Replace text
Ctrl+f Find text
Ctrl+shift+space Auto-Complete code
CTRL + Spaces Code hints (conflicts with system input accelerator keys)
Ctrl+shift+alt+n Find a method or variable in a class
Alt+shift+c Recent Changes
Alt+shift+up/down Move up/down one line
Shift+f6 Refactoring – Renaming
Ctrl+x Delete Row
Ctrl+d Copy rows
ctrl+/or ctrl+shift+/ Comments (//or/**/)
Ctrl+j Automatic code (ex: SERR)
Ctrl+alt+j Surround with dynamic templates
Ctrl+h Show class structure diagram (inheritance hierarchy of classes)
Ctrl+q Show Comment Document
Alt+f1 Find the location of your code
Alt+1 Quickly open or hide the project panel
Ctrl+alt+left/right Go back to the last browse location
Alt+left/right Toggle Code View
Alt+up/down Quickly move the positioning between methods
Ctrl+shift+up/down Move statement up/down
F2 or Shift+f2 Highlight error or warning quick location
Tab After the code tag is entered, press TAB to generate the code
Ctrl+shift+f7 Highlight all the text and press ESC to highlight the disappear
Alt+f3 Find the same text down one by one and highlight
Ctrl+up/down Cursor to the first or last line
Ctrl+b/ctrl+click Quickly open the class or method at the cursor (jump to definition)
Ctrl+alt+b Jump to method implementation
Ctrl+shift+backspace Jump to the last edited place
Ctrl+o overriding method
Ctrl+alt+space Class name Auto-complete
Ctrl+alt+up/down Quick Jump Search Results
Ctrl+shift+j Consolidate two lines
Alt+f8 Calculate variable values
Ctrl+shift+v You can insert the most recently used Clipboard Content selection into the text
Ctrl+alt+shift+v Simple paste
Shift+esc You can not only move the focus to the editor, but also hide the current (or last active) tool window
F12 Move the focus from the editor to the most Recently used tool window
Shift+f1 To open the editor cursor character at the same class or method as the browser of the Java document
Ctrl+w You can select the word and then the statement and then the function.
Ctrl+shift+w Deselect the word cursor
Alt+f7 Find the location of a class, method, or variable used in the entire project
Ctrl+i Implementation method
Ctrl+shift+u Uppercase and lowercase conversions
Ctrl+y Delete When moving forward
Shift+enter Insert new Row down
Psvm/sout Main/system.out.println ();
Ctrl+j See more
Ctrl+shift+f Global Lookup
Ctrl+f Find
Shift+f3 Look up/f3 look down
Ctrl+shift+s Advanced Search
Ctrl+u Go to Parent class
Ctrl+alt+s Open the Settings dialog box
Alt+shift+inert Toggle Column Selection mode on/off
Ctrl+alt+shift+s Open current project/module properties
Ctrl+g Anchor Row
Alt+home Jump to navigation bar
Ctrl+enter Plug in a row
Ctrl+backspace Delete by word
CTRL + "+ +" Current method Expand, collapse
ctrl+shift+ "+/-" Expand All, collapse
"Debug section, compile"
Ctrl+f2 Stop it
Alt+shift+f9 Select Debug
Alt+shift+f10 Select Run
Ctrl+shift+f9 Compile
Ctrl+shift+f10 Run
Ctrl+shift+f8 viewing breakpoints
F8 Step Over
F7 Entered
Shift+f7 Smart Step Into
Shift+f8 Step out
Alt+shift+f8 Force Step Over
Alt+shift+f7 Force Step Into
Alt+f9 Run to Cursor
Ctrl+alt+f9 Force run to Cursor
F9 Recovery program
Alt+f10 Navigate to Breakpoint
Ctrl+f8 Toggle Line Breakpoint
Ctrl+f9 Build Project
Alt+1 Project
Alt+2 Collection
Alt+6 Todo
Alt+7 Structure
Ctrl+shift+c Copy path
Ctrl+alt+shift+c To copy a reference, you must select the class name
Ctrl+alt+y Synchronous
ctrl+~ Quick switching Scheme (interface appearance, code style, shortcut key mapping menu)
Shift+f12 Restore the default layout
Ctrl+shift+f12 Hide/Restore All windows
Ctrl+f4 Shut down
Ctrl+shift+f4 Close the Events tab
Ctrl+tab Go to the next splitter
Ctrl+shift+tab Go to previous splitter
"Refactoring"
Ctrl+alt+shift+t Pop-up refactoring menu
Shift+f6 Renaming
F6 Move
F5 Copy
Alt+delete Safe removal
Ctrl+alt+n Inline
Find
Ctrl+f Find
Ctrl+r Replace
F3 Find the next
Shift+f3 Find Previous
Ctrl+shift+f Find in Path
Ctrl+shift+r Replace in Path
Ctrl+shift+s Search structure
Ctrl+shift+m Replace structure
Alt+f7 Find usage
Ctrl+alt+f7 Display usage
Ctrl+f7 Find usages in Files
Ctrl+shift+f7 Highlighting usage in a file

The ape wants to be good, and he will Ide-intellij idea.

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.