IntelliJ IDEA Common Settings

instructions

IntelliJ is recognized in the industry as one of the best Java development tools, especially in intelligent code assistant, code autohints, refactoring, J2EE support, Ant, JUnit, CVS integration, code review, innovative GUI design and other aspects of the functionality can be said to be exceptional. IDEA is the product of JetBrains, a company based in Prague, the Capital of the Czech Republic, which is dominated by rigorous Eastern European programmers.

Commonly used Settings

  • IntelliJ IDEA’s code hints and supplements feature one feature: case sensitivity. As shown in figure 1, the default isFirst letterCase sensitive.
  • Case sensitivity looks like this: let’s say we’re typing in a Java code filestringBufferIntelliJ IDEA is not going to help us with hints or code additions, but if we typeStringBufferYou can do code hints and additions.
  • If you don’t want to be case sensitive, change it toNoneThe options are ok.

  • This feature is used to quickly set code review levels, as shown in the Gif above. I personally use this feature when editing large files. IntelliJ IDEA doesn’t have much of an advantage for editing large files. The reason is that it has all sorts of checks, which are very memory and CPU intensive, so TO speed up reading and writing large files, I usually temporarily set it to None.

    • InspectionsFor the highest level check, can check word spelling, grammatical errors, variable use, between method calls, etc.
    • SyntaxCan check word spelling, simple grammar mistakes.
    • NoneCheck is not set.

  • IntelliJ IDEA does not enable automatic package import by default, as shown in labels 1 and 2 above.

    • Check tag 1 and IntelliJ IDEA will automatically optimize the packages we import when we write the code, for example, automatically remove some unused packages.
    • Check label 2 and IntelliJ IDEA will automatically import the packages we need when we write the code. But for those packages with the same name, you still need to do it manuallyAlt + EnterFor import, IntelliJ IDEA is not smart enough to make judgment for us.

  • As shown in figure 1, when the number of classes in a package we import in our Java class exceeds the specified number set here, this is used instead*In lieu of.

  • As shown in the Gif above, IntelliJ IDEA collapses empty packages by default so that package names are joined together. But some people don’t like this structure and like the whole structure to be a full tree, so we can remove the checkbox in the demo.

  • As shown in label 1, IntelliJ IDEA has a kind calledPower saving modeAfter this mode is enabled, IntelliJ IDEA will turn off functions such as code checking and code prompting. So generally I think of it as a kind ofReading modelIf you encounter a sudden code file cannot be checked and prompted during development, you can check to see if this function is enabled here.

  • As shown in the Gif above, before we pressCtrl + Shift + NWhen opening a file, we can directly locate the number of lines in the file. This method is usually used relatively quickly when we are tuning CSS and looking for null pointer exceptions on the console.

  • As shown in the red circle above, we can set the default collapse or expansion for the specified code type. Checked means that the code type will be collapsed by default when the file is opened. Unchecked means the code type will be collapsed by default.

  • IntelliJ IDEA supports vertical or horizontal grouping of code, as shown in the Gif above. In general, when making changes to a large file, some changes are above the file and some changes are below the file. If the round-trip operation may be very inefficient, this method can be much better. Of course, if your browser resolution is high enough.

  • As the arrow above shows, IntelliJ IDEA turns spell checking on by default, which can be turned off for those who may have an obsession with seeing squiggly lines underneath words. However, I personally recommend not turning this off, because spell checking is a great feature to use when naming code in standard language, and it can help us find bugs caused by spelling errors in code from time to time.

  • As shown in the Gif above, we can drag and shift the child window of the component window. Sometimes the setting is too much or the effect is not satisfactory, we need to click this button to restore the window.

  • As shown in the Gif above, there is no pairCtrl + DBefore the shortcut key is modified, this shortcut key will be used to copy and paste the selected content, but the paste position is added in the original position, I personally do not like this style, I like to copy the selected line number complete content, so modified, the effect as shown in the Gif above.

  • As shown in the Gif above, the defaultCtrl + spaceThe shortcut key is the basic code prompt and supplementary shortcut key. However, because the shortcut key in our Chinese system is basically occupied by the input method, we found that no matter how we press the shortcut key, there is no prompt code effect. This is the reason. I personally recommend changing this shortcut key toCtrl + a comma.

  • IntelliJ IDEA 14 does not display memory usage by default, as shown in the Gif above. This is fine for machines with large memory, but it is best to display it on machines with small memory. As shown in the figure above, partial memory can be reclaimed after clicking.

  • As shown in figure 1, IntelliJ IDEA displays all open file names on a single line by default when opening many files. However, my personal habit now is to use multiple lines, which is more efficient than a single line, because a single line will hide more than part of the Tab interface, so it is not convenient to find files.

  • As shown in the Gif above, the default IntelliJ IDEA single line comment for Java code is to put the comment’s slash at the beginning of the line number. I personally think such a single line comment is very ugly, and the whole code style is ugly, so it is generally set to the two slashes of the single line comment following the head of the code.

  • As shown in the Gif above, the default Java code does not wrap its first curly brace, but people who prefer symmetrical curly braces can do so. I’m comfortable with this feature, and I personally like the symmetry structure, but I don’t like it because it takes up too many lines.

  • As shown in figure 1, if the make or rebuild process is slow, you can increase this heap memory setting, generally for machines with large memory1500None of this matters.

  • As shown in mark 1 in the figure above, if this option is selected, the project used last time will be opened by default when IntelliJ IDEA is started. This works well if you have only one project, but if you have more than one project, it is recommended to turn it off so that when launching IntelliJ IDEA, you can select a recently opened project.

  • As shown in the red circle above, this option sets how to open a project window when we have already opened one.

    • Open project in new windowOpen each time with a new window.
    • Open project in the same windowReplace the currently open project each time so that there is only one project window on the desktop.
    • Confirm window to open project inEach time a pop-up window pops up, giving us the option to open or replace the current project window with a new one.

  • As shown in the Gif above, we can do soft branch viewing for code that is too long horizontally. The branch effect caused by soft branch is set by IntelliJ IDEA, and there is no real branch in the essential code.

  • This setting can be increased as shown by the arrow aboveCtrl + ENumber of record files displayed on the pop-up layer.

  • As shown by the arrow above, this setting increases the number of open Tab files, and when we open more than this number of files, the earlier files will be replaced by the new ones.

  • As shown in label 1 in the figure above, the suffix type files in this area will be opened by label 2 in IntelliJ IDEA.
  • As shown in figure 3, we can ignore certain files or folders with suffixes in IntelliJ IDEA, for example, I usually put the suffix.ideaThis folder is ignored.

  • As shown in the Gif above, when we set up the component windowPinned ModeThe window with the property set will not be automatically hidden when switching to another component window.

  • As shown in the Gif above, we can add certain files to our favorites and then view our favorites in the Favorites component window.

  • As shown in the Gif above, we can pass throughAlt + F1 + 1Shortcuts to locate the current file in the Project component window.

  • As shown in the Gif above, we can check this setting to addCtrl + Mouse wheelShortcut keys to control code font size display.

  • As shown in the Gif above, we can check this setting to addCtrl + Mouse wheelShortcut keys to control the size of the picture display.

  • As shown in the red circle above, IntelliJ IDEA is not checked by defaultShow line numbersIt shows the number of lines, but I recommend that this be checked in general.
  • As shown in the red circle above, IntelliJ IDEA is not checked by defaultShow method separatorsShows the method line, this line helps us to distinguish methods, so it is also recommended to check.

  • As shown in the Gif above, we select the code button to be foldedCtrl + Alt + TShortcut key, select custom fold code area function.

  • As shown in the Gif above, when we edit a file, it automatically locates the Project component window where the current file is located.

  • As shown in the Gif above, IntelliJ IDEA gives us local file history even if we don’t use version control in our project. In addition to simple records, we can also tag the current version.

  • As shown in the Gif above, we can also view the local history of the selected code, eliminating the need to view the history of the rest of the file. In addition to the file can view the history, folder can also view the history of the changes of various files.

  • As you can see in the Gif above, IntelliJ IDEA comes with a code check to help you analyze simple syntax problems and code details.

  • As shown in the Gif above, IntelliJ IDEA comes with a mock request tool, Rest Client, which is very useful for mock requests during development.