As a veteran eclipse user, I want to take a more rigorous look at IntelliJ idea. JetBrains staff were very friendly and gave me an open source license for the podcastpedia.org and codingpedia.org projects. In this article, I list some of the actions that are commonly used in eclipse and are equivalent to IntelliJ. Write this article in order to later forget to be able to make a record, also may be able to help other people.
Shortcut keys
You have to say it beforehand! The following table lists the shortcut keys I use most frequently among the two Ides:
Describe |
Eclipse |
IntelliJ |
Code completion |
Ctrl+space |
Ctrl+space |
Open Class or interface (Two Ides support the use of the "camel character" prefix to filter the lookup list, which makes it easy to complete the search; For example, you can use "Podi" to retrieve the Podcastdaoimpl class) |
Ctrl+shift +t |
CTRL + N |
Quickly open files/resources |
Ctrl+shift+r |
Shift+f6 |
Open declaration |
F3 |
Ctrl+b |
View javadoc/Details |
Mouse over (F2 focus) |
Ctrl+q |
Quick fix |
Alt+1 |
Alt+enter |
Import all the required packages |
Ctrl+shift+o |
Ctrl+alt+o |
Save File/Save All Files |
Ctrl+s/ctrl+shift+s |
Auto Save |
Current file Quick Position popup (member, method) |
Ctrl+o |
Ctrl+f12 |
Source (Generate getter and setter, constructor, etc.) |
Alt+up/alt+down |
Alt+insert |
Current syntax completion Correct syntax constructs such as If,do-while,try-catch,return (method invocation) (e.g., adding parentheses) |
|
Ctrl+shift+enter |
Extracting constants |
Ctrl+1-> Solid Extraction |
Ctrl+alt+c |
Extracting variables |
Ctrl+1-> Extracting variables |
Ctrl+alt+v |
Add, delete, and move several lines of code |
Adds a row to the current caret |
Shift+enter |
Shift+enter |
Copy a line or code snippet |
Ctrl+alt+up/down |
Ctrl+d |
Delete a line of code |
Ctrl+d |
Ctrl+y |
Select code to move up or down |
Alt+up/down |
Shift+alt+up/down |
Find/Search |
Find a class/variable to use in a workspace or project |
Ctrl+shift+g |
Alt+f7 |
Find text in a project or workspace |
Ctrl+h (select File search) |
Ctrl+shift+f |
Navigation |
Fallback (undo last navigation action) |
Alt+left |
Ctrl+alt+left |
Navigating between labels/edits |
Ctrl + Page Down/up |
Alt + Left/alt + Right |
Jump to a row |
Ctrl+l |
Ctrl+g |
Navigate to the nearest file |
Ctrl + E |
Ctrl + E |
Quick way to switch between editors |
|
Alt + Up/down |
Debugging |
Run a row |
F6 |
F8 |
Go to the next calculation |
F5 |
F7 |
Run to the next breakpoint |
F7 |
Shift+f8 |
Reply Run |
F8 |
F9 |
Link Editor
Many times we are editing a file and need to edit other files as well. If the FF class is a class that is often edited and needs to be edited by other classes in the same package-the function of the link editor allows you to quickly switch between classes in the same package. What kind of convenience does this feature offer us? Whenever you edit a file, it immediately shows where it is in the Package browser view/Project view. If you use the expanded package view, it divides and displays classes by function, rather than using hierarchies (DAO layers, service layers, and so on) to present classes. This is also my highly recommended way of showing, because it is really convenient.
Eclipse
You can see and use the link editor button in the project browse view or the package browse view.
If you do not want to use this feature, you can still use the Alt+shift+w shortcut to view the package view or the drawing view and set its display position.
IntelliJ
Select settings in the Project view or package view, then tick auto-scroll (autoscroll from source) based on source ;
If you do not want to use this feature, you can still use the shortcut key ALT+F1 to navigate and set the location of the display;
The charm of IntelliJ a number of features are set by default
IntelliJ itself comes with a multitude of features (e.g., GitHub integration). Of course, at Eclipse you can also get enough functionality by choosing a different version of the plugin, but you need to configure these plugins yourself.
Use the mouse wheel to change the font size
In IntelliJ, you can use the mouse wheel to change the font size (I use this feature frequently in my browser). However, this feature requires manual activation.
- Open the IDE's settings (Ctrl+shift+s or click on the File menu >setting)
- On the editor page (enter "editor" in the search box), make sure that the change font size (Zoom) with Ctrl+mousewheel option is selected.
Start the command line terminal directly in the IDE
Using shortcut keys: Alt + F12
Flexible and easy-to-use templates
Enter P, and then use the shortcut key ctrl+j to get the following options:
- Psf–public Static Final
- Psfi–public static Final int
- Psfs–public Static Final String
- Psvm–main Method declaration
Strong support for JavaScript and HTML5
The commercial version of IntelliJ should contain code-assist features for HTML5, CSS3, SASS, less, JavaScript, Coffeescript, node. js, ActionScript, and other languages. I will confirm the contents as soon as possible.
Unable to maximize the console compared to the shortcomings of Eclipse IntelliJ
In eclipse, you can use the Ctrl+m shortcut key or double-click the label to maximize the current console. But there is no such way in IntelliJ.
Mouse hover Display Javadoc
Of course, you can use the Ctrl+q shortcut key in IntelliJ to get the above functionality. But when the mouse hovers over the code you can see that part of the Javadoc function is so friendly in eclipse.
Summarize
In my opinion, every IDE is great, IntelliJ looks more modern, but sometimes I like the classic version of Eclipse, probably because I used to use eclipse a lot. May continue to be affected by this factor in the future.
Here is my whole experience, and I will continue to add some of the features and features that you encounter with Eclipse and IntelliJ, so please look forward to it.
Original link: Javacodegeeks translation: Importnew.com-dony.xu
Link: http://www.importnew.com/15778.html
"Turn" IntelliJ will the light of idea cover eclipse?