Intellij IDEA common shortcut keys

Common shortcut keys

Ø Top #10 Cut to and fro: Ctrl+Tab

Ø Top #9 Choose what you want: Ctrl+W

Ø Top #8 Code generation: Template/Postfix +Tab

Ø Top #7 Give orders: Ctrl+Shift+A

Ø Top #6 Nowhere to hide: Shift+Shift

Ø Top #5 Autocomplete: Ctrl+Shift+Enter

Ø Top #4 Create everything: Alt+Insert

Ø Top #1 Smart completion: Ctrl+Shift+Space

Ø Top #1 Self-repair: Alt+Enter

Ø Top #1 Refactor everything: Ctrl+Shift+Alt+T


IDEA 14 15 Common shortcut key operations 
 
1. Open the call chain 
Alt+F6 
Ctrl + Alt + H 
Ctrl + H Inheritance 
 
2. Implement the interface Class method 
Ctrl + I 
 
3. Quickly enter the implementation class 
Ctrl + alt + B
Ctrl + shift + B 
Quickly enter the parent class 
Ctrl + U 

4. Format 
Ctrl + Alt + L 
 
5. Quickly generate get set 
Alt + Insert 
 
6. syso 
sout + Tab 
 
7. Debug 
the next line F8  
Step into F7  and
jump out of F9 
 
8. Compile 
and compile the current class ctrl + shift + F9 
Compile all classes ctrl + F9 
 
9. Maximize the window 
shift + esc 
ctrl + f12 
 
10. Automatic return value 
ctrl + alr + v 
 
11. Comment indent 
tab
 
12. 
CTRL+SHIFT+F7 Highlight multiple keywords 
 
13. Refactor 
shift + f6 
 
14. Find class 
Ctrl + N 
 
15. Find method 
Ctrl + Shift + Alt + N 
 
16. Open the recent class 
Ctrl + E 

17. Navigate forward and backward of the operation record
Ctrl+Alt+Left/Right (←/→)

18. Continue searching
F3 Forward
Shift + F3 Backward

19. Maximize the window
Ctrl + Shift + F12

1 Smart tips

Intellij's first and foremost is, of course, Intelligence! The basic code prompts use Ctrl+Space, and there are more intelligent prompts for Ctrl+Shift+Space by type information, but because Intellij always prompts automatically as we type, we often do not manually type these two shortcuts key (unless the tooltip disappears). Use F2/Shift+F2 to move to the code with errors, Alt+Enter quick fix (ie Quick Fix function in Eclipse). When the intelligent prompt automatically completes the method name for us, we usually have to fill in the back brackets and semicolons at the end of the line by ourselves. It will be troublesome when the brackets are nested many layers, then we just need to press Ctrl+Shift+Enter to Autocomplete characters at the end. And not just parentheses, for example, {} curly braces can be automatically added after typing if/for.

Last but not least, Intellij can intelligently perceive the configuration files and classes of mainstream frameworks such as spring and hibernate, and act statically. Under the seemingly "static" appearance, Intellij can intelligently scan and understand how your project is constructed and configured.
2 Refactoring

Intellij refactoring is another feature of Eclipse, and its intelligence is astounding. For example, when extracting variables, it automatically checks all matches and extracts them into one variable. Especially after reading "Refactoring - Improving Existing Code Design", the cooperation of Intellij is simply addicting! It is also the powerful intelligence and refactoring functions that make TDD development under Intellij very smooth.

Cut to the topic, let's talk about an invincible refactoring function summary shortcut Ctrl+Shift+Alt+T, called Refactor This. The method is a bit complicated, but it also conforms to the style of Intellij. Many shortcut keys must be done with both hands, unlike many of the most useful shortcut keys in Eclipse, which can be done with one hand (I don’t know if it is a major advantage of Eclipse), But if you have used Emacs, you will feel that it is nothing (non-Emacs black). In addition, there are also some of the most commonly used refactoring techniques, because they are so commonly used, if they are selected in the Refactor This menu every time, the efficiency is somewhat inefficient. For example, Shift+F6 is directly to rename, and Ctrl+Alt+V is to extract variables.
3 Code generation

