Author: Interesting soul Count me in source: http://uee.me/aXfNf

Automatic code

Common boilerplate code is fori/sout/ PSVM +Tab, which can generate loops, system. out, main methods, etc.

For example, to enter for(User User: users), just type user.for+Tab; For example, to enter Date birthday = user.getbirthday (), just type user.getbirthday ().var+Tab.

After entering the code label, press Tab to generate the code.

  • Ctrl+Alt+O optimize the imported classes and packages
  • Alt+Insert Generate code (get,set methods, constructors, etc.) or right-click Generate
  • fori/sout/psvm + Tab
  • Ctrl+Alt+T generates a try catch or Alt+ Enter
  • CTRL+ALT+T places the selected code in TRY{} IF{} ELSE{}
  • Ctrl + O override method
  • Ctrl + I implementation method
  • Ctr+ Shift +U Case conversion
  • ALT+ Enter import package, automatic correction
  • ALT+/ code prompt
  • CTRL+J automatic code
  • Ctrl+Shift+J to combine the two actions on one line
  • CTRL+ space code prompt
  • CTRL+SHIFT+SPACE auto-complete code
  • CTRL+ALT+L format the code
  • CTRL+ALT+I auto indent
  • CTRL+ALT+O optimize the imported classes and packages
  • ALT+INSERT generates code (e.g. GET,SET methods, constructors, etc.)
  • CTRL+E Recently changed code
  • CTRL+ALT+SPACE Indicates the class name or interface name
  • CTRL+P method parameter prompt
  • CTRL+Q to see the declaration of the current method
  • Shift+F6 Refactoring – rename (packages, classes, methods, variables, even comments, etc.)
  • Ctrl+Alt+V extract variables

