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

Search

FunctionShortcutUse this shortcut to...
Find⌘FInitiate text search.
Replace⌘RInitiate text search and replace.
Search for next/
previous occurrence
⌘K/⇧⌘KNavigate to the next/previous occurrence of a selected word in the editor.
Incremental Search⌘JInitiate 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⌘F7Initiate search for usages of the selected symbol in the specified scope.
Find Usages in File⌃⌘F7Initiate search for usages of the selected symbol in the current file.
Highlight Usages in File⇧⌘F7Highlight usages of a symbol at caret.
Show Usages⌥⌘F7Show usages of a symbol at caret in a pop-up window. Use list of found usages to jump to the desired location.
Find Action⌘F12Find an action, bypassing menus. See Finding Actions.

Refactoring

FunctionShortcutUse this shortcut to...
Rename⌥⌘RRename the selected file, class, field, method, etc. and change all references to it accordingly.
Change Method Signature⌥⌘CChange the signature of the selected method and update all the corresponding method calls.
Move⌥⌘VMove the selected class, package or static member to another package or class and update all the corresponding references.
Extract Method⌥⌘MTurn the selected code fragment into a method.
Extract Variable⌥⌘LCreate a new variable and use the selected expression as its value.
Extract Field⌥⌘FCreate a new field and use the selected expression as its value.
Inline⌥⌘IInline the selected method or variable.

 

Navigation In Source Code

FunctionShortcutUse this shortcut to...
File Structure Pop-up⌘ODisplay the Structure pop-up window for quick navigation through the current file.
Recent Files⌘EShow the list of recently opened files.
Recently Changed Files⇧⌘EShow the list of recently updated files.
Type Hierarchy⌃HBrowse hierarchy for the selected class .
Method Hierarchy⇧⌘HBrowse hierarchy for the selected method .
Call Hierarchy⌃⌥HBrowse call hierarchy for the selected method.
Navigate to Class⇧⌘TNavigate directly to a class in project by specifying its name in a pop-up dialog box.
Navigate to File⇧⌘ONavigate directly to a file in project by specifying its name in a pop-up dialog box.
Navigate to Line⌘LNavigate to any line in the current file by specifying its number.
Navigate to Declaration⌘Button1 clickNavigate to declaration of a symbol at caret.
Navigate to Super Method⌘UNavigate to a super method declaration of a method under the caret.
   
Navigate to Test/Test Subject⇧⌘TNavigate 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 ErrorF2Navigate to the next found error/warning.
Navigate to Previous Highlighted Error⇧F2Navigate to the previous found error/warning.

 

Navigation Between IDE Components

FunctionShortcutUse this shortcut to...
Select Target⌥F1Move 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 windowAlt+NumberOpen a tool window with the specified number.
Hide Active Window⇧⎋Hide the currently active tool window.
Jump to Last WindowF12Activate the last focused tool window.

 

Differences

FunctionShortcutUse this shortcut to...
Move to Next DifferenceF7Navigate to the next difference in view.
Move to Previous Difference⇧F7Navigate to the previous difference in view.

 

Navigation Between Bookmarks

FunctionShortcutUse this shortcut to...
Go to Bookmark <number>Ctrl+NumberNavigate to a numbered bookmark with the corresponding number.
Toggle BookmarkF3Turn anonymous bookmark on or off.
Toggle Bookmark with Mnemonic⌥F3Turn bookmark with mnemonic on or off.
Show Bookmarks⌘F3Open Bookmarks dialog to manage existing bookmarks and navigate between them.


GUI Designer Shortcuts

FunctionShortcutUse this shortcut to...
Select next componentArrowMove selection to the adjacent component.
Add to selectionShift+ArrowAdd 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 componentCtrl+ArrowMove selected component to the adjacent valid container.
Expand componentCtrl+Shift+ArrowExpand component to the adjacent valid container.

 

General

FunctionShortcutUse this shortcut to...
Close Active Tab⌃⇧F4Close an active tab in a tool window (for example, Find tool window).
Close Editor⌘WClose an active editor.
Edit Source⌘↓Open an editor for the selected item or items and give focus to the last opened file.
EscapeDepending 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⌃OExport 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...⌘NCreate a new class, interface, file or directory. See Populating Modules.
Save All⌘SSave 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⌥⌘YDetect all externally changed files and reload them from disk.
View Source⌘⏎Depending on the context:

 

Running and Debugging

 

