IntelliJ IDEA2016.2 Eclipse(mac os x)常用推荐捷键手册

Stella981
• 阅读 559

Search

Function

Shortcut

Use this shortcut to...

Find

⌘F

Initiate text search.

Replace

⌘R

Initiate text search and replace.

Search for next/
previous occurrence

⌘K/⇧⌘K

Navigate to the next/previous occurrence of a selected word in the editor.

Incremental Search

⌘J

Initiate text search.

Find in Path

 

Initiate search for a text string in the specified scope.

Replace in Path

 

Initiate search and replace in the specified scope.

Find Usages

⌘F7

Initiate search for usages of the selected symbol in the specified scope.

Find Usages in File

⌃⌘F7

Initiate search for usages of the selected symbol in the current file.

Highlight Usages in File

⇧⌘F7

Highlight usages of a symbol at caret.

Show Usages

⌥⌘F7

Show usages of a symbol at caret in a pop-up window. Use list of found usages to jump to the desired location.

Find Action

⌘F12

Find an action, bypassing menus. See Finding Actions.

Refactoring

Function

Shortcut

Use this shortcut to...

Rename

⌥⌘R

Rename the selected file, class, field, method, etc. and change all references to it accordingly.

Change Method Signature

⌥⌘C

Change the signature of the selected method and update all the corresponding method calls.

Move

⌥⌘V

Move the selected class, package or static member to another package or class and update all the corresponding references.

Extract Method

⌥⌘M

Turn the selected code fragment into a method.

Extract Variable

⌥⌘L

Create a new variable and use the selected expression as its value.

Extract Field

⌥⌘F

Create a new field and use the selected expression as its value.

Inline

⌥⌘I

Inline the selected method or variable.

Navigation In Source Code

Function

Shortcut

Use this shortcut to...

File Structure Pop-up

⌘O

Display the Structure pop-up window for quick navigation through the current file.

Recent Files

⌘E

Show the list of recently opened files.

Recently Changed Files

⇧⌘E

Show the list of recently updated files.

Type Hierarchy

⌃H

Browse hierarchy for the selected class .

Method Hierarchy

⇧⌘H

Browse hierarchy for the selected method .

Call Hierarchy

⌃⌥H

Browse call hierarchy for the selected method.

Navigate to Class

⇧⌘T

Navigate directly to a class in project by specifying its name in a pop-up dialog box.

Navigate to File

⇧⌘O

Navigate directly to a file in project by specifying its name in a pop-up dialog box.

Navigate to Line

⌘L

Navigate to any line in the current file by specifying its number.

Navigate to Declaration

⌘Button1 click

Navigate to declaration of a symbol at caret.

Navigate to Super Method

⌘U

Navigate to a super method declaration of a method under the caret.

 

 

 

Navigate to Test/Test Subject

⇧⌘T

Navigate to a test for the class at caret, if any, or navigate from a test to a test subject.

Navigate to Related Symbol

⌃⌘↑

Navigate between files with complicated relationships between them.

For example, use this shortcut to navigate between the various web entities.

Navigate to Next Method

⌃↓

Navigate to the next method declaration in the active editor tab.

Navigate to Previous Method

⌃↑

Navigate to the previous method declaration in the active editor tab.

Navigate to Opening Brace

⌥⌘[

Navigate to the start of the current code block.

Navigate to Closing Brace

⌥⌘]

Navigate to the end of the current code block.

Back

⌘[

Undo last navigation operation.Note

On an OS X computer, you can also use the three-finger right-to-left swipe gesture.

Forward

⌘]

Redo last undone navigation operation.Note

On an OS X computer, you can also use the three-finger left-to-right swipe gesture.

Navigate to Previous Occurrence

⌥⌘↑

Navigate to a previous found item.

Navigate to Next Occurrence

⌥⌘↓

Navigate to a next found item.

Last Edit Location

⇧⌘⌫

Move through the most recent change points.

Navigate to Next Highlighted Error

F2

Navigate to the next found error/warning.

Navigate to Previous Highlighted Error

⇧F2

Navigate to the previous found error/warning.

Navigation Between IDE Components

Function

Shortcut

Use this shortcut to...

Select Target

⌥F1

Move focus from the current file, class, method or reference to a data source, to a view suggested in the Select Target pop-up menu. Refer to Navigating Between IDE Components.

Collapse all

⌘-

Collapse all nodes in a tree view.

Expand all

⌘+

Expand all nodes in a tree view.

Switcher

⌃⇥

Navigate between files opened in the editor, and tool windows.

Open tool window

Alt+Number

Open a tool window with the specified number.

Hide Active Window

⇧⎋

Hide the currently active tool window.

