您当前的位置: 首页 >  liaowenxiong eclipse

IntelliJ IDEA for Mac 在eclipse(MacOS)模式下的快捷键

liaowenxiong 发布时间:2021-01-26 11:33:17 ,浏览量:4

文章目录

    • Mac键盘符号
    • eclipse(MacOS)模式下的快捷键
      • General 通用
      • Debugging 调试
      • Search/ Replace 查询/替换
      • Editing 编辑
      • Refactoring 重构
      • Navigation 导航
      • Usage Search 使用查询
      • VCS/ Local History 版本控制/本地历史记录
      • Live Templates 动态代码模板
      • Other 官方文档上没有体现

Mac键盘符号

图标介绍
Command
Shift
Caps Lock
Option = Alt
Control
Enter
Delete
Fn + Delete
上箭头
下箭头
左箭头
右箭头
Fn + ↑ = Page Up
Fn + ↓ = Page Down
HomeFn + ←
EndFn + →
Tab = 右制表符
Shift + Tab = 左制表符
Esc = Escape
电源开关键

eclipse(MacOS)模式下的快捷键

General 通用

快捷键快捷键符号英文名称功能说明
Command + 0...Command + 9⌘0…⌘9Open corresponding tool window打开相应编号的工具窗口
Command + S⌘SSave all保存所有
Command + Option + Y⌘⌥YSynchronize同步、刷新
Command + Shift + F12⌘⇧F12Toggle maximizing editor切换最大化编辑器
Option + Shift + I⌥⇧IInspect current file with current profile检查当前文件与当前的配置文件
无法正常显示⌃`Quick switch current scheme快速切换当前的scheme(切换主题、代码样式等)
Command + ,⌘,Open Settings dialog打开IDEA系统设置
Command + ;⌘;Open Project Structure dialog打开项目结构对话框
Command+3⌘3Find Action查找动作(可设置相关选项)
Control +Tab⌃⇥Edit window switch编辑窗口标签和工具窗口之间切换(如果在切换的过程加按上delete,则是关闭对应选中的窗口)
Option + Shift + F⌥⇧FAdd Favorite添加到收藏夹
Control + Command + F⌃⌘FSwitch full screen切换全屏模式,最大化
Command+4⌘+4隐藏显示run窗口
Shift+Control+R⇧⌃R运行main方法

Debugging 调试

快捷键快捷键符号英文名称功能说明
F6F6Step over进入下一步,如果当前行断点是一个方法,则不进入当前方法体内
F5F5Step into进入下一步,如果当前行断点是一个方法,则进入当前方法体内,如果该方法体还有方法,则不会进入该内嵌的方法中
Option + F5⌥F5Smart step into智能步入,断点所在行上有多个方法调用,会弹出进入哪个方法
Option + F7⌥F7step out跳出
Command+R⌘RRun to cursor运行到光标处,如果光标前有其他断点会进入到该断点,建议改成Option+F9
Command+U⌘UEvaluate expression计算表达式(可以更改变量值使其生效)
F8F8Resume program恢复程序运行,如果该断点下面代码还有断点则停在下一个断点上
Shift+ Command + B⇧⌘BToggle breakpoint切换断点(若光标当前行有断点则取消断点,没有则加上断点)
Shift +Command + F8⇧⌘F8View breakpoints查看断点信息

Search/ Replace 查询/替换

快捷键快捷键符号英文名称功能说明
Double ShiftDouble ⇧Search everywhere查询任何东西
Command + F⌘FFind文件内查找
Command + K⌘KFind next查找模式下,向下查找
Shift + Command + K⇧⌘KFind previous查找模式下,向上查找
Command + R⌘RReplace文件内替换
Control+H⌃HFind in files全局查找(根据路径),在文件内搜索
Command + Shift+ R⌘⇧RReplace in files全局替换(根据路径),和系统快捷键冲突,改成Shift+R
Control+G⌃GSelect next occurrence选择下一个引用
Control+Command+G⌃⌘GSelect all occurrences选择所有引用
Control+G⌃GUnselect occurrence取消选择引,和上面重复了,奇怪~
Command + Shift + S⌘⇧SSearch Structurally查询结构(Ultimate Edition 版专用,需要在Keymap中设置)
Command + Shift + M⌘⇧MReplace Structurally替换结构(Ultimate Edition 版专用,需要在Keymap中设置)

Editing 编辑

快捷键快捷键符号英文名称功能说明
Control + Space⌃SpaceBasic code completion基本的代码补全(补全任何类、方法、变量),代码智能提示,因为和切换输入法快捷键冲突,所以基本改成Alt+/
Shift + Option+Space⇧⌥SpaceSmart code completion智能代码补全(过滤器方法列表和变量的预期类型
Command + Shift + Enter⌘⇧↩Complete statement自动结束代码,行末自动添加分号
Control+Shift + Space⌃⇧SpaceParameter info (within method call arguments)显示方法的参数信息
F2/Option+clickF2/⌥+clickQuick documentation lookup /Quick documentation显示当前位置的变量、方法的 Documentation 内容, 快速查看文档
Shift + F12⇧F2External Doc查看外部文档(在某些代码上会触发打开浏览器显示相关文档)
Control+ 鼠标放在代码上⌃+mouseBrief Info显示代码简要信息,这个和系统快捷键冲突了
Command + F1⌘F1Show descriptions of error at caret在错误或警告处显示具体描述信息
Command + N, Control + Enter, Control + N⌘N, ⌃↩, ⌃NGenerate code…自动生成代码(getter、setter、构造函数、hashCode/equals,toString)
Control + O⌃OOverride methods覆盖方法(重写父类方法)
Control + I⌃IImplement methods实现方法(实现接口中的方法)
Option + Command + Z⌥⌘ZSurround with…包围代码(使用if…else, try…catch, for, synchronized等包围选中的代码)
Command+/⌘/Comment/uncomment with line comment单行注释
Command + Option + /⌘⌥/Comment/uncomment with block comment块注释,多行注释
Shift + Control + /⇧⌃/Comment/uncomment with block comment块注释,多行注释
/** + enter/** ↩Comment with method/class方法/类的说明注释
Shift +Control+ 方向键上⇧⌃↑Extend selection连续选中代码块
Shift +Control+ 方向键下⇧⌃↓Shrink selection减少当前选中的代码块
Control + Shift + Q⌃⇧QContext info显示上下文信息
Option + Enter⌥↩Show intention actions and quick-fixes显示意向动作和快速修复代码,无此动作
Shift+Command +F⇧⌘FReformat code格式化代码
Shift+ Command+ O⇧⌘OOptimize imports优化import
Command+ I⌘IAuto-indent line(s)自动缩进线
Tab / Shift + Tab⇥ / ⇧⇥Indent/unindent selected lines缩进代码 / 反缩进代码
Command + X⌘XCut current line to clipboard剪切当前行或选定的块到剪贴板
Command + C⌘CCopy current line to clipboard复制当前行或选定的块到剪贴板
Command + V⌘VPaste from clipboard从剪贴板粘贴
Command + Shift + V⌘⇧VPaste from recent buffers…从最近的缓冲区粘贴
Option+Command+↓⌥ ⌘↓Duplicate current line复制光标所在行的内容,插入光标所在行下面
Command + D⌘DDelete line at caret删除当前行或选定的块的行,删除光标所在行
Control + Shift + J⌃⇧JSmart line join智能的将代码拼接成一行
Command + Enter⌘↩Smart line split智能的拆分拼接的行
Shift + Enter⇧↩Start new line开始新的一行,光标所在行下方插入空白行
Option+Command+enter⌥⌘↩光标所在行上方插入空白行
Option+Command +→ /Command+F6⌥⌘→/⌘F6select next tab选择下个tab,使用F6需要配合FN才行
Option+Command +←Shift+Command+F6⌥⌘←/Shift⌘F6select previous tab选择上一个tab
Command + Shift + ] / Command + Shift + [Select till code block end/ start选择直到代码块结束/开始,不存在此快捷键
Command+ Fn + Delete(⌦键为Fn+Delete)⌘ ⌦Delete to word end删除到单词的末尾
Command + Delete⌘⌫Delete to word start删除到单词的开头
Command + 加号 / Command + 减号⌘+ / ⌘-Expand/collapse code block展开 / 折叠代码块
Command + Shift + 加号⌘⇧+Expand all展开所有代码块
Command + Shift + 减号⌘⇧-Collapse all折叠所有代码块
Command + W⌘WClose active editor tab关闭活动的编辑器选项卡
Option+上下箭头⌥ +上下箭头Move current line of code移动当前代码行
Option+enter⌥ ↩导入包,自动修正代码,可以自动补齐代码语句
Shift+Option+enter⇧⌥ ↩导入包,自动修正代码
Option+→⌥→move to next word移到下一个单词
Option+←⌥←move to previous word移到上一个单词
Command+delete⌘⌫删除光标前面的单词
Command+→⌘→移到行尾
Command+←⌘←移到行首
Command+Shift+→⌘⇧→选中当前位置到行尾
Command+Shift+←⌘⇧←选中当前位置到行首
Shift+Command+X选中部分全部大小写切换
soutSystem.out.println()
forifor (int i = 0; i < ; i++) {}

Refactoring 重构

快捷键快捷键符号英文名称功能说明
F5Copy复制文件到指定目录,改成Option+C
Option+Command+V⌥⌘VMove移动文件到指定目录
Option+Shift+Enter⌥⇧↩Safe Delete安全删除
Shift+F6⇧F6Rename重命名
Control+T⌃TRefactor this重构这个
Option+Command + C⌥⌘CChange Signature更改签名,改成Option+Command+S
Option + Command + I⌥⌘IInline一致性
Option + Command + M⌥⌘MExtract Method将选中的代码提取为方法,选中部分抽取为方法
Option +Command + L⌥⌘LIntroduce Variable引入变量
Option +Command + F⌥⌘FIntrodue Field引入字段
Command + Option + C⌘⌥CIntroduce Constant提取常量
Command + Option + P⌘⌥PIntroduce Parameter提取参数

Navigation 导航

快捷键快捷键符号英文名称功能说明
Shift+Command + T⇧⌘TGo to class查找类文件
Shift + Command + R⌘⇧RGo to file查找所有类型文件、打开文件、打开目录,打开目录需要在输入的内容前面或后面加一个斜杠 /
Command + Option + O⌘⌥OGo to symbol前往指定的变量 / 方法,选中方法名或者变量,查找方法或者变量
Control + 方向键左 / Control + 方向键右⌃← / ⌃→Go to next/previous editor tab左右切换打开的编辑tab页,这个快捷键不对
F12Go back to previous tool window返回到前一个工具窗口
EscGo to editor (from tool window) / focus editor从工具窗口进入代码文件窗口
Shift + Esc⇧⎋Hide active or last active tool window隐藏当前或最后一个活动的窗口,且光标进入代码文件窗口
Command + L⌘LGo to line在当前文件跳转到某一行的指定处,跳转到指定的行
Command + Shift + F4⌘⇧F4未知关闭活动run/messages/find/… tab
Command + E⌘ERecent files popup显示最近打开的文件记录列表
Command + [ / Command + ]⌘[/ ⌘]Navigate back/ forward退回 / 前进到上一个操作的地方
Command + Shift + Delete⌘⇧⌫Navigate to last edit location跳转到最后一个编辑的地方
Option + Command+W⌥⌘WSelect current file or symbol in any view /select in…显示当前文件选择目标弹出层,弹出层中有很多目标可以进行选择(如在代码编辑窗口可以选择显示该文件的Finder)
F3 / Control + 鼠标点击⌘B / ⌘ +clickGo to declaration进入光标所在的方法/变量的声明处
Command + Option + B⌘⌥BGo to implementation(s)选择方法名,跳转到实现处,在某个调用的方法名上使用会跳到具体的实现处,可以跳过接口,改成Control+Option+I
Option + Space, Command + Y⌥ Space, ⌘YOpen quick definition lookup /quick definition快速打开光标所在方法、类的定义
Control + Shift + B⌃⇧BGo to type declaration选中类名,跳转到类型声明处
Command + U⌘UGo to Super Method前往当前光标所在方法的父类的方法 / 接口定义
Control + Option+方向键下 / Control + Option+方向键上⌃⌥↓ / ⌃⌥↑previous/next method当前光标跳转到当前文件的前一个/后一个方法名位置,跳到下一个/上一个成员函数或成员变量
Control + ] / Control+Shift+P⌃]/⌃⇧PMove Caret to code block end移动光标到当前所在代码块的结束位置,即跳转到最近的大括号位置
Option+Command+[⌥ ⌘[Move Caret to code block start移动光标到当前所在代码块的开始位置
Command + O⌘OFile structure popup弹出当前文件结构层,可以在弹出的层上直接输入进行筛选(可用于搜索类中的方法), 查看当前类成员信息
F4F4Type hierarchy显示当前类的层次结构
Command + Shift + H⌘⇧HMethod hierarchy显示方法层次结构
Control + Option + H⌃⌥HCall hierarchy显示调用层次结构
Shift+Command+.⇧⌘.previous highlighted error跳转到上一个突出错误或警告的位置
Shift+Command+ G⇧⌘G查找引用
Command+.⌘.Next highlighted error跳转到下一个突出错误或警告的位置,查看代码警告
F3F3Edit source/View source /jump to source编辑/查看代码源
Option + Home⌥ HomeShow navigation bar显示到当前文件的导航条
F9Toggle bookmark选中文件/文件夹/代码行,添加/取消书签
Option + F3⌥F3Toggle bookmark with mnemonic选中文件/文件夹/代码行,使用助记符添加/取消书签
Control + 0...Control + 9⌃0…⌃9Go to numbered bookmark定位到对应数值的书签位置
Command + F3⌘F3Show bookmarks显示所有书签

Usage Search 使用查询

快捷键快捷键符号英文名称功能说明
Shift+Command+G⇧⌘GFind usages在类中查找用法
Shift+Command+U⇧⌘UFind usages in file在文件中查找用法
Command + Shift + F7⌘⇧F7Highlight usages in file在文件中突出显示的用法
Command + Option + F7⌘⌥F7Show usages显示用法
Command+Shift+I⌘⇧I查看定义的类,快速查看

VCS/ Local History 版本控制/本地历史记录

快捷键快捷键符号英文名称功能说明
Command + K⌘KCommit project to VCS/Commit提交代码到版本控制器
Command + T⌘TUpdate project from VCS从版本控制器更新代码
Option+Command+K⌥⌘KPush commits推送提交
Control + V⌃V‘VCS’ quick popup/VCS Operations“VCS”快速弹出窗口
Option + Shift + C⌥⇧CRecent Changes查看最近的变更记录
Control + C⌃C‘VCS’ quick popup快速弹出版本控制器操作面板,没有此动作

Live Templates 动态代码模板

快捷键快捷键符号英文名称功能说明
Option +Command + Z⌥⌘ZSurround with Live Template弹出模板选择窗口,将选定的代码使用动态模板包住,就是添加if/else,try/catch等块
Command + J⌘JInsert Live Template插入自定义动态代码模板

Other 官方文档上没有体现

快捷键快捷键符号英文名称功能说明
Command + Shift +8⌘⇧8column selection mode竖编辑模式

说明:删除线的快捷键表示软件默认没有此快捷键,你需要自己去设置

忠告:开发工具适合自己的就可以了,你熟悉使用eclipse就使用eclipse,你熟悉使用idea就使用idea,如果你希望使用idea又使用eclipse,又不想记住两套快捷键这是不可能的,通过对比发现在idea中使用eclipse(MacOS)的快捷键,很多地方需要自定义且和eclipse for Mac默认的快捷键也有很多地方不同,所以使用idea的同学建议记住MacOS模式下的快捷键为佳!

关注
打赏
查看更多评论

liaowenxiong

暂无认证

  • 4浏览

    0关注

    1033博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录