Fork me on GitHub

Idea shortcuts

IntelliJ IDEA has keyboard shortcuts for most of its commands related to editing, navigation, refactoring, debugging, and pretty much everything else we might want to do regularly. Learning and practicing these shortcuts so they get loaded into our muscle memory can help us to stay in the state of flow.

Alt + Enter

This keyboard shortcut can be used to fix just about anything by showing us actions for the current context.

F2

 To jump to next error

Alt+1

 Alt+1 (Windows/Linux) opens or closes the project window and puts the focus in there

Esc

 

To put the focus back on the editor, press escape.  Whatever tool window is open, this will put you back in the editor so you can carrying on working with the code. 

Ctrl+E

We can view the most recently opened file using  Ctrl+E (Windows/Linux).  

Ctrl+B

 With Ctrl+B (Windows/Linux) we can go to declaration of a symbol.

Alt+F7

 Alt+F7 will show us all the places something is used.

Ctrl Ctrl

No matter where we are in the IDE or which file is open, if we double tap Ctrl the Run Anything window opens.  By default, this shows a list of recently run configurations.

 Ctrl + W / Shift + Ctrl + W

We can select increasing or decreasing sections of code near the cursor with Ctrl+W or Ctrl+Shift+W.

 Shift+Ctrl+Enter

 If you press it while you’re writing a “for” loop, IntelliJ IDEA will add the curly braces and place your cursor inside the block.  In an “if” statement, it can add the parentheses [pəˈrenθəsɪs] 小括号 and curly braces 花括号and again place your cursor in the correct spot.

Ctrl+Alt+L

We can easily format the current file to the project’s standards using Ctrl+Alt+L. 

Shift+Ctrl+Alt+T

 When we press this shortcut on a symbol or selection we are shown the refactoring options available.

Shift+Ctrl+A

 Use Shift+Ctrl+A to search for any action in IntelliJ IDEA. Find action will let us search for actions of course, but also settings so we can change settings directly from here.  We can also search for and open tool windows.

Shift shift

Double pressing the shift key opens a search box that lets us look for anything

 

IntelliJ IDEA includes several predefined keymaps and lets you customize frequently used shortcuts.

To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap.

 

To view the keymap reference as PDF, select Help | Keyboard Shortcuts PDF from the main menu.

 IntelliJ IDEA automatically suggests a predefined keymap based on your environment. Make sure that it matches the OS you are using or select the one that matches shortcuts from another IDE or editor you are used to (for example, Eclipse or NetBeans).

A keymap is a list of actions with corresponding keyboard and mouse shortcuts and abbreviations. You cannot change predefined keymaps. Instead, when you modify any shortcut of a predefined keymap, IntelliJ IDEA creates a copy of that keymap, which you can configure. Click The Show Scheme Actions icon to duplicate the selected keymap, rename, remove, or restore it to default values. For information about keymap files, see Location of user-defined keymaps.

 

Some actions inherit their keyboard shortcuts or mouse shortcuts from other actions. On the Keymap page, you can navigate to the parent action using the inherited from link. When you change a shortcut of a parent action, all shortcuts of its child actions change accordingly. When you change a shortcut of a child action, it does not affect the shortcuts of its parent action, but the inheritance link is removed making both actions independent.

 

posted @ 2022-02-09 11:53  z_s_s  阅读(82)  评论(0)    收藏  举报