Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the IntelliJ IDEA 2019 shortcut keys

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about what IntelliJ IDEA 2019 shortcuts have. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Fori/sout/psvm+Tab is commonly used to generate boilerplate boilerplate code such as loops, System.out, main methods, etc.

For example, to enter for (User user: users), just enter user.for+Tab

For example, to enter Date birthday = user.getBirthday (), simply type user.getBirthday () .var+Tab.

After the code label is entered, press Tab to generate the code.

Ctrl+Alt+O optimizes imported classes and packages

Alt+Insert generates code (such as get,set methods, constructors, etc.) or right-click (Generate)

Fori/sout/psvm + Tab

Ctrl+Alt+T generates try catch or Alt+enter

CTRL+ALT+T puts the selected code in TRY {} IF {} ELSE {}

Ctrl + O rewriting method

Ctrl + I implementation method

Ctr+shift+U case conversion

Enter the import package of ALT+ and correct it automatically.

ALT+/ code hint

CTRL+J automatic code

Ctrl+Shift+J, integrating two behaviors on one line

CTRL+ space code hint

CTRL+SHIFT+SPACE automatic completion code

CTRL+ALT+L format code

CTRL+ALT+I automatic indentation

CTRL+ALT+O optimizes imported classes and packages

ALT+INSERT generates code (such as GET,SET methods, constructors, etc.)

Code recently changed by CTRL+E

CTRL+ALT+SPACE class name or interface name prompt

CTRL+P method parameter hint

CTRL+Q, you can see the declaration of the current method

Shift+F6 refactoring-renaming (packages, classes, methods, variables, even comments, etc.)

Ctrl+Alt+V extract variables

The query shortcut Ctrl+Shift+Backspace can jump to the last edited place.

Where the CTRL+ALT+ left/right navigation has been edited

The ALT+7 left window displays the structure of the current file

Ctrl+F12 floating displays the structure of the current file

ALT+F7 finds all the references to your function or variable or class

CTRL+ALT+F7 finds all the references to your function or variable or class

Ctrl+Shift+Alt+N finds methods or variables in a class

Double-click SHIFT to find files in all directories of the project

Ctrl+N lookup class

Ctrl+Shift+N lookup file

CTRL+G positioning line

CTRL+F looks for text in the current window

CTRL+SHIFT+F looks for text in the specified window

CTRL+R replaces text in the current window

CTRL+SHIFT+R replaces text in the specified window

ALT+SHIFT+C finds modified files

Recently opened files by CTRL+E

F3 look down for the location of the keyword

SHIFT+F3 up to the location of the keyword

Select the text, press Alt+F3 to highlight the same text, and F3 look down for the same text one by one

F4 find the source of the variable

CTRL+SHIFT+O pops up to show what to find

Ctrl+W selects the code and pressing continuously will have other effects.

F2 or Shift+F2 highlight error or warning quick positioning

The Ctrl+Up/Down cursor jumps under the first or last line

Ctrl+B quickly opens a class or method at the cursor

CTRL+ALT+B finds all the subclasses

CTRL+SHIFT+B finds the class of the variable

Ctrl+Shift+ arrow keys move code up and down

Ctrl+Alt+ left/right returns to the location where it was last browsed

Ctrl+X delete a row

Ctrl+D copy Lin

Ctrl+/ or Ctrl+Shift+/ comments (/ or /... /)

Ctrl+H displays the class structure diagram

Ctrl+Q displays comment documents

Alt+F1 finds the location of the code

Alt+1 quickly opens or hides the project panel

Alt+ left/right toggles code view

ALT+ ↑ / ↓ quickly moves and locates between methods

Where the CTRL+ALT+ left/right navigation has been edited

Ctrl+Shift+Backspace can jump to the last edited place

Alt+6 finds TODO

Other shortcut keys SHIFT+ENTER start a new line

CTRL+Z retrogression (undo)

CTRL+SHIFT+Z forward (cancel undo)

CTRL+ALT+F12 Explorer opens a folder

ALT+F1 finds the location of the directory where the file is located

SHIFT+ALT+INSERT vertical editing mode

CTRL+F4 closes the current window

Ctrl+Alt+V, you can introduce variables. For example: new String (); automatically import variable definitions

Ctrl+~, fast switching scheme (interface appearance, code style, shortcut key mapping, etc. Menu)

