安装插件:IntelliJ IDEA Keybindings
或者设置–>keymaps选择IntelliJ IDEA Keybindings
安装插件后的快捷键映射:
Linux, Windows | macOS | Feature | Supported |
---|---|---|---|
ctrl+space | ctrl+space | Basic code completion (the name of any class, method or variable) | ✅ |
ctrl+shift+space | ctrl+shift+space | Smart code completion (filters the list of methods and variables by expected type) | N/A |
ctrl+shift+enter | cmd+shift+enter | Complete statement | ✅ |
ctrl+p | cmd+p | Parameter info (within method call arguments) | ✅ |
ctrl+q | ctrl+j | Quick documentation lookup | ✅ |
ctrl+f1 | shift+f1 | External Doc | N/A |
ctrl+mouseover | cmd+mouseover | Brief Info | N/A |
ctrl+f1 | cmd+f1 | Show descriptions of error or warning at caret | ✅ |
alt+insert | cmd+n | Generate code… (Getters, Setters, Constructors, hashCode/equals, toString) | ✅ |
ctrl+o | ctrl+o | Override methods | N/A |
ctrl+i | ctrl+i | Implement methods | N/A |
ctrl+alt+t | cmd+alt+t | Surround with… (if…else, try…catch, for, synchronized, etc.) | N/A |
ctrl+/ | cmd+/ | Comment/uncomment with line comment | ✅ |
ctrl+numpad_divide | cmd+numpad_divide | Comment/uncomment with line comment | ✅ |
ctrl+alt+/ | cmd+alt+/ | Comment/uncomment with block comment | ✅ |
ctrl+alt+numpad_divide | cmd+alt+numpad_divide | Comment/uncomment with block comment | ✅ |
ctrl+w | alt+up | Select successively increasing code blocks | ✅ |
ctrl+shift+w | alt+down | Decrease current selection to previous state | ✅ |
alt+q | ctrl+shift+q | Context info | N/A |
alt+enter | alt+enter | Show intention actions and quick-fixes | ✅ |
ctrl+alt+l | cmd+alt+l | Reformat code | ✅ |
ctrl+alt+l | cmd+alt+l | Reformat selected code | ✅ |
ctrl+alt+o | ctrl+alt+o | Optimize imports | N/A |
ctrl+alt+i | ctrl+alt+i | Auto-indent line(s) | N/A |
上表只列出部分映射,从上表可以看出有些在IDEA的快捷键在VSCode安装IDEA快捷键映射插件后任然不支持。不过大部分都是支持的。