Idea
shortcut keys
Ctrl W
expand扩大 the code selection
Ctrl Shift W
shrink收缩 the code selection
Ctrl /
comment注释 lines
Ctrl Shift /
comment blocks code
Ctrl D
duplicate复制 lines
Ctrl Y
delete lines
Alt Shift down
move the current line down
Alt Shift up
move the current line up
Ctrl Shift down
move the whole method down
Ctrl Shift up
move the whole method up
Ctrl -
collapse折叠 a code fragment片段
Ctrl =
expand展开 a code region
Ctrl Shift -
collapse all regions in the file
Ctrl Shift =
expand all available regions
Ctrl Alt T
surround包围 the selected code fragment片段 with some template code
Ctrl Shift Delete
unwrap打开。。。包装
Alt J
select the symbol符号 at the caret脱字号;补注号
Alt Shift J
to deselect the last occurrence出现
Ctrl Alt Shift J
select all occurrence出现 in the file
Find Ctrl F
and replace Ctrl R
- Press
Ctrl F
to display the search bar. In the Find in Files dialog, you can switch to replace by pressingCtrl Shift R
. - Press
Ctrl R
to add another field where you can type the replace string. PressCtrl Shift F
to hide the Replace with field and switch to regular search.
Show usages Ctrl Alt F7
(Edit | Find Usages | Show Usages) . To jump to a usage, select it from the list and press Enter
.
Show file structure Ctrl F12
- You can quickly navigate导航 within the current file with
Ctrl F12
(Navigate | File Structure). - File structure shows the list of members of the current class. To navigate to an element, select it and press
Enter
orF4
. - To easily locate定位 an item in the list, start typing its name