In fact, the most common debugging shortcut is F8 F7 F9, which is worth mentioning that Drop Frame allows running code to start all over again.

Check the view value when alt+F8 debug

Alt+Shift+F9, select Debug

Alt+Shift+F10, select Run

Ctrl+Shift+F9, compiling

Ctrl+Shift+F8, view breakpoints

F7, step into

Shift+F7, intelligent step in

Alt+Shift+F7, forced to enter

F8, step over.

Shift+F8, step out

Alt+Shift+F8, force the step

Alt+F9, run to the cursor

Ctrl+Alt+F9, force to run to the cursor

F9, recovery program

Alt+F10, navigate to the breakpoint

Refactoring Ctrl+Alt+Shift+T, pop-up refactoring menu

Shift+F6, renaming

F6, move

F5, copy

Alt+Delete, secure deletion

Ctrl+Alt+N, inline

Among the top ten Intellij IDEA shortcuts, Intellij IDEA, there are many keyboard shortcuts that people can't put down, and there are some interesting discussions on stackoverflow. Everyone has their own favorites, and it's hard to come up with an ideal list.

I have also sorted out the shortcut keys of Intellij before, and this time I will simply classify and list my top ten favorite shortcut-god-keys according to the frequency of my daily development.

1 Smart Tip

Of course, Intelligence intelligence bears the brunt of Intellij! The basic code hint is Ctrl+Space, and you can more intelligently prompt Ctrl+Shift+Space by type information, but because Intellij always prompts automatically as we click, most of the time you don't manually type these two shortcuts (unless the prompt box disappears).

Using F2 / Shift+F2 to move to the wrong code, Alt+Enter quickly fixes (that is, the Quick Fix function in Eclipse). When the smart prompt automatically completes the method name for us, we usually have to fill in the anti-parentheses and semicolons at the end of the line by ourselves. when the parentheses are nested in many layers, it will be very troublesome, then we can automatically complete the characters at the end by typing Ctrl+Shift+Enter. And not only parentheses, for example, after typing if/for, you can also automatically fill in {} curly braces.

Finally, Intellij can intelligently perceive the configuration files and classes of mainstream frameworks such as Spring and Hibernate to statically brake and intelligently scan and understand how your project is constructed and configured under the seemingly "static" appearance.

2 reconstruction

Intellij refactoring is another feature of Eclipse, which is amazingly intelligent, such as automatically checking all matches when extracting variables and extracting them into one variable at the same time. Especially after watching "refactoring-improving existing code design", the cooperation of Intellij is simply exhilarating! It is the powerful intelligence and refactoring capabilities that make the development of TDD under Intellij very smooth.

To get to the point, let's first talk about an invincible refactoring function big summary shortcut Ctrl+Shift+Alt+T, called Refactor This. Press a little complicated, but also in line with the style of Intellij, many keyboard shortcuts have to be done with both hands, unlike many of the most useful keyboard shortcuts of Eclipse can be done with one hand chic (I do not know whether it is a major advantage of Eclipse), but you will feel nothing if you have used Emacs (non-Emacs black).

In addition, there are some of the most commonly used refactoring techniques, because they are so common that it is a bit inefficient to choose from the Refactor This menu every time. For example, Shift+F6 is simply to rename, and Ctrl+Alt+V is to extract variables. Follow the official Wechat account of Java technology stack and reply the keyword "IDEA" in the background to get a copy of the latest IDEA technology information.

3 code generation

This is similar to Eclipse, although not unique, but because of the high frequency of daily use, it is still listed at the top of the list. Fori/sout/psvm+Tab is commonly used to generate boilerplate boilerplate code such as loops, System.out, main methods, and all templates can be viewed with Ctrl+J.

Alt+Insert will be mentioned later in the "Auxiliary" section. Click in the edit window to generate constructors, toString, getter/setter, override parent methods, and so on. These two techniques are so commonly used that they generate a bunch of main, System.out, and getter/setter almost every day.

In addition, Intellij IDEA 13 adds suffix automatic completion (Postfix Completion), which is more flexible and powerful than template generation. For example, to enter for (User user: users), you only need to enter user.for+Tab. For example, to type Date birthday = user.getBirthday (); just type user.getBirthday (). Var+Tab.

4 Editing

