IDEA快捷键

https://www.jianshu.com/p/ce91cea16c60

1 编辑【Editing】

快捷键英文说明中文说明
Ctrl + SpaceBasic code completion (the name of any class, method or variable)补全代码,由于经常与操作系统的输入法的切换冲突,所以实际很少用。一般直接在 idea 中开启输入自动补全机制。
Ctrl + Shift + SpaceSmart code completion (filters the list of methods and variables by expected type在列出的可选项中只显示出你所输入的关键字最相关的信息。(常用)
Ctrl + Shift + EnterComplete statement代码补全后,自动在代码末尾添加分号结束符
Ctrl + PParameter info (within method call arguments)在某个方法中,调用该按键后,会展示出这个方法的调用参数列表信息。
Ctrl + QQuick documentation lookup展示某个类或者方法的 API 说明文档
Ctrl + mouseover code Brief Info跳进到某个类或者方法源代码中进行查看。(常用)
Alt + InsertGenerate code... (Getters, Setters, Constructors, hashCode/equals, toString)自动生成某个类的 Getters, Setters, Constructors, hashCode/equals, toString 等代码。(常用)
Ctrl + OOverride methods展示该类中所有覆盖或者实现的方法列表,注意这里是字母小写的 O!
Ctrl + Alt + TSurround with… (if..else,try..catch, for, synchronized, etc.)自动生成具有环绕性质的代码,比如:if..else,try..catch, for, synchronized 等等,使用前要先选择好需要环绕的代码块。(常用)
Ctrl + /Comment/uncomment with line comment对单行代码,添加或删除注释。分为两种情况:如果只是光标停留在某行,那么连续使用该快捷键,会不断注释掉下一行的代码;如果选定了某行代码(选定了某行代码一部分也算这种情况),那么连续使用该快捷键,会在添加或删除该行注释之间来回切换。(常用)
Ctrl + Shift + /Comment/uncomment with block comment对代码块,添加或删除注释。它与 Ctrl + / 的区别是,它只会在代码块的开头与结尾添加注释符号!(常用)
Ctrl + WSelect successively increasing code blocks选中当前光标所在的代码块,多次触发,代码块会逐级变大。(常用)
Ctrl + Shift + WDecrease current selection to previous state是 Ctrl + W 的反向操作,多次触发,代码块会逐级变小,最小变为光标。
Alt + QContext info展示包含当前光标所在代码的父节点信息,比如在 java 方法中调用,就会展示方法签名信息。
Alt + EnterShow intention actions and quick-fixes展示当前当前光标所在代码,可以变化的扩展操作
Ctrl + Alt + LReformat code格式化代码 (常用)
Ctrl + Alt + OOptimize imports去除没有实际用到的包,这在 java 类中特别有用。(常用)
Ctrl + Alt + IAuto-indent line(s)按照缩进的设定,自动缩进所选择的代码段。
Tab / Shift + TabIndent/unindent selected lines缩进或者不缩进一次所选择的代码段。(常用)
Ctrl + X 或 Shift DeleteCut current line or selected block to clipboard剪切当前代码。 (常用)
Ctrl + C 或 Ctrl + InsertCopy current line or selected block to clipboard拷贝当前代码。 (常用)
Ctrl + V 或 Shift + InsertPaste from clipboard粘贴之前剪切或拷贝的代码。(常用)
Ctrl + Shift + VPaste from recent buffers...从之前的剪切或拷贝的代码历史记录中,选择现在需要粘贴的内容。(常用)
Ctrl + DDuplicate current line or selected block复制当前选中的代码。(常用)
Ctrl + YDelete line at caret删除当前光标所在的代码行。(常用)
Ctrl + Shift + JSmart line join把下一行的代码接续到当前的代码行。
Ctrl + EnterSmart line split当前代码行与下一行代码之间插入一个空行,原来所在的光标不变。(常用)
Shift + EnterStart new line当前代码行与下一行代码之间插入一个空行,原来光标现在处于新加的空行上。(常用)
Ctrl + Shift + UToggle case for word at caret or selected block所选择的内容进行大小写转换。。(常用)
Ctrl + Shift + ]/[Select till code block end/start从当前光标所在位置开始,一直选择到当前光标所在代码段起始或者结束位置。
Ctrl + DeleteDelete to word end删除从当前光标所在位置开始,直到这个单词的结尾的内容。
Ctrl + NumPad(+/-)Expand/collapse code block展开或收缩代码段。 (常用)
Ctrl + Shift + NumPad(+)Expand all展开所有代码段。
Ctrl + Shift + NumPad(-)Collapse all收缩所有代码段。
Ctrl + F4Close active editor tab关闭当前标签页。
Shift + F6 修改名字。(常用)

2 查找或替换【Search/Replace】

快捷键英文说明中文说明
Ctrl + FFind在当前标签页中进行查找,还支持正则表达式哦。(常用)
F3Find next如果找到了多个查找结果,每调用一次就会跳到下一个结果,很方便哦。
Shift + F3Find previous是 F3 的反向操作,即每调用一次就会跳到上一个结果。
Ctrl + RReplace在当前标签页中进行替换操作。(常用)
Ctrl + Shift + FFind in path通过路径查找。(常用)
Ctrl + Shift + RReplace in path通过路径替换。(常用)

3 查看使用情况【Usage Search】

快捷键英文说明中文说明
Alt + F7Find usages在当前项目中的使用情况,会打开一个使用情况面板。
Ctrl + F7Find usages in file在当前文件中的使用情况,找的内容会低亮显示。
Ctrl + Shift + F7在当前文件中的使用情况,找的内容会高亮显示。
Ctrl + Alt + F7Show usages打开使用情况列表。 (常用)

4 编译与运行【Compile and Run】

快捷键英文说明中文说明
Ctrl + F9Make project (compile modifed and dependent)编译项目(如果之前有编译过,那么只会编译那些修改的类或者依赖的包)。
Ctrl + Shift + F9Compile selected file, package or module编译所中的范围(如果在某个类中,那么只会编译当前类)。
Alt + Shift + F10Select configuration and run会打开一个已经配置的运行列表,让你选择一个后,再运行。
Alt + Shift + F9Select configuration and debug会打开一个已经配置的运行列表,让你选择一个后,再以调试模式运行。
Shift + F10Run立即运行当前配置的运行实例,这个在单元测试中特别好用。 (常用)
Shift + F9Debug立即以编译模式运行当前配置的运行实例。
Ctrl + Shift + F10Run context configuration from editor按照编辑器绑定的文件类型,运行相关的程序。比如一个 html 页面,调用后,会直接打开一个浏览器。

5 调试【Debugging】

快捷键英文说明中文说明
F8Step over跳到当前代码下一行。 (常用)
F7Step into跳入到调用的方法内部代码。 (常用)
Shift + F7Smart step into会打开一个面板,让你选择具体要跳入的类方法,这个在复杂的嵌套代码中特别有用。
Shift + F8Step out跳出当前的类,到上一级。 (常用)
Alt + F9Run to cursor让代码运行到当前光标所在处,非常棒的功能。 (常用)
Alt + F8Evaluate expression打开一个表达式面板,然后进行进一步的计算。
F9Resume program结束当前断点的本轮调试(因为有可能代码会被调用多次,所以调用后只会结束当前的这一次);如果有下一个断点会跳到下一个断点中。(常用)
Ctrl + F8Toggle breakpoint在当前光标处,添加或者删除断点。
Ctrl + Shift + F8View breakpoints打开当前断点的面板,可以进行条件过滤哦。

6 导航【Navigation】

快捷键英文说明中文说明
Ctrl + NGo to class打开类查询框。(常用)
Ctrl + Shift + NGo to file打开文件查询框。(常用)
Ctrl + Alt + Shift + NGo to symbol打开文本查询框。
Alt + 右箭头/左箭头Go to next/previous editor tab跳到下一个/上一个编辑器标签。
F12Go back to previous tool window如果当前在编辑窗口,触发后,会跳到之前操作过的工具栏上。
ESCGo to editor (from tool window)从工具栏上,再跳回原来的编辑窗口,一般与 F12 配合使用。
Shift + ESCHide active or last active window隐藏最后一个处于活跃状态的工具窗口。
Ctrl + Shift + F4Close active run/messages/find/... tab同时关闭处于活动状态的某些工具栏窗口。
Ctrl + GGo to line跳转至某一行代码。。(常用)
Ctrl + ERecent files popup打开曾经操作过的文件历史列表。
Ctrl + Alt + 右箭头/左箭头Navigate back/forward在曾经浏览过的代码行中来回跳
Ctrl + Shift + BackspaceNavigate to last edit location跳转到最近的编辑位置(如果曾经编辑过代码)。
Alt + F1Select current file or symbol in any view打开一个类型列表,选择后会导航到当前文件或者内容的具体与类型相关的面板中。
Ctrl + B 或 Ctrl + 鼠标左键Go to declaration如果是类,那么会跳转到当前光标所在的类定义或者接口;如果是变量,会打开一个变量被引用的列表。(常用)
Ctrl + Alt + BGo to implementation(s)跳转到实现类,而不是接口。(常用)
Ctrl + Shift + IOpen quick definition lookup打开一个面板,里面包含类代码。
Ctrl + Shift + BGo to type declaration打开变量的类型所对应的类代码,只对变量有用。
Ctrl + UGo to super-method/super-class打开方法的超类方法或者类的超类,只对有超类的方法或者类有效。
Alt + 上/下箭头Go to previous/next method在某个类中,跳到上一个/下一个方法的签名上。
Ctrl + ]/[Move to code block end/start移动光标到类定义的终止右大括号或者起始左大括号。
Ctrl + F12File structure popup打开类的结构列表。(常用)
Ctrl + HType hierarchy打开类的继承关系列表。(常用)
Ctrl + Shift + HMethod hierarchy打开某个类方法的继承关系列表。
Ctrl + Alt + HCall hierarchy打开所有类的方法列表,这些方法都调用了当前光标所处的某个类方法。(常用)
F2/Shift + F2Next/previous highlighted error在编译错误的代码行中来回跳。
F4Edit source打开当前光标所在处的方法或类源码。
Alt + HomeShow navigation bar激活包路径的导航栏。
F11Toggle bookmark把光标所处的代码行添加为书签或者从书签中删除。(常用)
Ctrl + F11Toggle bookmark with mnemonic把光标所处的代码行添加为带快捷键的书签或者从快捷键书签中删除。
Ctrl + [0-9]Go to numbered bookmark跳转到之前定义的快捷键书签。
Shift + F11Show bookmarks打开书签列表。(常用)

Editing
Ctrl + Space  Basic code completion (the name of any class, method or variable)
Ctrl + Shift + Space  Smart code completion (filters the list of methods and variables by expected type)
Ctrl + Shift + Enter  Complete statement
Ctrl + P  Parameter info (within method call arguments)
Ctrl + Q  Quick documentation lookup
Shift + F1  External Doc
Ctrl + mouse over code  Brief Info
Ctrl + F1  Show descriptions of error or warning at caret
Alt + Insert  Generate code... (Getters, Setters,Constructors, hashCode/equals, toString)
Ctrl + O  Override methods
Ctrl + I  Implement methods
Ctrl + Alt + T  Surround with… (if..else, try..catch, for,synchronized, etc.)
Ctrl + /  Comment/uncomment with line comment
Ctrl + Shift + /  Comment/uncomment with block comment
Ctrl + W  Select successively increasing code blocks
Ctrl + Shift + W  Decrease current selection to previous state
Alt + Q  Context info
Alt + Enter  Show intention actions and quick-fixes
Ctrl + Alt + L  Reformat code
Ctrl + Alt + O  Optimize imports
Ctrl + Alt + I  Auto-indent line(s)
Tab / Shift + Tab  Indent/unindent selected lines
Ctrl + X , Shift + Delete  Cut current line or selected block to clipboard
Ctrl + C , Ctrl + Insert  Copy current line or selected block to clipboard
Ctrl + V , Shift + Insert  Paste from clipboard
Ctrl + Shift + V  Paste from recent buffers...
Ctrl + D  Duplicate current line or selected block
Ctrl + Y  Delete line at caret
Ctrl + Shift + J  Smart line join
Ctrl + Enter  Smart line split
Shift + Enter  Start new line
Ctrl + Shift + U  Toggle case for word at caret or selected block
Ctrl + Shift + ]/[  Select till code block end/start
Ctrl + Delete/Backspace Delete to word end/start
Ctrl + NumPad+/-  Expand/collapse code block
Ctrl + Shift + NumPad+ Expand all
Ctrl + Shift + NumPad-  Collapse all
Ctrl + F4  Close active editor tab
Usage Search
Alt + F7/Ctrl + F7  Find usages/Find usages in file
Ctrl + Shift + F7  Highlight usages in file
Ctrl + Alt + F7  Show usages
Navigation
Ctrl + N  Go to class
Ctrl + Shift + N  Go to file
Ctrl + Alt + Shift + N  Go to symbol
Alt + Right/Left  Go to next / previous editor tab
F12  Go back to previous tool window
Esc  Go to editor (from tool window)
Shift + Esc  Hide active or last active window
Ctrl + Shift + F4  Close active run / messages / find / ... tab
Ctrl + G  Go to line
Ctrl + E  Recent files popup
Ctrl + Alt + Left/Right  Navigate back / forward
Ctrl + Shift + Backspace Navigate to last edit location
Alt + F1  Select current file or symbol in any view
Ctrl + B , Ctrl + Click  Go to declaration
Ctrl + Alt + B  Go to implementation(s)
Ctrl + Shift + I  Open quick definition lookup
Ctrl + Shift + B  Go to type declaration
Ctrl + U  Go to super-method / super-class
Alt + Up/Down  Go to previous / next method
Ctrl + ]/[  Move to code block end/start
Ctrl + F12  File structure popup
Ctrl + H  Type hierarchy
Ctrl + Shift + H  Method hierarchy
Ctrl + Alt + H  Call hierarchy
F2 / Shift + F2  Next/previous highlighted error
F4 / Ctrl + Enter  Edit source / View source
Alt + Home  Show navigation bar
F11  Toggle bookmark
Ctrl + F11  Toggle bookmark with mnemonic
Ctrl + #[0-9]  Go to numbered bookmark
Shift + F11  Show bookmarks
Search/Replace
Double Shift Search everywhere
Ctrl + F  Find
F3 / Shift + F3  Find next / Find previous
Ctrl + R  Replace
Ctrl + Shift + F  Find in path
Ctrl + Shift + R  Replace in path
Ctrl + Shift + S  Search structurally (Ultimate Edition only)
Ctrl + Shift + M  Replace structurally (Ultimate Edition only)
Refactoring
F5  Copy
F6  Move
Alt + Delete  Safe Delete
Shift + F6  Rename
Ctrl + F6  Change Signature
Ctrl + Alt + N  Inline
Ctrl + Alt + M  Extract Method
Ctrl + Alt + V  Extract Variable
Ctrl + Alt + F  Extract Field
Ctrl + Alt + C  Extract Constant
Ctrl + Alt + P  Extract Parameter
Debugging
F8/F7  Step over/Step into
Shift + F7 / Shift + F8 Smart step into/Step out
Alt + F9  Run to cursor
Alt + F8  Evaluate expression
F9  Resume program
Ctrl + F8  Toggle breakpoint
Ctrl + Shift + F8  View breakpoints
Compile and Run
Ctrl + F9  Make project (compile modifed and dependent)
Ctrl + Shift + F9  Compile selected file, package or module
Alt + Shift + F10/F9  Select configuration and run/and debug
Shift + F10/F9  Run/Debug
Ctrl + Shift + F10  Run context configuration from editor
VCS/Local History
Ctrl + K / Ctrl + T  Commit project to VCS/Update from VCS
Alt + Shift + C  View recent changes
Alt + BackQuote (`)  ‘VCS’ quick popup
General
Alt + #[0-9]  Open corresponding tool window
Ctrl + S  Save all
Ctrl + Alt + Y  Synchronize
Ctrl + Shift + F12  Toggle maximizing editor
Alt + Shift + F  Add to Favorites
Alt + Shift + I  Inspect current file with current profile
Ctrl + BackQuote (`)  Quick switch current scheme
Ctrl + Alt + S  Open Settings dialog
Ctrl + Alt + Shift + S  Open Project Structure dialog
Ctrl + Shift + A  Find Action
Ctrl + Tab  Switch between tabs and tool window

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值