8、快捷键的使用

Source


【尚硅谷】idea实战教程-讲师:宋红康

生活是属于每个人自己的感受,不属于任何别人的看法

8、快捷键的使用

8.1 常用快捷键

第1组:通用型

说明 快捷键
复制代码-copy ctrl + c
粘贴-paste ctrl + v
剪切-cut ctrl + x
撤销-undo ctrl + z
反撤销-redo ctrl + shift + z
保存-save all ctrl + s
全选-select all ctrl + a

第2组:提高编写速度(上)

说明 快捷键
智能提示-edit alt + enter
提示代码模板-insert live template ctrl + j
使用xx块环绕-surround with… ctrl + alt + t
调出生成getter/setter/构造器等结构-generate… alt + insert
自动生成返回值变量-introduce variable… ctrl + alt + v
复制指定行的代码-duplicate line or selection ctrl + d
删除指定行的代码-delete line ctrl + y
切换到下一行代码空位-start new line shift + enter
切换到上一行代码空位-start new line before current ctrl + alt + enter
向上移动代码-move statement up ctrl + shift +
向下移动代码-move statement down ctrl + shift +
向上移动一行-move line up alt + shift +
向下移动一行-move line down alt + shift +
方法的形参列表提醒-parameter info ctrl + p

第3组:提高编写速度(下)

说明 快捷键
批量修改指定的变量名、方法名、类名等-rename shift + F6
抽取代码重构方法-extract method… ctrl + alt + m
重写父类的方法-override methods… ctrl + o
实现接口的方法-implements methods… ctrl + i
选中的结构的大小写的切换-toggle case ctrl + shift + u
批量导包-optimize imports ctrl + alt + o

第4组:类结构、查找和查看源代码

说明 快捷键
如何看源码-go to class ctrl + 选中指定的结构 或 ctrl + n
显示当前类结构,支持搜索指定的方法、属性等-file structure ctrl + F12
退回到前一个编辑的页面-back ctrl + alt +
进入到下一个编辑的页面-forward ctrl + alt +
打开的类文件之间切换-select previous/next tab alt + ←/→
光标选中指定的类 , 查看继承树结构-Type Hierarchy ctrl + h
查看方法文当-quick documentation ctrl + q
类的 UML 关系图-show uml popup ctrl + alt + u
定位某行-go to line/column ctrl + g
回溯变量或方法的来源-go to implementation(s) ctrl + alt + b
折叠方法实现-collapse all ctrl + shift + -
展开方法实现-expand all ctrl + shift + +

第5组:查找、替换与关闭

说明 快捷键
查找指定的结构 ctrl + f
快速查找:选中的 Word 快速定位到下一个-find next ctrl + l
查找与替换-replace ctrl + r
直接定位到当前行的首位-move caret to line start home
直接定位到当前行的末位 -move caretto line end end
查询当前元素在当前文件中的引用,然后按 F3 可以选择 ctrl + f7
全项目搜索文本-find in path… ctrl + shift
关闭当前窗囗-close ctrl + f4

第6组:调整格式

说明 快捷键
格式化代码-reformat code ctrl + alt + l
使用单行注释-comment with line comment ctrl + /
使用 / 取消多行注释-comment with block comment ctrl + shift + /
选中数行,整体往后移动-tab tab
选中数行,整体往前移动-prev tab shift + tab

Debug快捷键

说明 快捷键
单步调试(不进入函数内部 )-step over f8
单步调试(进入函数内部 )-step into f7
强制单步调试( 进入函数内部 )-force step into alt + shift + f7
选择要进入的函数-smart strp into shift + f7
跳出函数-step out shift + f8
运行至断点-run to cursor alt + f9
继续执行,进入下一个断点或执行完程序-resume program f9
停止-stop alt + f2
查看断点-view breakpoints ctrl + shift + f8
关闭 - close ctrl + f4

8.2 查看快捷键

1 已知快捷键操作名,未知快捷键

在这里插入图片描述

2 已知快捷键,不知道对应的操作名

在这里插入图片描述

8.3 自定义快捷键

在这里插入图片描述

8.4 使用其他平台快捷键

在这里插入图片描述