Jump to Last Window

F12

Activate the last focused tool window.

Differences

Function

Shortcut

Use this shortcut to...

Move to Next Difference

F7

Navigate to the next difference in view.

Move to Previous Difference

⇧F7

Navigate to the previous difference in view.

Navigation Between Bookmarks

Function

Shortcut

Use this shortcut to...

Go to Bookmark

Ctrl+Number

Navigate to a numbered bookmark with the corresponding number.

Toggle Bookmark

F3

Turn anonymous bookmark on or off.

Toggle Bookmark with Mnemonic

⌥F3

Turn bookmark with mnemonic on or off.

Show Bookmarks

⌘F3

Open Bookmarks dialog to manage existing bookmarks and navigate between them.

GUI Designer Shortcuts

Function

Shortcut

Use this shortcut to...

Select next component

Arrow

Move selection to the adjacent component.

Add to selection

Shift+Arrow

Add adjacent component to the selection.

Extend selection

⌥↑
⌥↓

Select successively increasing sets of components from the current component to its container. Compare to selecting text in the editor.

Move component

Ctrl+Arrow

Move selected component to the adjacent valid container.

Expand component

Ctrl+Shift+Arrow

Expand component to the adjacent valid container.

General

Function

Shortcut

Use this shortcut to...

Close Active Tab

⌃⇧F4

Close an active tab in a tool window (for example, Find tool window).

Close Editor

⌘W

Close an active editor.

Edit Source

⌘↓

Open an editor for the selected item or items and give focus to the last opened file.

Escape

Depending on the context:

  • – In the editor: close pop-up windows, terminate search, or remove highlighting.
  • – In a tool window: return focus to the editor.

Export to Text File

⌃O

Export contents of a tool window to a text file. This feature applies to the Version Control Tool Window, Messages Tool Window, and other tool windows that provide the export button on the window toolbar.

New...

⌘N

Create a new class, interface, file or directory. See Populating Modules.

Save All

⌘S

Save all files and settings.

Select Next Tab

⇧⌘]

When several tabs are open in the editor or a view, open the next tab to the right (or first tab if the current one is the last).

Select Previous Tab