This is similar to Eclipse, although it is not unique, but because of the extremely high frequency of daily use, it is still listed at the top of the list. Commonly used are fori/sout/psvm+Tab to generate boilerplate boilerplate code such as loop, System.out, main method, etc. You can view all templates with Ctrl+J. In the "Auxiliary" section, we will talk about Alt+Insert. Clicking in the editing window can generate constructors, toString, getter/setter, override parent class methods, etc. These two tricks are so common that a bunch of main, System.out and getters/setters are generated almost every day.

In addition, Postfix Completion has been added to Intellij IDEA 13, which is more flexible and powerful than template generation. For example to type for(User user : users) just type user.for+Tab. For another example, to enter Date birthday = user.getBirthday(); just enter user.getBirthday().var+Tab.
4 Edit

One of the great keys that I have to say in editing is Ctrl+W and reverse Ctrl+Shift+W that can automatically select the code according to the grammar. In addition, Ctrl+Left/Right moves the cursor to the word before/after, and Ctrl+[/] moves to the code block before/after. These Vim-like cursor movements are also a highlight. The above Ctrl+Left/Right/[] plus Shift can select the code within the jump range. Alt+Forward/Backward moves to forward/backward methods. There are also some very common ones, such as Ctrl+Y to delete lines, Ctrl+D to copy lines, and Ctrl+</> to fold code.

A little more about cursor movement, in addition to the functions provided by Intellij itself, we can also install ideaVim or emacsIDEAs to enjoy the fast movement of Vim and the AceJump function of Emacs (super cool!). In addition, Intellij's bookmark function is also good, use Ctrl+Shift+Num to define 1-10 bookmarks (press this group of shortcut keys again to delete bookmarks), and then jump through Ctrl+Num. This avoids the trouble of jumping back and forth between using the previous/next editing position Ctrl+Left/Right multiple times, and this shortcut key conflicts with Windows hotkeys by default (the default is more Alt, which conflicts with Windows changing the display direction of the display, accidentally The display will become inverted and obvious, ah).
5 Find and open

Similar to Eclipse, Intellij's Ctrl+N/Ctrl+Shift+N can open classes or resources, but Intellij is more intelligent, any characters we enter will be regarded as fuzzy matches, eliminating the need to enter * in Eclipse trouble. The latest version of IDEA also added the Search Everywhere feature, just press Shift+Shift to search for anything in a pop-up box, including classes, resources, configuration items, methods, and more.

For the inheritance relationship of a class, you can use Ctrl+H to open the class hierarchy window, and to jump on the inheritance hierarchy, use Ctrl+B/Ctrl+Alt+B to correspond to the parent class or parent method definition and subclass or submethod implementation respectively, and view the current class. All methods use Ctrl+F12.

To find the use of a class or method is also very simple, Alt+F7. To find the occurrence position of the text, use Ctrl+F/Ctrl+Shift+F to search in the current window or the whole project, and then cooperate with F3/Shift+F3 to move forward and backward to the next matching place.

Another proof that Intellij is more intelligent is that in any menu or display window, you can directly enter the word you are looking for, and Intellij will automatically filter it for you.
6 Other Auxiliary The

above magic keys and some auxiliary shortcut keys can let your hands get rid of the mouse for more than 90% of the time, and focus on the keyboard as if you are performing a piano performance. These inconspicuous but crucial last pieces of the puzzle are:

Ø Command: Ctrl+Shift+A can find all Intellij commands, and there are shortcut keys behind each command. So it is not only a great god key, but also a tool for finding and learning shortcut keys.

Ø New: Alt+Insert can create a new class, method, etc. anything.

Ø Formatting code: Format import list Ctrl+Alt+O, format code Ctrl+Alt+L.

Ø Switch window: Alt+Num, commonly used are 1-project structure, 3-search results, 4/5-running and debugging. Ctrl+Tab switches tabs, Ctrl+E/Ctrl+Shift+E opens recently opened or edited files.

Ø Unit test: Ctrl+Alt+T to create a unit test case.

Ø Run: Alt+Shift+F10 to run the program, Shift+F9 to start debugging, Ctrl+F2 to stop.

Ø Debugging: F7/F8/F9 correspond to Step into, Step over, and Continue respectively.

In addition, there are some custom ones, such as the horizontal split screen Ctrl+|, etc., and some magical little functions Ctrl+Shift+V to paste the ones copied a long time ago, Alt+Shift+Insert to enter the column mode to select by column.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326089656&siteId=291194637