One of the great keys that have to be said in the editor is the Ctrl+W that can automatically select the code according to the syntax and the reverse Ctrl+Shift+W. In addition, Ctrl+Left/Right moves the cursor to the preceding / trailing word, Ctrl+ [/] to the antecedent / descendant code block, and these Vim-like cursor movements are also a highlight. If you add Shift to the above Ctrl+Left/Right/ [], you can select the code within the jump range. Alt+Forward/Backward moves to the front / back method. There are also some very common lines like Ctrl+Y delete lines, Ctrl+D copy lines, and Ctrl+ folding code, not to mention.

A little bit more about cursor movement, in addition to the functions already provided by Intellij itself, we can also install ideaVim or emacsIDEAs to enjoy the fast movement of Vim and the AceJump function of Emacs (awesome!) .

In addition, the bookmark function of Intellij is also good, define 1-10 bookmarks with Ctrl+Shift+Num (press this set of keyboard shortcuts again to delete bookmarks), and then jump through Ctrl+Num. This avoids the hassle of using the previous / next editing position Ctrl+Left/Right to jump back and forth many times, and this shortcut key conflicts with the Windows hotkey by default (there is more Alt by default, which conflicts with Windows changing the display direction, and accidentally the display becomes explicit upside down, ah).

5 find and open

Ctrl+N/Ctrl+Shift+N like Eclipse,Intellij can open classes or resources, but Intellij is smarter, and any character we enter will be treated as a fuzzy match, saving the trouble of typing * in Eclipse. The latest version of IDEA also includes a Search Everywhere feature that allows you to search for anything in a pop-up box, including classes, resources, configuration items, methods, and so on, simply by pressing Shift+Shift.

The inheritance relationship of the class can be opened with Ctrl+H, and the jump on the inheritance level can be implemented with Ctrl+B/Ctrl+Alt+B corresponding to the parent class or parent method definition and subclass or submethod, respectively, to see all the methods of the current class using Ctrl+F12.

It's also easy to find the use of a class or method, Alt+F7. To find the location of the text, use Ctrl+F/Ctrl+Shift+F to find it in the current window or the whole project, and then move to the next match before and after F3/Shift+F3.

Another proof that Intellij is smarter is that you can type in the words you are looking for directly in any menu or display window, and Intellij will automatically filter for you. Follow the official Wechat account of Java technology stack and reply the keyword "IDEA" in the background to get a copy of the latest IDEA technology information.

6 other aids

With these magic keys and some auxiliary shortcuts, you can get your hands off the mouse more than 90% of the time, and focus on the keyboard as if you were performing on the piano. These humble but crucial last pieces of the puzzle are:

Command: Ctrl+Shift+A can find all Intellij commands, and each command is followed by its shortcut key. So it is not only a magic key, but also a tool to find and learn shortcuts.

New: Alt+Insert can create classes, methods, and so on.

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

Dialog switch window: Alt+Num, commonly used are 1-project structure, 3-search results, 4 hand 5-run debugging. Ctrl+Tab toggles tabs, and Ctrl+E/Ctrl+Shift+E opens a recently opened or edited file.

Unit test: Ctrl+Alt+T creates a unit test case.

Run: Alt+Shift+F10 runs the program, Shift+F9 starts debugging, Ctrl+F2 stops.

Debugging: F7/F8/F9 corresponds to Step into,Step over,Continue respectively.

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

^ Top # 10 cut back and forth: Ctrl+Tab

^ Top # 9 choose what you want: Ctrl+W

* Top # 8 code generation: Template/Postfix + Tab

Res. Top # 7 call the shots: Ctrl+Shift+A

^ Top # 6 nowhere to hide: Shift+Shift

^ Top # 5 automatic completion: Ctrl+Shift+Enter

@ Top # 4 create everything: Alt+Insert

It's too hard to give up, let's tie for the top three! Autonomous Top # 1 Intelligence completion: Ctrl+Shift+Space

@ Top # 1 self-repair: Alt+Enter

* Top # 1 refactoring everything: Ctrl+Shift+Alt+T

Where the CTRL+ALT+ left/right navigation has been edited, Ctrl+Shift+Backspace can jump to the place where it was last edited.

Thank you for reading! This is the end of this article on "what are the shortcuts for IntelliJ IDEA 2019?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report