• Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

IntelliJ IDEA tutorial

In this section we officially start using IntelliJ IDEA. This section provides an overview of some of the important features of IntelliJ IDEA, along with tips, top shortcuts, and helpful tips on how to improve your productivity with IntelliJ IDEA.

User interface for IntelliJ IDEA

The editor of IntelliJ IDEA is special in a number of ways, most notably that you can call in any IDE feature without leaving, so you can organize a layout with more screen real estate because auxiliary controls (such as toolbars and Windows) are hidden.

Accessing the tool window via a shortcut moves the input focus above it, so you can use all keyboard commands in its context. When you need to go back to editing, hit the Escape key. Here is a list of shortcuts to call the tool window you most often need:

When you want to focus on code, try using free mode. It will remove all toolbars, tool Windows, and editor tabs. To switch to the mode, please select view | into free on the main menu mode.

Another free mode might be to hide all the tool Windows by pressing Ctrl+Shift+F12. You can restore the default layout by pressing this shortcut again.

The navigation bar is a neat alternative to the project tools window. To access the navigation, press Alt + Home.

Most of the components in IntelliJ IDEA (tool Windows and pop-ups) provide a quick search capability. This feature allows you to filter lists or navigate to specific items using a search query.

Tip: When you don’t know the shortcut to an action, press Ctrl + Shift + A to use the “Find Action” function. Start a lookup operation by typing its name, viewing its shortcut, or calling it.

 

Editor Basics

Because in IntelliJ IDEA, you can undo refactoring and restore changes to your local history, it makes no sense to ask you to save your changes every time.

The most useful editor shortcuts are:

To expand the syntax-based selection, press Ctrl + W; To shrink it, press Ctrl + Shift + W.

IntelliJ IDEA can select multiple codes at once. You can select/deselect any code by Alt + J, or by clicking on the code to select and pressing Shift + Alt + J.

 

Code completion

When you access Basic Completion by pressing Ctrl + Space, you’ll get Basic suggestions on variables, types, methods, expressions, and more. When you call Basic Completion twice, it displays more results, including private and non-imported static members.

Smart Completion understands the expected types and data flows and provides context-specific options. To invoke Smart Completion, press Ctrl + Shift + Space. When you call Smart Completion twice, it displays more results, including the chain.

Note: To overwrite the identifier at the caret instead of just inserting suggestions, press Tab. This is useful if you are editing part of the identifier, such as the filename.

To have IntelliJ IDEA complete the declaration for you, press N/A. When the declaration is complete, missing parentheses, parentheses, braces, and necessary formatting are automatically added.

To view the suggested arguments for any method or constructor, press Ctrl + P. IntelliJ IDEA displays parameter information for each overloaded method or constructor, highlighting the best match of entered parameters.

The Postfix Completion function allows you to convert a typed expression to another based on the suffix typed after the dot.