从eclipse 到IDEA 极简入门

作为一个java开发工作者,工欲善其事必先利其器。我们经常用的就是eclipse 和 IEDA这两个主流的开发工具。使用的一段时间,作为一个使用习惯eclipse转化到IDEA需要知道什么?

1,了解IDEA与eclipse之间概念区别

以是官方文档给出的区别,这样就避免了我们在使用过程出现问题;

2,我们在写代码经常会用到一些文本编辑的快捷,IEDA原生不做任何修改有如下的快捷键:

 

Eclipse

IntelliJ IDEA

Action

Shortcut

Action

Shortcut

Code completion

Ctrl+Space

Basic completion

Ctrl+Space

-

-

Smart completion

Ctrl+Shift+Space

-

-

Statement completion

Ctrl+Shift+Enter

Quick access

Ctrl+3

Search everywhere

Shift x 2

Maximize active view or editor

Ctrl+M

Hide all tool windows

Ctrl+Shift+F12

Open type

Ctrl+Shift+T

Navigate to class

Ctrl+N

Open resource

Ctrl+Shift+R

Navigate to file

Ctrl+Shift+N

-

-

Navigate to symbol

Ctrl+Shift+Alt+N

Next view

Ctrl+F7

-

-

-

-

Recent files

Ctrl+E

-

-

Switcher

Ctrl+Tab

Quick outline

Ctrl+O

File structure

Ctrl+F12

Move lines

Alt+Up/Down

Move lines

Shift+Alt+Up/Shift+Alt+Down

Delete lines

Ctrl+D

Delete lines

Ctrl+Y

Quick fix

Ctrl+1

Show intention action

Alt+Enter

Quick switch editor

Ctrl+E

Switcher

Ctrl+Tab

-

-

Recent files

Ctrl+E

Quick hierarchy

Ctrl+T

Navigate to type hierarchy

Ctrl+H

-

-

Navigate to method hierarchy

Ctrl+Shift+H

-

-

Show UML popup

Ctrl+Alt+U

Last edit location

Ctrl+Q

Last edit location

Ctrl+Shift+Backspace

Next editor

Ctrl+F6

Select next tab

Alt+Right

Run

Ctrl+Shift+F11

Run

Shift+F10

Debug

Ctrl+F11

Debug

Shift+F9

Correct indentation

Ctrl+I

Auto-indent lines

Ctrl+Alt+I

Format

Ctrl+Shift+F

Reformat code

Ctrl+Alt+L

Surround with

Ctrl+Alt+Z

Surround with

Ctrl+Alt+T

-

-

Surround with live template

Ctrl+Alt+J

Open declaration

F3

Navigate to declaration

Ctrl+B

-

-

Quick definition

Ctrl+Shift+I

Open type hierarchy

F4

Navigate to type hierarchy

Ctrl+H

-

-

Show UML popup

Ctrl+Alt+U

References in workspace

Ctrl+Shift+G

Find usages

Alt+F7

-

-

Show usages

Ctrl+Alt+F7

-

-

Find usages settings

Ctrl+Shift+Alt+F7

Open search dialog

Ctrl+H

Find in path

Ctrl+Shift+F

Occurrences in file

Ctrl+Alt+U

Highlight usages in file

Ctrl+Shift+F7

Copy lines

Ctrl+Alt+Down

Duplicate lines

Ctrl+D

Extract local variable

Ctrl+Alt+L

Extract variable

Ctrl+Alt+V

Assign to field

Ctrl+2/Ctrl+F

Extract field

Ctrl+Alt+F

Show refactor quick menu

Ctrl+Alt+T

Refactor this

Ctrl+Shift+Alt+T

Rename

Ctrl+Alt+R

Rename

Shift+F6

Go to line

Ctrl+L

Navigate to line

Ctrl+G

Structured selection

Shift+Alt+Up/Shift+Alt+Down

Select word at caret

Ctrl+W/Ctrl+Shift+W

Find next

Ctrl+J

Find next

F3

Show in

Ctrl+Alt+W

Select in

Alt+F1

Back

Ctrl+[

Back

Ctrl+Alt+Left

Forward

Ctrl+]

Forward

Ctrl+Alt+Right

3,写代码我们经常会忘记后面的这里我们需要提示我们就可以使用下面的快捷键

 

Eclipse

IntelliJ IDEA

Action

Shortcut

Action

Shortcut

Code completion

Ctrl+Space

Basic completion

Ctrl+Space

-

-

Smart completion

Ctrl+Shift+Space

-

-

Statement completion

Ctrl+Shift+Enter

4,写代码还会经常遇到是我们要快速的打印出内容或者写一个for循环IDEA有如下的快捷键

Template

Eclipse

IntelliJ IDEA

Define a main method

main

psvm

Iterate over an array

for

itar

Iterate over a collection

for

itco

Iterate over a list

for

itli

Iterate over an iterable using foreach syntax

foreach

iter

Print to System.out

sysout

sout

Print to System.err

syserr

serr

Define a static field

static_final

psf

5,说完写代码,现在我们要怎么样快速找到一个代码,或者其引用可以用

Eclipse

IntelliJ IDEA

Action

Shortcut

Action

Shortcut

Open search dialog

Ctrl+H

Find in path

Ctrl+Shift+F

References in workspace

Ctrl+Shift+G

Find usages

Alt+F7

-

-

Show usages

Ctrl+Alt+F7

-

-

Find usages settings

Ctrl+Shift+Alt+F7

Occurrences in file

Ctrl+Alt+U

Highlight usages in file

Ctrl+F7

6,格式化代码

Eclipse

IntelliJ IDEA

Action

Shortcut

Action

Shortcut

Format

Ctrl+Shift+F

Reformat code

Ctrl+Alt+L

7,Debugging 调试代码需要使用到的快捷键

Eclipse

IntelliJ IDEA

Action

Shortcut

Action

Shortcut

Step into

F5

Step into

F7

-

-

Smart step into

Shift+F7

Step over

F6

Step over

F8

Step out

F7

Step out

Shift+F8

Resume

F8

Resume

F9

Toggle breakpoint

Ctrl+Shift+B

Toggle breakpoint

Ctrl+F8

-

-

Evaluate expression

Alt+F8

8,从eclipse工程导入到IDEA

我们可以在打开的欢迎页面,点击 Import Project 导入, 或者选择 File | New | Project 导入已经存在的源码。

如下我们要导入的工程是maven工程或者是gradle工程可以如下图进行导入:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值