分享一个 IntelliJ IDEA 的实用学习插件。
plugins.jetbrains.com/plugin/8554…
实操教你用各种方便快捷的快捷键。
插件涉及的快捷键汇总
Editor Basics
- Actions
Ctrl+Shift+A - Comment Line
Ctrl+/ - Delete Line
Ctrl+Y - Duplicate
Ctrl+D - Move
Alt+Shift+↓/↑Ctrl+Shift+Up(The whole method)
- Collapse
Ctrl(+Shift) +-Ctrl(+Shift) ++
- Multiple Selections
Alt+JAlt+Shift+JCtrl+Alt+Shift+J
Code Completion
- Basic Completion
Ctrl+SpaceActive Basic CompletionCtrl+Shift+EnterComplete statementCtrl+Space(twice) Deeper level of code completion(for static constants or methods)
- Smart Type Completion
Ctrl+Shift+SpaceCtrl+Shift+Space(twice) for a return statement
- Postfix Completion
.+<reserved word>- e.g.
isOpen == true.if==>if (isOpen == true) { ... }
- e.g.
- Statement Completion
Ctrl+Shift+Enter - Completion with Tab
Ctrl+Space, and pressTab
Refactorings
- Rename
Shift+F6 - Extract Variable/Field
Ctrl+Alt+V - Extract Method
Ctrl+Alt+M - Refactoring Basics
Ctrl+Alt+Cto extract the selected expression into a constatnCtrl+Alt+Mto extract the selected code block into a methodCtrl+Alt+Pto extract the selected expression into a parameter
Code Assistance
- Code Formatting
Ctrl+Alt+L - Parameter Info
Ctrl+P - Quick Popups
Ctrl+QCtrl+Shift+Ito see definition of the symbol at the caret
- Editor Coding Assistance
F2to go to the next highlighted error in the fileCtrl+F1to see the error descriptionAlt+EnterCtrl+Alt+TSorround withCtrl+Shift+F7to highlight all usages of the symbol at the caret within the file
Navigation
- Jump to Source
F4 - Declaration
Ctrl+B - Implementation
Ctrl+Alt+B - File Structure
Ctrl+F12 - Next/Previous Occurrences
Ctrl+F==>Enterto find next,Shift+Enterfor previous occurrences- Close search panel by pressing
Escapeand try to find next occurrence withF3,Shift+F3in a back way