我听说有人选择了其中一种方式,并对其中一种方式发誓。

作为一个Eclipse的忠实粉丝,但没有时间尝试IntelliJ,我很有兴趣从“前Eclipse用户”IntelliJ用户那里听到一些用IntelliJ可以做而用Eclipse不能做的具体事情。

注意:这不是一个主观的问题,也不意味着变成一场IDE圣战。请为任何煽动性的答案投票。


当前回答

我在IntelliJ中最喜欢的快捷方式是“转到符号”,这在Eclipse中是没有对应的(我发现的)。CTRL-ALT-SHIFT-N让你开始输入和glob类,方法名,变量名等,从整个项目。

其他回答

其他一些事情:

propagate parameters/exceptions when changing method signature, very handy for updating methods deep inside the call stack SQL code validation in the strings passed as arguments to jdbc calls (and the whole newly bundled language injection stuff) implemented in/overwritten in icons for interfaces & classes (and their methods) and the smart implementation navigation (Ctrl+Alt+Click or Ctrl+Alt+B) linking between the EJB 2.1 interfaces and bean classes (including refactoring support); old one, but still immensely valuable when working on older projects

如果你把光标放在一个方法上,然后按CTRL+SHIFT+I将弹出方法实现。如果方法是一个接口方法,那么你可以使用上下箭头来循环实现:

Map<String, Integer> m = ...
m.contains|Key("Wibble");

|的位置(例如)您的光标所在的位置。

我经常使用的一件事是设置断点,然后控制它的功能。(在我的上一份工作中,大多数人都使用Eclipse……我记得我很惊讶,没有人能在Eclipse中找到如何做到这一点。)

例如,可以让断点实际上不停止,而只是将消息记录到控制台。这意味着,我不必用“System.out.println(…)”乱写代码,然后重新编译。

有很多事情是idea用更简单的方法解决的,或者没有等价的方法:

Autocomplete actions: Doing ctrl+shift+a you can call any idea action from the keyboard without remembering its key combination... Think about gnome-do or launchy in windows, and you've got the idea! Also, this feature supports CamelCasing abbreviations ;) Shelf: Lets you keep easily some pieces of code apart, and then review them through the diff viewer. Local history: It's far better managed, and simpler. SVN annotations and history: simpler to inspect, and also you can easily see the history only for such a part of a whole source file. Autocomplete everywhere, such as the evaluate expression and breakpoint condition windows. Maven integration... much, much simpler, and well integrated. Refactors much closer to the hand, such as loops insertion, wrapping/casting, renaming, and add variables. Find much powerful and well organized. Even in big projects Much stable to work with several branches of a big project at the same time (as a former bugfixer of 1.5Gb by branch sources, and the need to working in them simultaneously, idea shown its rock-solid capabilities) Cleaner and simpler interface... And, simpler to use only with the keyboard, letting apart the need of using the mouse for lots of simple taks, saving you time and giving you more focus on the code... where it matters!

现在,作为开源的…Idea的用户群将呈指数级增长。

引入变量。(Windows下按Ctrl+Alt+V, OSX下按Cmd+Alt+V)

假设调用service。listallpersons()方法 按Ctrl+Alt+V并回车,方法调用的返回值的变量被插入:

List<Person> list = service.listAllPersons();

节省输入,并且不必检查所调用方法的返回类型。在使用泛型时尤其有用,例如:

new ArrayList<String>()

(引入变量)

ArrayList<String> stringArrayList = new ArrayList<String>();

(当然,你可以在按Enter键之前轻松更改变量的名称)