FunctionShortcutUse this shortcut to...
Make Project⌘F9Compile all modified and dependent files in a project.
Compile⇧⌘F9Compile selected file/package.
Run⌃RRun a program.
Choose configuration and run⌃⌥RQuickly select run/debug configuration and run or edit it.
Rerun⌘RRepeat 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⌃RRepeat execution with the same settings, with the same tab of the editor having the focus.
Debug⌃DDebug a program.
Choose configuration and debug⌃⌥DQuickly select run/debug configuration and debug or edit it.
Update running application⌘F10Reload updated resources and recompiled classes of the currently running application.
Step OverF8Step to the next line in the current file. See Stepping Through the Program.
Step IntoF7Step to the next executed line. See Stepping Through the Program.
Smart Step Into⇧F7Select the method to step in, if the current line contains multiple method call expressions. See Choosing a Method to Step Into.
Step Out⇧F8Step to a first executed line after returning from the current method. See Stepping Through the Program.
Force Step Over⌥⇧F8Run 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⌥⇧F7Steps 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⌥F9Run to the line where the caret is located. See Stepping Through the Program.
Force Run To Cursor⌥⌘F9Run to the line where the caret is located, ignoring breakpoints. See Stepping Through the Program.
Resume Program⌥⌘RResume program execution.
Stop Program⇧F2Terminate a debugging session.
Evaluate Expression⌥F8Evaluate an arbitrary expression.
Quick Evaluate Expression⌥⌘F8Evaluate an arbitrary expression without calling Evaluate Expression dialog.
Toggle Breakpoint⌘F8Toggle breakpoint at the current line.
View Breakpoints⇧⌘F8View/manage all breakpoints.
Switch to another coverage suite.⌥⌘F6Open the Coverage Suites pop-up window and select the desired suite to run.

 

Code Folding

CommandShortcutDescription
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

FunctionShortcutUse 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 DocumentationF1/Alt+Button2 ClickShow a pop-up window with the documentation for the symbol at the caret.
Show Table DataF1Show 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⌥⇧⌘HShow the Highlighting level pop-up window to configure highlighting in the current file.
Parameter Info⌘PShow parameters of the method call at the caret.
Context Info⌃⇧QShow the current method or class declaration when it is not visible.
Error Description⌘F1Show an error or warning description at the caret.
External Documentation⇧F1Open browser with the documentation for the selected item.
Override Methods...⌃OOverride base class methods in the current class.
Implement Methods...⌃IOverride base interface/class methods in the current class.
Surround with...⌥⌘TSurround 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⌘NGenerate 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⌃⇧SpaceCode 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...⌘JShow a pop-up list of starting with a specified prefix.
Surround with Live Template...⌥⌘JSurround the selection with one of the templates.
Next Template VariableIn templates: move the caret to the next template variable.
Previous Template Variable⇧⇥In templates: move the caret to the previous template variable.

 

Basic Editing

FunctionShortcutUse this shortcut to...
EnterDepending on the context:
  • – In a lookup list: select an item.
  • – In the editor: enter a new line and set the caret at its beginning.
TabIn 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.
DeleteDepending on the context:
  • –In the editor: delete selected symbol/block.
  • –In a usage view: exclude a selected item.
  • –In other views: remove selected items.
BackspaceDelete a character to the left of the caret.
Undo⌘ZUndo last operation.
Redo⇧⌘ZRedo last undone operation.
Cut⌘XCut a current line or a selected code block to the Clipboard.
Copy⌘CCopy a current line or a selected code block to the Clipboard.
Paste⌘VPaste from the Clipboard to the caret location.
Paste from History⇧⌘VPaste selected entry from the Clipboard to the caret location.
UpMove the caret one line up.
Up with Selection⇧↑Move the caret one line up selecting the text.
DownMove the caret one line down.
Down with Selection⇧↓Move the caret one line down selecting the text.
LeftMove the caret one character to the left.
Left with Selection⇧←Move the caret one character to the left selecting the text.
RightMove 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 DownMove the caret one page down.
Page Down with Selection⇧⇟Move the caret one page down, selecting the text.
Page UpMove the caret one page up.
Page Up with Selection⇧⇞Move the caret one page up, selecting the text.
Scroll DownN/AScroll the text one line down.
Scroll to CenterN/AScroll a line at caret to the center of the screen.
Scroll UpN/AScroll the text one line up.
Move to Line EndMove 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 StartMove 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⌘ASelect 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⌘DDuplicate selected block or the line at the caret.
Toggle Case⇧⌘UToggle 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⌃⇧JConcatenate 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 SelectionMove the selected block to the next indentation level.
Unindent Selection⇧⇥Move the selected block to the previous indentation level.
Auto-Indent Lines⌃⌥IIndent the current line or selected block according to the Code Style settings.

转载于:https://my.oschina.net/cuckoocs/blog/750457

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值