Java 隐藏功能 IntelliJ IDEA

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2524025/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 08:48:57  来源:igfitidea点击:

Hidden Features IntelliJ IDEA

javaideintellij-idea

提问by Teja Kantamneni

Just another Hidden features and tips and tricks WIKI.

只是另一个隐藏的功能和提示和技巧WIKI

After seeing the hidden features of eclipse, java, spring framework I thought we need to have a list of the features, TIPS for IntelliJ too which is the best and the Intelligent IDE available for java.

在看到 eclipse、java、spring 框架的隐藏功能后,我认为我们需要一个功能列表,IntelliJ 的 TIPS 也是最好的,以及适用于 java 的智能 IDE。

采纳答案by Noel Ang

I love syntax-aware selection. Control + W.

我喜欢语法感知选择。控制 + W。

When I'm forced to work with other IDEs, that key sequence usually causes files to close. It's a nasty negative feedback loop.

当我被迫使用其他 IDE 时,该键序列通常会导致文件关闭。这是一个令人讨厌的负反馈循环。

回答by Iraklis

Help -> Productivity Guide: See all the fun you've been missing out.

Help -> Productivity Guide: 看看你错过的所有乐趣。

回答by mickthompson

What about starting with the Intellij version of the most voted response on the Hidden features of Eclipsepost? =)

Eclipse帖子的隐藏功能上投票最多的 Intellij 版本开始怎么样?=)

Don't forget Ctrl+Shift+A, which displays a list of all the keyboard shortcut combinations (just in case you forget any of those listed here).

不要忘记 Ctrl+Shift+ A,它会显示所有键盘快捷键组合的列表(以防万一您忘记了此处列出的任何组合)。

also:

还:

I also suggest to print out the official: Intellij IDEA 9 Default Keymap: WINDOWS-LINUX, OS X, OS X 10.5+

我也建议打印出官方:Intellij IDEA 9 Default Keymap: WINDOWS-LINUX, OS X, OS X 10.5+

回答by Ravi Wallau

Shift Control Space

换档控制空间

I love Shift + Control + Spacefor code completion, it is not a secret thought. You can use it everywhere - in a Spring configuration file, at the right side of an attribution, to complete a method call, to pass a parameter.

我喜欢用Shift + Control + Space来完成代码,这不是什么秘密想法。你可以在任何地方使用它——在 Spring 配置文件中,在属性的右侧,完成一个方法调用,传递一个参数。

The nice thing about it is that if you have a parameter of type "X" inside an object "y", when you press Shift + Control + Space twice, it will actually display "y.X" as one of the possible options. I guess I could classify that as a secret :-).

它的好处是,如果您在对象“y”中有一个“X”类型的参数,当您按 Shift + Control + Space两次时,它实际上会显示“yX”作为可能的选项之一。我想我可以将其归类为秘密:-)。

Other shortcuts that I use often are Shift + Insert to generate code (such as equals and hashcode, or a constructor to initialize my final variables), Ctrl + I and Ctrl + O to implement/ override methods, Alt + Enter to fix a compilation error/ warning (a code inspection suggestion).

我经常使用的其他快捷方式是 Shift + Insert 生成代码(例如 equals 和 hashcode,或构造函数来初始化我的最终变量)、Ctrl + I 和 Ctrl + O 实现/覆盖方法、Alt + Enter 修复编译错误/警告(代码检查建议)。

回答by Paul McKenzie

the iteration based live templates seem to save more typing than any other feature, my own templates which I use frequently:

基于迭代的实时模板似乎比任何其他功能都节省了更多的输入,我自己经常使用的模板:

private final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger($CLASS_NAME$.class);

(add optional statickeyword after privateaccording to taste) where the variable CLASS_NAME is defined to have the expression className()and check "Skip if defined", together with

根据口味static后面添加可选关键字)其中变量 CLASS_NAME 被定义为具有表达式并检查“如果已定义则跳过”,以及privateclassName()

logger.debug("$END$");

回答by retronym

Closure Foldingmakes Java programming slightly more tolerable after writing Scala.

Closure Folding使 Java 编程在编写 Scala 后稍微更容易被接受。

回答by rhys keepence

The one I very frequently see under utilised is Crtl-Alt-F7(??-F7 in OS X), which is show usages. Much faster than "find usages". Both are indispensable for understanding code and how it is used.

我经常看到未充分利用的是Crtl-Alt-F7(OS X 中的??-F7),即show usages。比“查找用法”快得多。两者对于理解代码及其使用方式都是必不可少的。

Another one hidden away is column mode, which allows you to highlight and even replace code vertically. The shortcut for this is Ctrl-Shift-Insert(??* in OS X).

另一个隐藏的是column mode,它允许您突出显示甚至垂直替换代码。这个的快捷方式是Ctrl-Shift-Insert(??* 在 OS X 中)。

回答by Jon Onstott

Shift-F7(Smart Step Into) is a useful debugging feature that I haven't seen with other IDE's. I also like CTRL-Jto pull up Live Templates, and (unrelated) CTRL-SHIFT-Jto merge the next line with this one.

Shift-F7(Smart Step Into) 是一个有用的调试功能,我在其他 IDE 中没有见过。我也喜欢CTRL-J拉出实时模板,并且(不相关)CTRL-SHIFT-J将下一行与这一行合并。

Update

更新

Got a few more:

还有几个:

  • Ctrl-Alt-F7to show usages in a pop-up list
  • Call Hierarchy is like a more through "find usages" and shows a tree that traces method calls leading to the current code
  • Ctrl-Alt-F7在弹出列表中显示用法
  • 调用层次结构更像是“查找用法”,并显示一个跟踪导致当前代码的方法调用的树

I've got a few extra mouse buttons, so I have bound each of these to the buttons for fast access.

我有一些额外的鼠标按钮,所以我将每个按钮都绑定到按钮上以便快速访问。

回答by ?zbek

From persistence tool Window you can see the diagram of your database structure by clicking Open ER Diagramvery useful tool

在持久化工具窗口中,您可以通过单击Open ER Diagram非常有用的工具来查看您的数据库结构图

回答by DonX

CTRL+ALT+V - For variable extraction

CTRL+ALT+M - For method extraction

I use the above shortcuts very frequently.

我经常使用上述快捷方式。