⇧⌘[

When several tabs are open in the editor or a view, open the next tab to the left (or last tab if the current one is the first).

Show Intention Action

⌥⏎

Display intention actions (if any) for the code where the caret is currently located, or the selected GUI component in a form.

Synchronize

⌥⌘Y

Detect all externally changed files and reload them from disk.

View Source

⌘⏎

Depending on the context:

Running and Debugging

Function

Shortcut

Use this shortcut to...

Make Project

⌘F9

Compile all modified and dependent files in a project.

Compile

⇧⌘F9

Compile selected file/package.

Run

⌃R

Run a program.

Choose configuration and run

⌃⌥R

Quickly select run/debug configuration and run or edit it.

Rerun

⌘R

Repeat execution with the same settings, with the same tab of the Run tool window having the focus.

Rerun without loosing the focus in the editor

⌃R

Repeat execution with the same settings, with the same tab of the editor having the focus.

Debug

⌃D

Debug a program.

Choose configuration and debug

⌃⌥D

Quickly select run/debug configuration and debug or edit it.

Update running application

⌘F10

Reload updated resources and recompiled classes of the currently running application.

Step Over

F8

Step to the next line in the current file. See Stepping Through the Program.

Step Into

F7

Step to the next executed line. See Stepping Through the Program.

Smart Step Into

⇧F7

Select the method to step in, if the current line contains multiple method call expressions. See Choosing a Method to Step Into.

Step Out

⇧F8

Step to a first executed line after returning from the current method. See Stepping Through the Program.

Force Step Over

⌥⇧F8

Run until the next line in this method or file, skipping the methods referenced at the current execution point and ignoring breakpoints. See Stepping Through the Program.

Force Step Into

⌥⇧F7

Steps into the method called in the current execution point even if this method is to be skipped. See Stepping Through the Program.

Run to Cursor

⌥F9

Run to the line where the caret is located. See Stepping Through the Program.

Force Run To Cursor

⌥⌘F9

Run to the line where the caret is located, ignoring breakpoints. See Stepping Through the Program.

Resume Program

⌥⌘R

Resume program execution.

Stop Program

⇧F2

Terminate a debugging session.

Evaluate Expression

⌥F8

Evaluate an arbitrary expression.

Quick Evaluate Expression

⌥⌘F8

Evaluate an arbitrary expression without calling Evaluate Expression dialog.

Toggle Breakpoint

⌘F8

Toggle breakpoint at the current line.

View Breakpoints

⇧⌘F8

View/manage all breakpoints.

Switch to another coverage suite.

⌥⌘F6

Open the Coverage Suites pop-up window and select the desired suite to run.

Code Folding

Command

Shortcut

Description

Expand

⌘+

Expand the current collapsed fragment

Collapse

⌘-

Collapse the current folding region

Expand Recursively

⌥⌘+

Expand the current folded fragment and all the subordinate collapsed folding regions within that fragment

Collapse Recursively

⌥⌘-

Collapse the current folding region and all the subordinate folding regions within it

Expand All

⇧⌘+

Expand all collapsed fragments within the selection, or, if nothing is selected, expand all the collapsed fragments in the current file

Collapse All

⇧⌘-

Collapse all folding regions within the selection, or, if nothing is selected, collapse all the folding regions in the current file

Expand to level | 1, 2, 3, 4 or 5

⌘⌨ *, 1
⌘⌨ *, 2
⌘⌨ *, 3
⌘⌨ *, 4
⌘⌨ *, 5

Expand the current fragment and all the nested fragments up to the specified level

Expand all to level | 1, 2, 3, 4 or 5

⌥⌘⌨ *, 1
⌥⌘⌨ *, 2
⌥⌘⌨ *, 3
⌥⌘⌨ *, 4
⌥⌘⌨ *, 5

Expand all the collapsed fragments in the file up to the specified nesting level

Fold Selection / Remove region

⌘.

Collapse the selected fragment and create a custom folding region for it to make it "foldable" / Expand the current fragment and remove the corresponding custom folding region to make the fragment "unfoldable"

Fold Code Block

⇧⌘.

Collapse the code fragment between the matched pair of curly braces {} and create a custom folding region for that fragment to make it "foldable"

Advanced Editing

Function

Shortcut

Use this shortcut to...

Comment with Line Comment

⌘/

Comment/uncomment current line or selected block with line comments.

Comment with Block Comment

⌥⌘/

Comment/uncomment code with block comments.

Quick Documentation

F1/Alt+Button2 Click

Show a pop-up window with the documentation for the symbol at the caret.

Show Table Data

F1

Show a pop-up window that displays the create table query for the database table at the caret and the first 10 rows of the table.

Pop-up Hector

⌥⇧⌘H

Show the Highlighting level pop-up window to configure highlighting in the current file.

Parameter Info

⌘P

Show parameters of the method call at the caret.

Context Info

⌃⇧Q

Show the current method or class declaration when it is not visible.

Error Description

⌘F1

Show an error or warning description at the caret.

External Documentation

⇧F1

Open browser with the documentation for the selected item.

Override Methods...

⌃O

Override base class methods in the current class.

Implement Methods...

⌃I

Override base interface/class methods in the current class.

Surround with...

⌥⌘T

Surround selected code fragment with if, do, tags or other constructs.

In the GUI Designer, use this shortcut to wrap selected components into a container.

Generate

⌘N

Generate constructors, accessor methods, EJB components, Maven dependencies in the pom.xml files, using the Generate pop-up menu.

Basic Code Completion

⌃Space
⌥/

Code completion for any class, method or variable.

SmartType Code Completion

⌃⇧Space

Code Completion filtering the lookup list basing on expected type.

Expand Word

⌥/

Goes through the names of classes, methods, keywords and variables in the current visibility scope.

Insert Live Template...

⌘J

Show a pop-up list of starting with a specified prefix.

Surround with Live Template...

⌥⌘J

Surround the selection with one of the templates.

Next Template Variable

In templates: move the caret to the next template variable.

Previous Template Variable

⇧⇥

In templates: move the caret to the previous template variable.

Basic Editing

Function

Shortcut

Use this shortcut to...

Enter

Depending on the context:

  • – In a lookup list: select an item.
  • – In the editor: enter a new line and set the caret at its beginning.

Tab

In the editor:

  • –With selection: indent selected lines.
  • –Without selection: insert a tab symbol (or corresponding number of space characters).

In a lookup list:

  • –No code after the caret: select an item.
  • –Some code after the caret: select an item and substitute the code after the caret with it.

Delete

Depending on the context:

  • –In the editor: delete selected symbol/block.
  • –In a usage view: exclude a selected item.
  • –In other views: remove selected items.

Backspace

Delete a character to the left of the caret.

Undo

⌘Z

Undo last operation.

Redo

⇧⌘Z

Redo last undone operation.

Cut

⌘X

Cut a current line or a selected code block to the Clipboard.

Copy

⌘C

Copy a current line or a selected code block to the Clipboard.

Paste

⌘V

Paste from the Clipboard to the caret location.

Paste from History

⇧⌘V

Paste selected entry from the Clipboard to the caret location.

Up

Move the caret one line up.

Up with Selection

⇧↑

Move the caret one line up selecting the text.

Down

Move the caret one line down.

Down with Selection

⇧↓

Move the caret one line down selecting the text.

Left

Move the caret one character to the left.

Left with Selection

⇧←

Move the caret one character to the left selecting the text.

Right

Move the caret one character to the right.

Right with Selection

⇧→

Move the caret one character to the right selecting the text.

Go to Page Bottom

⌘⇟

Move the caret down to the page bottom.

Go to Page Bottom with Selection

⇧⌘⇟

Move the caret down to the page bottom, selecting the text.

Go to Page Top

⌘⇞

Move the caret up to the page top.

Go to Page Top with Selection

⇧⌘⇞

Move the caret up to the page bottom, selecting the text.

Page Down

Move the caret one page down.

Page Down with Selection

⇧⇟

Move the caret one page down, selecting the text.

Page Up

Move the caret one page up.

Page Up with Selection

⇧⇞

Move the caret one page up, selecting the text.

Scroll Down

N/A

Scroll the text one line down.

Scroll to Center

N/A

Scroll a line at caret to the center of the screen.

Scroll Up

N/A

Scroll the text one line up.

Move to Line End

Move the caret to the end of line.

Move to Line End with Selection

⇧↘

Move the caret to the end of line, selecting the text.

Move to Line Start

Move the caret to the beginning of line.

Move to Line Start with Selection

⇧↖

Move the caret to the beginning of line, selecting the text.

Move to Next Word

⌥→

Move the caret to the next word.

Move to Next Word with Selection

⌥⇧→

Move the caret to the next word, selecting it.

Move to Previous Word

⌥←

Move the caret to the previous word.

Move to Previous Word with Selection

⌥⇧←

Move the caret to the previous word, selecting it.

Move to Text End

⌘↘

Move the caret to the end of text.

Move to Text End with Selection

⇧⌘↘

Move the caret to the end of text, selecting it.

Move to Text Start

⌘↖

Move the caret to the beginning of text.

Move to Text Start with Selection.

⇧⌘↖

Move the caret to the beginning of text, selecting it.

Select All

⌘A

Select the entire text opened in the editor.

Delete Line at Caret

⌘⌫

Delete the line where the caret is currently located.

Delete to Word End

⌥⌦

Delete the word starting from the current caret location up to the word end.

Delete to Word Start

⌥⌫

Delete the word starting from the current caret location up to the word start.

Toggle Insert/Overwrite

⇧⌫

Toggle insert/overwrite modes.

Duplicate Line or Block

⌘D

Duplicate selected block or the line at the caret.

Toggle Case

⇧⌘U

Toggle case of the selected text block.

Move to Code Block End

⌥⌘]

