Summary of the use of shortcut keys for personal development ideas

command+A/C/X/V/Z select all/copy/cut/paste/cancel
command+shift+Z redo
command+option+L format
command+N generate function, generate setter/getter/toString etc.
command+option+M Extract the selected code into a single method
command+option+left/right The previous/next position of the cursor
command+shift+backspace The last edited position
command+shift Generate a single test
command+F Search
command+shift+ F Global search
command+R Replace
command+shift+R Global replace
command+O Find class
command+shift+O Find file
command+K git submit to cache
command+shift+K git code push to remote
shift twice in a row Search for anything

Description of Mac keyboard symbols and modifier keys

  •  ——> Command
  •  ——> Shift
  •  ——> Option
  •  ——> Control
  • ↩︎ ——> Return/Enter
  •  ——> Delete
  •  ——> 向前删除键(Fn + Delete)
  •  ——> 上箭头
  •  ——> 下箭头
  •  ——> 左箭头
  •  ——> 右箭头
  •  ——> Page Up(Fn + ↑)
  •  ——> Page Down(Fn + ↓)
  •  ——> 右制表符(Tab键)
  •  ——> 左制表符(Shift + Tab)
  •  ——> Escape(Esc)
  • End ——> Fn + →
  • Home ——> Fn + ←

Part 1: Editing

