idea for mac常用快捷键及修改
常用快捷键
后面带(自)的为自己设置的快捷键
- 执行(run)----> shift + F10
- 代码补全(Class Name Completion)----> control + space【alt + / (自)】
- 单行注释(Comment with Line Comment)----> command + /
- 多行注释(Comment with Block Comment)----> control + shift + /
- 从当前光标选中到本行开头(Move Caret Line Start)----> command + ←
- 从当前光标选中到本行末尾(Move Caret Line End)----> command + ←
- 向下复制一行(Duplicate Lines)----> ctrl + alt + down (自)
- 删除一行或选中行(Delete Line)----> command + y【ctrl + d (自)】
- 向下移动行(Move Statement Down)----> command + shift + ↓ 【alt + ↓(自)】
- 向上移动行(Move statement Up)----> command + shift + ↑ 【alt + ↑(自)】
- 向下开始新的一行(Start New Line)----> shift + enter
- 向上开始新的一行 (Start New Line Before Current)----> command + alt + enter 【command + shift + enter (自)】
- 进入方法 (Declaration)----> command + 鼠标左键
- 万能解错/生成返回值变量(Show Intention Actions)----> alt + enter
- 退回到前一个编辑的页面(Back)----> alt + command + ←
- 进入到下一个编辑的页面(针对于上条)(Forward)----> alt + command + →
- 查看继承关系(Type Hierarchy)----> control + h
- 格式化代码(Reformat Code)----> alt + command + L
- 提示方法参数类型(Parameter Info)----> command + p
- 复制代码(Copy)----> command + c
- 撤销(Undo)----> command + z
- 反撤销(Redo)----> command + shift + z
- 剪切(Cut)----> command + x
- 粘贴(Paste)----> command + v
- 保存(SaveAll)----> command + s
- 全选(SelectAll)----> command + a
- 向后缩进(Tab)----> tab
- 向前缩进(Unindent Line or Selection)----> shift + tab
- 查看类的结构(File Structure)----> command + 7 或 command + F12
- 修改变量名与方法名(Rename)----> alt + shift + r
- 大写转小写/小写转大写(Toggle Case)----> command + shift + u
- 生成构造器/get/set/toString(Generate)----> control + n 或 control + enter
- 查看文档说明(Quick Documentation)----> control + j
- 收起所有的方法(Collapse All)----> command + shift + -(减号)
- 打开所有方法(Expand All)----> command + shift + +(加号)
- 生成 try-catch 等(Surround With)----> command + alt + t
- 查找/替换(当前)(Replace)----> command + r
- 按文件名搜索文件(File)----> command + shift + n
- 查找类或方法在哪被使用(Find Usages)----> alt + F7
- 按类名搜索类(Class)----> command + n
- 查找任何东西(Search Everywhere)----> 按两次 Shift
- 查看类的继承结构图(Show UML Diagram)----> command + alt + shift + u
- 查看方法的多层重写结构(Method Hierarchy)----> command + shift + h
- 添加到收藏(Add to Favorites)----> control + alt + d
- 抽取方法(Extract Method)----> command + alt + m
- 打开最近修改的文件(Recently Files)----> command + E
- 关闭当前打开的代码栏(Close)----> control + w
- 关闭打开的所有代码栏(Close All)----> control + shift + w
- 快速搜索类中的错误(Next Highlighted Error)----> F2
- 自动补全返回类型(Variable)----> command + alt + v 【command + alt + enter(自)】
- 打开关闭run窗口----> command + 4
- 格式化代码(Reformat Code)----> command + alt + option
- pom文件添加依赖(Generate…)----> control + n
- 打开项目设置(Project Structure…)----> command + ;
- 打开idea设置(Preferences…)----> command + ,
- 这里接48条 command + number 打开关闭某窗口数字在窗口上看
例:run是4 所以command + 4是打开关闭run窗口
修改快捷键
1.IntelliJ IDEA —> Preferences 或command + ,打开Perference
2.选择Keymap选项
3.框一是按快捷键功能进行搜索(我前面已给出常用快捷键功能以及英文名),框二是按快捷键名进行搜索
用快捷键名进行搜索时不用自己输入快捷键名称,只需按下对应的快捷键即可
4.添加快捷键只需在想要修改的快捷键上右击添加即可
5.在如图所示框中按出你想要设置的快捷键即可(同样不需要自己输入快捷键名),然后点OK添加快捷键成功,最后点击Apply应用成功
6.删除只需在你想要删除的快捷键上右击,然后删除即可(可能有的快捷键配置不止一个只需删除你想删除的即可)。
7.设置有鼠标点击的快捷键,在第四步的框中选择第二项,若设置command + 鼠标左键作为快捷键只需按住command并鼠标左击鼠标点击区域即可,若设置的快捷键有冲突也可点OK,只不过需删除冲突的快捷键。
若不想自己设置快捷键也可以使用idea默认给出的快捷键模版,里面也有eclipse的快捷键(不过有些还是和eclipse有区别) ,也可以自己去下载快捷键jar包,然后File —> import settings 选择你下载好的jar包导入即可。
这里给出一个jar包以及对应的快捷键说明(这个jar包主要针对idea中eclipse的快捷键模版进行完善,适合从eclise转到idea的开发者)
点击下载
提取码:j0ki