IDEA重要的快捷方式

Ctrl+Shift+T  : 当您想要捕获由某些代码片段抛出的异常时,请在编辑器中选择它,按住选择try/catch      do/while等包围结构。

When you want to catch exceptions thrown by some code fragment, select it in the editor, press Ctrl+Alt+T (Code | Surround With) and choose try / catch. The catch blocks for all the exceptions thrown inside the block will be generated automatically.
You can customize the bodies of the generated catch blocks on the Code tab of File | Settings | File and Code Templates.

Use other items in the list to surround with other constructs.

Ctrl+Shift+空格:用在new关键字之后选择创建类型。

The SmartType code completion may be used after the new keyword, to instantiate an object of the expected type. For example, type

Ctrl+Alt+B: 要导航到一个抽象方法的实现(s),将caret的用法或它的名称放在声明中,按Ctrl+Alt+b。

Ctrl+W: 在编辑器中按Ctrl+W(扩展选择)选择caret中的单词,然后选择源代码的扩展区域。例如,它可以选择一个方法名,然后是调用这个方法的表达式,然后是整个语句,然后,你也可以通过双击编辑器中的目标区域来选择caret中的单词和源代码的扩展区域。

(extend selection) in the editor selects the word at the caret and then selects expanding areas of the source code. For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc. You can also select the word at the caret and the expanding areas of the source code by double-clicking the target areas in the editor.

 Ctrl+Alt+V : 提取一段代码中的变量。提取变量重构可以帮助您简化代码中的复杂语句。例如,在下面的代码片段中,您可以在代码中选择一个表达式:就会选中表达式对应的变量。

 Ctrl+/ and Ctrl+Shift+/.
Ctrl+/ comments or uncomments the current line or selected block with single line comments (//...).
Ctrl+Shift+/ encloses the selected block in a block comment (/*...*/).
To uncomment a commented block press Ctrl+Shift+/ anywhere inside it

Shift+F1:

To open your browser with documentation for the element at the editor's caret, press Shift+F1 (View | External Documentation).

You must have the path to your browser set in the File | Settings | Web Browsers options and paths to documentation files added to your project (File | Project Structure...) to use this feature

Ctrl+Shift+空格:String s = ( :会强转换为String类型。

Ctrl+D:复制当前行。

Ctrl+Tab;切换窗口界面

Ctrl+D:自动生成实例名。 可以在文件设置代码风格中为局部变量、参数、实例和静态字段定制名称前缀。

Ctrl+P:如果光标位于方法调用的括号之间,按Ctrl+P就会显示出有效参数的列表。

Ctrl+Shift+Backspace(浏览最后一个编辑位置)会把你带回到你修改代码的最后一个地方。

Ctrl+Shift+F7(在文件中编辑查找突出显示用法),以快速突出当前文件中某些变量的用法。

使用代码重新格式化代码,根据您的代码风格首选项(文件设置代码风格)重新格式化代码。

Alt+Q: 显示上下文所有该声明。(查看上下文信息)查看当前方法的声明,而不需要滚动到它。

Ctrl+E(查看最近打开过的文件)会带来最近访问过的文件的弹出列表。选择所需的文件并按Enter键打开它。

F2/Shift+F2键在突出显示的语法错误之间跳转。

Ctrl + Alt +向上箭头/ Ctrl + Alt +向下箭头之间的快捷键跳编译错误信息或搜索操作的结果。

Ctrl+J:代码补全及提示。

Ctrl +空格:当使用基本代码完成(Ctrl +空格),输入任何字符存在一个标识符。

使用Alt +向上箭头和Alt +向下箭头键之间快速移动方法在编辑器中。

Ctrl+Shift+J快捷键将两行连接到一个,并删除不必要的空间来匹配你的代码风格。

使用Ctrl+Shift+V快捷方式选择并将剪贴板内容插入到文本中。

Ctrl+H要查看选定类的继承层次结构,请按Ctrl+H(导航类型层次结构)。您还可以从编辑器中调用层次视图,查看当前编辑过的类的层次结构。

诸如Ctrl+Q(查看快速文档)、Ctrl+P(视图参数信息)、Ctrl+B(导航声明)等快捷方式不仅可以在编辑器中使用,还可以在代码完成弹出列表中使用。

先整理到这里,后面补充啦^-^


猜你喜欢

转载自blog.csdn.net/ademoa/article/details/79866915