A week on
Product manager design experience/user experience
Instead of writing a technical analysis article this week, I’ll share a few treasured IDEA “tricks” to help you get code done quickly.
What are you waiting for? Get on the bus……
Like it before you look at it, make it a habit. Wechat search “program tongshi”, attention is done ~
Forward/backward
When we use the browser process, we can click back to see the previous browsing history. IDEA also has the same functionality. When editing code, click to see the implementation logic of the calling class, and then use the back shortcut to quickly return to the code you just wanted to edit.
There’s going back, and there’s going forward
The forward/Back shortcut keys are as follows:
- Windows:Ctrl + Alt + Left/Right
- Mac: ⌘ + ⌥ + ← / →(Direction key)
The schematic diagram is as follows:
Viewing Historical Records
Taking the browser as an example, when we have clicked on many pages and want to see a page we have seen before, it is very difficult to use backward, so we need to go back one by one to find it. In this case, it is very efficient to look directly from the history.
Similarly, IDEA provides similar functionality for viewing historical files and quick lookup using key keys in pop-up Windows.
The shortcut keys are as follows:
- Windows: CTRL + E
- Mac: ⌘ + E
In addition, there is a location in IDEA where you can view the recently modified code and directly click to jump to it quickly.
The shortcut keys are as follows:
- Windows: CTRL + Shift + E
- Mac: ⌘ + ⇧ +E
tip
At this point, I suggest you set an option to limit the number of Edit Tabs.
By default, the Tab Limit is 10. Only 10 tabs can be opened and closed in the same order.
If many tabs are opened, IDEA will collect the tabs after more than one screen. We need to click the button to view and open the hidden tabs.
In this case, hidden tabs will most likely not be viewed. In this case, it is better to use the shortcut key above to view the history file.
Automatic code completion
Using this shortcut, you can automatically complete the semicolons, parenthesis pairs, and so on at the end of the code, allowing you to type many fewer characters. In addition, this shortcut will automatically format the finished code.
Shortcut:
- Windows: CTRL + Shift + Enter
- **Mac: ⌘ + ⇧ +⏎ **
Autocomplete semicolon
Auto complete parenthesis pairs
In addition to the above functions, you can try in other places, may have a little surprise oh!
Quick extraction of variables
Sometimes when you create a new object and forget to create a variable, you have to move the cursor to the front and declare it.
In this case, we can use the reconstruction function of IDEA -Introduce Variable.
The shortcut keys are as follows:
- Windows: CTRL + Alt + V
- **Mac: ⌥ + ⌘ + V **
In addition to this approach, you’ve recently learned another way to do this, using Postfix Completion IDEA.
rename
Sometimes the hand misspells the name of the side variable, and when it finds out that the variable has been quoted for many times, then it needs to modify all the quoted places, which is very troublesome.
IDEA reconstruction function – Rename, you can Rename, and one-click replacement of existing references.
In addition to function names, class names can be modified using this shortcut key.
The shortcut keys are as follows:
- Windows: Shift + F6
- **Mac: ⇧ + F6 **
GenerateSerialVersionUID
Finally, a plugin -GenerateSerialVersionUID is recommended. After installing the plugin, you can use IDEA Generate to automatically Generate a random serialVersionUID.
If you use Dubbo a lot, this plugin can save you a lot of work.
Finally (one key four link bai)
If you still want more, you can read the previous article about IDEA and learn more tips:
-
IDEA tips bookmark and collection
-
IDEA daily tips
-
IDEA could not find java.util.Date
-
Not sure how to use IDEA functionality? Teach you three tricks to master most functions
-
Share IDEA debugging source tips
-
IDEA Debug failed to access breakpoint resolution
-
Why Intellij IDEA as the first choice for daily development
-
Crash, the IDEA of 2020 won’t start | solution presented the IDEA of 2020 new features
And finally, finally, do you know any other slutty tricks? Welcome to comment!
Welcome to pay attention to my public account: procedures to get daily dry goods push. If you are interested in my topics, you can also follow my blog: studyidea.cn