hot key effect
Control + Space Basic code completion (complete any class, method, variable)
Control + Shift + Space Smart code completion (list of filter methods and expected types of variables)
Command + Shift + Enter Automatically end the code, automatically add a semicolon at the end of the line
Command + P Display method parameter information
Control + J Quickly view documents
Shift + F1 View external documents (on some codes, it will trigger to open the browser to display related documents)
Command + Mouse over the code Display code brief information
Command + F1 Display specific description information at the error or warning
Command + NControl + EnterControl + N Generate code getter( setter, hashCode, equals, , toString, constructors, etc.)
Control + O Override method (override parent class method)
Control + I Implementation method (implement the method in the interface)
Command + Option + T Surround code ( if...else, try...catch, for, synchronizedand the like surrounding the selected code)
Command + / Comment/uncomment and line comment
Command + Option + / Comment/uncomment and block comment
Option + Arrow key up Select code blocks consecutively
Option + Arrow down Reduce the currently selected code block
Control + Shift + Q Show contextual information
Option + Enter Show intention actions and quick fix codes
Command + Option + L Format code
Control + Option + O Optimize import
Control + Option + I Auto-indent
Tab / Shift + Tab Indented code / unindented code
Command + X Cut current line or selected block to clipboard
Command + C Copy the current line or selected block to the clipboard
Command + V Paste from clipboard
Command + Shift + V Paste from the nearest buffer
Command + D Copy the current line or selected block
Command + Delete Delete the current line or selected block line
Control + Shift + J Smartly stitch the code into one line
Command + Enter Smart split and spliced ​​rows
Shift + Enter Start a new line
Command + Shift + U Case switch
Command + Shift + ] / Command + Shift + [ Select until the end/start of the code block
Option + Fn + Delete Delete to the end of the word
Option + Delete Delete to the beginning of the word
Command + Plus sign /  Command + minus sign Expand/collapse code block
Command + Shift + Plus Expand all code blocks
Command + Shift + Minus sign Collapse all code blocks
Command + W Close the active editor tab

Part 2: Search / Replace (query/replace)

hot key effect
Double Shift Query anything
Command + F Find in file
Command + G In search mode, search down
Command + Shift + G In search mode, search upwards
Command + R In-file replacement
Command + Shift + F Global search (according to path)
Command + Shift + R Global replacement (according to path)
Command + Shift + S Query structure (Special for Ultimate Edition version, need to be set in Keymap)
Command + Shift + M Replacement structure (Special for Ultimate Edition version, need to be set in Keymap)

Part 3: Usage Search (use query)

hot key effect
Option + F7 / Command + F7 Find the usage in the file / Find the usage in the class
Command + Shift + F7 Usage highlighted in the file
Command + Option + F7 Show usage

Part 4: Compile and Run (compile and run)

hot key effect
Command + F9 Compile Project
Command + Shift + F9 Compile selected files, packages or modules
Control + Option + R The selectable menu of Run pops up
Control + Option + D Debug selectable menu pops up
Control + R run
Control + D debugging
Control + Shift + RControl + Shift + D Run context configuration from the editor

Part 5: Debugging

hot key effect
F8 进入下一步,如果当前行断点是一个方法,则不进入当前方法体内
F7 进入下一步,如果当前行断点是一个方法,则进入当前方法体内,如果该方法体还有方法,则不会进入该内嵌的方法中
Shift + F7 智能步入,断点所在行上有多个方法调用,会弹出进入哪个方法
Shift + F8 跳出
Option + F9 运行到光标处,如果光标前有其他断点会进入到该断点
Option + F8 计算表达式(可以更改变量值使其生效)
Command + Option + R 恢复程序运行,如果该断点下面代码还有断点则停在下一个断点上
Command + F8 切换断点(若光标当前行有断点则取消断点,没有则加上断点)
Command + Shift + F8 查看断点信息

Part 6:Navigation(导航)

快捷键 作用
Command + O 查找类文件
Command + Shift + O 查找所有类型文件、打开文件、打开目录,打开目录需要在输入的内容前面或后面加一个反斜杠/
Command + Option + O 前往指定的变量 / 方法
Control + 方向键左 / Control + 方向键右 左右切换打开的编辑 tab 页
F12 返回到前一个工具窗口
Esc 从工具窗口进入代码文件窗口
Shift + Esc 隐藏当前或最后一个活动的窗口,且光标进入代码文件窗口
Command + Shift + F4 关闭活动 run/messages/find/... tab
Command + L 在当前文件跳转到某一行的指定处
Command + E 显示最近打开的文件记录列表
Option + 方向键左 / Option + 方向键右 光标跳转到当前单词 / 中文句的左 / 右侧开头位置
Command + Option + 方向键左 / Command + Option + 方向键右 退回 / 前进到上一个操作的地方
Command + Shift + Delete 跳转到最后一个编辑的地方
Option + F1 显示当前文件选择目标弹出层,弹出层中有很多目标可以进行选择(如在代码编辑窗口可以选择显示该文件的 Finder)
Command + B / Command + 鼠标点击 进入光标所在的方法/变量的接口或是定义处
Command + Option + B 跳转到实现处,在某个调用的方法名上使用会跳到具体的实现处,可以跳过接口
Option + SpaceCommand + Y 快速打开光标所在方法、类的定义
Control + Shift + B 跳转到类型声明处
Command + U 前往当前光标所在方法的父类的方法 / 接口定义
Control + 方向键下 / Control + 方向键上 当前光标跳转到当前文件的前一个 / 后一个方法名位置
Command + ] / Command + [ 移动光标到当前所在代码的花括号开始 / 结束位置
Command + F12 弹出当前文件结构层,可以在弹出的层上直接输入进行筛选(可用于搜索类中的方法)
Control + H 显示当前类的层次结构
Command + Shift + H 显示方法层次结构
Control + Option + H 显示调用层次结构
F2 / Shift + F2 跳转到下一个 / 上一个突出错误或警告的位置
F4 / Command + 方向键下 编辑 / 查看代码源
Option + Home 显示到当前文件的导航条
F3 选中文件 / 文件夹 / 代码行,添加 / 取消书签
Option + F3 选中文件 / 文件夹/代码行,使用助记符添加 / 取消书签
Control + 0Control + 9 定位到对应数值的书签位置
Command + F3 显示所有书签

Part 7:Refactoring(重构)

快捷键 作用
F5 复制文件到指定目录
F6 移动文件到指定目录
Command + Delete 在文件上为安全删除文件,弹出确认框
Shift + F6 重命名文件
Command + F6 更改签名
Command + Option + N 一致性
Command + Option + M 将选中的代码提取为方法
Command + Option + V 提取变量
Command + Option + F 提取字段
Command + Option + C 提取常量
Command + Option + P 提取参数

Part 8:VCS / Local History(版本控制 / 本地历史记录)

快捷键 作用
Command + K 提交代码到版本控制器
Command + T 从版本控制器更新代码
Option + Shift + C 查看最近的变更记录
Control + C 快速弹出版本控制器操作面板

Part 9:Live Templates(动态代码模板)

快捷键 作用
Command + Option + J 弹出模板选择窗口,将选定的代码使用动态模板包住
Command + J 插入自定义动态代码模板

Part 10:General(通用)

快捷键 作用
Command + 1Command + 9 打开相应编号的工具窗口
Command + S 保存所有
Command + Option + Y 同步、刷新
Control + Command + F 切换全屏模式
Command + Shift + F12 切换最大化编辑器
Option + Shift + F 添加到收藏夹
Option + Shift + I 检查当前文件与当前的配置文件
Control + ` 快速切换当前的 scheme(切换主题、代码样式等)
Command + , 打开 IDEA 系统设置
Command + ; 打开项目结构对话框
Shift + Command + A 查找动作(可设置相关选项)
Control + Shift + Tab 编辑窗口标签和工具窗口之间切换(如果在切换的过程加按上 delete,则是关闭对应选中的窗口)

Guess you like

Origin blog.csdn.net/qq_39809613/article/details/108371946