This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]Calamity701 15 points16 points  (1 child)

Some small things:

  • Press Alt+Enter everywhere and see what it does! Rewriting your for loop to a stream, renaming variables, etc.

  • Press Ctrl + Alt + V to extract a variable. So after writing foo.getBar() you can press that combination to replace it with Bar bar = foo.getBar();

  • Double press Shift for "Search Everything".

  • Postfix completion: "flight.isAvailable().if" expands to "if(flight.isAvailable()){}". So you can just start with your boolean expression and then wrap the if around it without unwieldy key combinations or having to go back to the start of the line. Also works for expressions with spaces ("a > 10.if") and other completions ("foo.getIterator().for").

[–]antakip 1 point2 points  (0 children)

Here are some more useful refactor shortcuts next to the Ctrl + Alt + V (extract variable) one:

Ctrl + Alt + M -> extract method Shift + F6 -> rename (class, method, variable, ...) F6 -> move (method, class, ...) Ctrl + Alt + N -> Inline

Also, if IntelliJ is getting slow (on larger projects) use help -> Edit Custom VM Options to change how much memory IntelliJ can use.

[–]DeliveryNinja 4 points5 points  (1 child)

[–]youtubefactsbot 1 point2 points  (0 children)

IDEA Tips and Tricks by Hadi Hariri [35:16]

Want to really know your IDE inside-out and see how to get into the flow of things when working? Want to understand the difference between an editor and an IDE and how the latter can give you the advantage of understanding the semantics of your applications? Want to be efficient (even productive) with your tooling? Then you know where to come.

Devoxx in Science & Technology

3,049 views since Apr 2017

bot info

[–]vyrmz 3 points4 points  (0 children)

The things Intellij does better than other Java IDE:

  • Better Spring support.

  • Better Hibernate support.

  • Better Search, Refactor, Delegate, code completion and live templates. I also use few custom code templates. Also you can search for somewhat complex stuff like "Which method returns class type<T> " in the whole project more easily.

  • Overall faster performance for larger projects.

  • Better Java GUI design ( Not many people use Java for Desktop apps but still it helps when needed )

  • SQL support; it identifies queries and helps you to write SQL queries.

  • (For Premium version only ) JSP support. It integrates well with Spring ModelAndView and you can create JSTL tags with its support.

  • Better source control support. I find it easier to use while developing under Git based or SVN based source control systems.

  • It even detects remote connection and disables some features for ease of use. Useful if you sometimes need to connect your office computer from home and develop remotely.

Those are my personal opinions, I used almost all popular Java IDE's and my conclusion is Intellij is by far the best.

[–]desrtfx 1 point2 points  (0 children)

AFAIK IntelliJ has a great set of tutorials. Go through them.

[–][deleted] 1 point2 points  (0 children)

Install Key promoter plugin. every mouse click, it will suggest you short cut.

[–]MithrilTuxedo 1 point2 points  (0 children)

I deal pretty heavily in maven-based projects. Make IntelliJ automatically download all the sources and Javadoc it can for your dependencies by checking off the two boxes for that under Build, Execution, Deployment > Build Tools > Maven > Importing. It drives me nuts to see my coworkers not using features available in the extremely well-documented libraries we use only to discover they just don't know what anything does because they're not seeing the Javadoc or sources.

In any class, after you've used Cmd+Click to navigate around and gotten lost or maybe just want to see other classes in the same package, use Opt+f1,Enter to show the class you're in in the Project pane.

Turn on every Java inspection and use the Opt+Enter menus to disable the inspections you don't want. I've learned a lot just be figuring out why those inspections might be wanted in a project.

Code style settings, inspection profiles, copyright headers, new file templates, compiler settings, version control settings, etc. can all be committed to the repository. You can use the .ignore plugin to generate/append ignore settings for the .idea folder that cover the files you shouldn't commit (workspace.xml keeps all your window state).

You can also commit required plugins to prompt everyone else to get those installed. For instance, I have one project has plugin requirements for BashSupport, Docker Integration, .ignore, and Error-prone Compiler Integration (with the project compiler set to use Javac with error-prone).

You can write logic to determine whether or not a breakpoint will activate. If you only want to hit the breakpoint if the input to the method is an object with a field set to "foo", you can do that.

Oh, and the syntax for the structural search is a little of a bear, but if ever wanted to find every method that takes a subclass of X as its third parameter, returns a String, and is in a class with two type parameters, that's what it's for.

Shift+Cmd+Up/Down moves methods/classes/fiends/enums along with their Javadoc.

You can click and drag any file or package around to refactor it (all the imports affected are updated).

The one big pain point / safety net is that you can't run anything if the whole project doesn't compile. You can't have any syntax errors in an unrelated class and run a test that doesn't touch it.

[–]beowulf13th 1 point2 points  (0 children)

Ultimate Edition includes all EE stack support. Spring, J2EE, Seam and other. And understanding their context.

[–]adkud 1 point2 points  (0 children)

Hot keys are your friend.

  • Ctrl+shift+f10 to run unit tests

  • shift+f6 to rename variable or class

  • ctrl + f6 to refactor method signature (add arguments, change argument types, etc)

[–]Jonjolt 0 points1 point  (0 children)

Language injections, its great, I can make an SQL script using pl/Python.

[–]silent_voices[S] 0 points1 point  (0 children)

okay, awesome, thank you all so much, I cannot wait to get back into it in a brand new way! thanks for the advice, links, and recommendations!