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. |
Initiate search for a text string in the specified scope. | ||
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 <number> | 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:
|
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:
|
Tab | ⇥ | In the editor:
|
Delete | ⌦ | Depending on the context:
|
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. |
来源:oschina
链接:https://my.oschina.net/u/2276819/blog/750457