Mac常用符号示意:
⌘——Command ()
⌃ ——Control
⌥——Option (alt)
⇧——Shift
基本操作
常用快捷键:
- ⌘+, 打开配置选项
- ^+R 运行程序
- ^+V VCS operation popups
- ⌘+click 进入源码
- ⌥+enter 快速修复错误
- ⌘+N Generate
⌥+⇧+⌘+C Copy Reference 复制代码所在类和行数
Fast Navigate
- ⌘+⇧+F 全局搜索文件内容
- ⌘+O navigate class
- ⌥+⌘+O navigate symbol 可以使用类名.symbol精确定位,如System.out
- ⇧+⌘+O navigate file 在项目中快速定位文件,包括库文件等
- ^+⇧+A 搜索option或者action
- edit configuration配置命令行参数,环境变量
- export settings导出配置
- ⇧+⇧ search everywhere 包括类、文件、action、operation等。例如输入tool选择toolbar会显示工具栏。左右箭头选择历史
- ⌘+数字 定位到Idea的相应窗口,例如⌘+7定位到structure,多次toogle该窗口
- ⌘+F12 navigate -> File Structure
- escape 切换到editor,⌘+往下箭头相当于Enter+Escape
- navigate bar,⌘+向上箭头打开navigate bar然后可以搜索
- ⌘+E recently files ⇧+⌘+E recently changed files
- ⌘+B navigate -> declaration 跳到变量或者方法的定义处 和⌘+单击效果相同
- ⌥+⌘+B -> navigate -> implemention 跳到接口的实现
- ⌥+Space -> quick definition 快速查看定义
- ⌘+[/] navigate back/forward
- ⌥+F7或者⌘+B类名 查看类的使用情况
- Editor相关
- ⇧+⌘+F12 hide all windows 隐藏除Editor之外的所有窗口[toogle]
- ⌥+F12 open terminal 打开终端
- ⇧+F4 open source in a new window 在新窗口打开源码,便于对比复制
- ⇧+⌘+<-/-> scretch to left/right
- 选择区域
- ⌥+up/down Shrink/extend selection 当选择方法名之后再按快捷键会选择整个方法
- ⇧+⌘+up/down move statement up/down 将选中的方法声明上下移动,或则选中的语句在方法内上下移动
- 剪切板(clipboard) ⇧+⌘+v Paste from History
插件使用
插件安装:⇧+⌘+A,输入plugins,点击Install JetBrains plugin…
IdeaVim
Idea中的vim插件,基本操作和vim类似,很好用。而且快捷键和Idea的快捷键不冲突