Query shortcut Keys

  • Ctrl+Shift+Backspace jumps to the last edit
  • CTRL+ALT+ Left/Right to navigate to and from the edited location
  • ALT+7 displays the structure of the current file in the left window
  • Ctrl+F12 floats to display the structure of the current file
  • ALT+F7 finds all references to your function or variable or class
  • CTRL+ALT+F7 find all references to your function or variable or class
  • Ctrl+Shift+Alt+N finds a method or variable in a class
  • Double-click SHIFT to find files in all directories of the project
  • Ctrl + N find classes
  • Ctrl+Shift+N to find a file
  • CTRL + G positioning line
  • CTRL+F finds text in the current window
  • CTRL+SHIFT+F Finds 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 find the modified file
  • CTRL+E The most recently opened file
  • F3 searches down for the location where the keyword appears
  • SHIFT+F3 position where a keyword appears
  • Select the text, press Alt+F3, highlight the same text, and F3 scroll down to find the same text one by one
  • F4 Find the source of the variable
  • CTRL+SHIFT+O displays the search contents
  • Ctrl+W selects the code, pressing continuously will have other effects
  • F2 or Shift+F2 highlighting errors or warnings for quick location
  • Ctrl+Up/Down Moves the cursor to the first or last line
  • Ctrl+B quickly opens the class or method at the cursor
  • CTRL+ALT+B find all subclasses
  • CTRL+SHIFT+B find the class of the variable
  • Ctrl+Shift+ Up and down move code up and down
  • Ctrl+Alt+ left/ Right returns to the previous browsing location
  • Ctrl + X to delete rows
  • Ctrl + D copy
  • Ctrl+/ or Ctrl+Shift+/ comment (// or /… /)
  • Ctrl+H displays the class structure diagram
  • Ctrl+Q displays the comment document
  • Alt+F1 finds where the code is
  • Alt+1 Quickly open or hide the engineering panel
  • Alt+ left/ Right toggle code view
  • ALT+ ↑/↓ Move between methods quickly to locate the location
  • CTRL+ALT+ Left/Right to navigate to and from the edited location
  • Ctrl+Shift+Backspace jumps to the last edit
  • Alt + 6 to find TODO

Public account inverse front start pen focus on sharing Java, Python, front-end, Dachang experience, career development dry goods; Every day at 14:40 PM, every programmer should pay attention to the technology platform. Attention is sent to small make up the fine video tutorial

Other shortcut keys

  • SHIFT+ENTER another line
  • CTRL+Z Reverse (Undo)
  • CTRL+SHIFT+Z Forward (Cancel undo)
  • CTRL+ALT+F12 Explorer opens the folder
  • ALT+F1 find the directory where the file resides
  • SHIFT+ALT+INSERT vertical editing mode
  • CTRL+F4 closes the current window
  • Ctrl+Alt+V to introduce variables. For example: new String(); Automatically import variable definitions
  • Ctrl+~, fast switching scheme (interface appearance, code style, shortcut key mapping and other menus)

Debug shortcut keys

F8, F7, F9, and most notably Drop Frame allows you to restart any code that has been run.

  • Alt +F8 debug Select the value to be queried
  • Alt+Shift+F9, select Debug
  • Alt+Shift+F10, select Run
  • Ctrl + Shift + F9, compile
  • Ctrl+Shift+F8 to view breakpoints
  • F7, enter
  • Shift+F7, smart step in
  • Alt+Shift+F7, force in
  • F8, step
  • Shift + F8, step out
  • Alt+Shift+F8 to force the step
  • Alt+F9, run to the cursor
  • Ctrl+Alt+F9 to force it to the cursor
  • F9, recovery procedure
  • Alt+F10, locate the breakpoint

refactoring

  • Ctrl+Alt+Shift+T brings up the Refactor menu
  • Shift+F6, rename it
  • F6, mobile
  • F5, copy
  • Alt+Delete, safely Delete
  • Ctrl + Alt + N, inline

Public account inverse front start pen focus on sharing Java, Python, front-end, Dachang experience, career development dry goods; Every day at 14:40 PM, every programmer should pay attention to the technology platform. Attention is sent to small make up the fine video tutorial

Top 10 Intellij IDEA shortcuts

There are plenty of shortcuts in Intellij IDEA to love, and there are some interesting discussions on StackOverflow. Everyone has their favorites, and it’s hard to come up with an ideal list.

I’ve sorted out the Intellij shortcuts before, so here are my top ten favorite shortcuts based on how often I use them in daily development.

1 Intelligent Tips

The first Intellij is of course Intelligence Intelligence! The basic code prompts with Ctrl+Space and, more intelligently, Ctrl+Shift+Space by type message, but because Intellij always prompts as we type, most of the time you don’t hit either of these shortcuts manually (unless the prompt disappears).

Use F2/ Shift+F2 to move the offending code, Alt+Enter to quickly Fix it (the Quick Fix feature in Eclipse). When the intelligence prompts us to auto-complete the method name, we usually have to complete the trailing backparenthesis and semicolon ourselves. When the parentheses are nested in many layers, it can be troublesome. In this case, we can auto-complete the trailing character by pressing Ctrl+Shift+Enter. And it’s not just the parentheses. For example, the {} curly braces can be added automatically after you type if/for.

Finally, Intellij is intelligently aware of configuration files and classes in mainstream frameworks such as Spring and Hibernate, so that it can silently scan and understand how your project is constructed and configured without seeming “static.”

2 refactoring

Intellij refactoring is another feature that has blown Eclipse out of the water. It is surprisingly smart, such as extracting variables automatically checking for all matches to be extracted into a single variable. Especially after seeing “Refactoring – Improving existing Code Design”, with the cooperation of Intellij is absolutely fascinating! It is the powerful intelligence and refactoring functions that make TDD development under Intellij very smooth.

To get to the point, let’s start with an awesome refactoring feature called Ctrl+Shift+Alt+T. It’s a bit complicated, but in keeping with The Intellij style, many of the shortcuts are two-handed, unlike some of Eclipse’s most useful shortcuts, which can be done handsomely with one hand. If you’ve ever used Emacs, that’s ok. In addition, there are some of the most common refactoring techniques, which are so commonly used that it would be inefficient to check the Refactor This menu every time. For example, Shift+F6 directly changes the name, while Ctrl+Alt+V directly extracts the variable.

3 Code Generation

This is similar to Eclipse, which is not unique, but is high on the list because it is used so often. Boilerplate boilerplate code can be generated with fori/sout/ PSVM +Tab, System. Out, main method and other boilerplate code. Ctrl+J can view all templates.

Alt+Insert will be covered later in the “Assist” section. You can click in the edit window to generate constructors, toStrings, getters/setters, override superclass methods, and so on. These two techniques are so common that you generate a bunch of main, system.out, and getters/setters almost every day.

In addition, Intellij IDEA 13 adds Postfix Completion, which is more flexible and powerful than template generation. For example, to enter for(User User: users), enter user.for+Tab. For example, Date birthday = user.getbirthday (); Just type user.getbirthday ().var+Tab.

4 the editor

One of the great keys to edit is Ctrl+W, which automatically selects code syntactically, and Ctrl+Shift+W, which works the other way around. In addition, Ctrl+Left/Right moves the cursor to the front/back word and Ctrl+[/] moves the cursor to the front/back code block. These ViM-like cursor movements are also highlights. Ctrl+Left/Right/[] + Shift selects code within the jump range. Alt+Forward/Backward move to the Forward/ back method. There are some very common ones like Ctrl+Y to delete lines, Ctrl+D to copy lines, and Ctrl+ fold code.

To extend cursor movement a bit further, in addition to what Intellij already offers, you can also install ideaVim or emacsIDEAs to enjoy Vim’s fast movement and Emacs AceJump (cool!). .

In addition, Intellij’s bookmarking function is also good. Use Ctrl+Shift+Num to define 1-10 bookmarks (delete bookmarks by pressing this set of shortcuts again), and then use Ctrl+Num to jump. This avoids the trouble of skipping back and forth by using Ctrl+Left/Right for the previous/next edit position many times, and by default, this shortcut key conflicts with Windows hotkey (by default, if WE add Alt, it conflicts with Windows when changing the display direction, accidentally, the display will become an inverted display, orz).

5 Search open

Like Eclipse, Intellij’s Ctrl+N/Ctrl+Shift+N can open classes or resources, but Intellij is smarter and any character we type is treated as a fuzzy match, saving Eclipse the trouble of typing *. The latest version of IDEA also adds the Search Everywhere feature, which allows you to Search for anything in a pop-up box, including classes, resources, configuration items, methods, and more, by pressing Shift+Shift.

Class inheritance relationship can be used Ctrl+H to open the class hierarchy window, jump on the inheritance level with Ctrl+B/Ctrl+Alt+B corresponding to the parent class or parent method definition and subclass or submethod implementation, view all methods of the current class with Ctrl+F12.

It’s also easy to find classes or methods to use, Alt+F7. To find where the text appears, press Ctrl+F/Ctrl+Shift+F to find it in the current window or in the entire project, and then move forward and backward with F3/Shift+F3 to the next match.

Another example of Intellij’s greater intelligence is that you can enter the word you are looking for in any menu or display window, and Intellij will automatically filter it for you.

6 Other Assistance

These keys, combined with a few auxiliary shortcuts, can keep your hands off the mouse more than 90% of the time, focusing on the keyboard as if performing a piano performance. The final pieces of the puzzle are small but crucial:

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

ø New: Alt+Insert can create classes, methods, and anything else.

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

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

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

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

ø Debug: F7/F8/F9 correspond to Step into, Step over, Continue respectively.

In addition, some of my custom, such as horizontal split screen Ctrl + | etc., and some small magical function Ctrl + Shift + V to paste copy of long ago, Alt + Shift + Insert into the column model according to the selected columns.

ø Top #10: Ctrl+Tab

ø Top #9 Select what you want: Ctrl+W

ø Top #8: Template/Postfix +Tab

Command: Ctrl+Shift+A

ø Top #6 Nowhere to hide: Shift+Shift

ø Top #5 Auto complete: Ctrl+Shift+Enter

ø Top #4 Create everything: Alt+Insert

It’s too hard to give up. Let’s tie the top three!

ø Top #1 Intelligent completion: Ctrl+Shift+Space

ø Top #1 Self-repair: Alt+Enter

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

CTRL+ALT+ Left/Right Navigation to and from the edited location CTRL+ Shift+Backspace jumps to the last edited location

Public account inverse front start pen focus on sharing Java, Python, front-end, Dachang experience, career development dry goods; Every day at 14:40 PM, every programmer should pay attention to the technology platform. Attention is sent to small make up the fine video tutorial