Move the caret to the current code block end, highlighting the block limits.

Move to Code Block End with Selection

⌥⇧⌘]

Move the caret to the current code block end, selecting the code beginning from the initial caret location.

Move to Code Block Start

⌥⌘[

Move the caret to the current code block start, highlighting the block limits.

Move to Code Block Start with Selection

⌥⇧⌘[

Move the caret to the current code block start, selecting the code beginning from the initial caret location.

Start New Line

⇧⏎

Start a new line after the current one positioning the caret in accordance with the current indentation level.

Start New Line Before Current One

⌥⌘⏎

Start a new line before the current one.

Join Lines

⌃⇧J

Concatenate the selected lines into one or concatenate the line where the caret is currently located with the next line.

Split Line

⌘⏎

Split the selected line at the point where the caret is located, leaving the caret at the end of the first line.

Select Word at Caret

⌥↑

Select successively increasing code blocks starting from the current caret location.

Unselect Word at Caret

⌥↓

Remove sequentially the selection made by the action.

Indent Selection

Move the selected block to the next indentation level.

Unindent Selection

⇧⇥

Move the selected block to the previous indentation level.

Auto-Indent Lines

⌃⌥I

Indent the current line or selected block according to the Code Style settings.

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
Java日期时间API系列36
  十二时辰,古代劳动人民把一昼夜划分成十二个时段,每一个时段叫一个时辰。二十四小时和十二时辰对照表:时辰时间24时制子时深夜11:00凌晨01:0023:0001:00丑时上午01:00上午03:0001:0003:00寅时上午03:00上午0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
为什么mysql不推荐使用雪花ID作为主键
作者:毛辰飞背景在mysql中设计表的时候,mysql官方推荐不要使用uuid或者不连续不重复的雪花id(long形且唯一),而是推荐连续自增的主键id,官方的推荐是auto_increment,那么为什么不建议采用uuid,使用uuid究
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这