Describe the use interface of IntelliJ IDEA and modify the content of IntelliJ IDEA template comments

Details the use interface of IntelliJ IDEA

Insert picture description here

Insert picture description here

As shown in the figure above, after opening IntelliJ IDEA, the first thing that greets us is this interface:

  • Note 1 : Create New ProjectCreate a new project;
  • Note 2 : Import ProjectImport an existing project;
  • Note 3 : OpenOpen an existing project;
  • Note 4 : Check out from Version ControlThe project can be checked out through the project address on the server (commonly known as: check out).

Here, in order to further introduce IntelliJ IDEA, we create a Static Web project, click Create New Projectto enter the following interface:

Insert picture description here

  • Note 1 : Frameworks and languages ​​supported by IntelliJ IDEA;
  • 2 are denoted : the label 1 is further classified corresponding language or framework.

Here, we choose Static Web-->Static Web, and then click Nextto enter the next step:

Insert picture description here

  • Mark 1 : Project name (customized, generally lowercase, multiple words are connected by underscore);
  • Note 2 : Project storage address;
  • Note 3 : Module name (the same as the project name by default);
  • Note 4 : Content root path;
  • Note 5 : Module file storage address;
  • Note 6 : Project format.

Here, there is little need to explain, that is: in IntelliJ IDEA, the Projectlargest unit, there is no similar workspace for Eclipse ( Workspace) concept, but one that we can Projectcreate more of the following Module, a default is Projectcreated under a Module, so The phenomenon that the project name is the same as the module name by default occurs . Under normal circumstances, we do not need More Settingsto make changes in the. Next, click Finishto complete the creation of the project:

Insert picture description here

  • Note 1 : Project structure diagram;
  • Note 2 : When there is no content in the editing area, the commonly used shortcut keys are displayed by default.

For a new project created or opened for the first time, IntelliJ IDEA will create a project index. Large-scale projects may be stuck during the index creation process. Therefore, it is strongly recommended not to move the project during the creation of the index by IntelliJ IDEA. In addition, the default interface of IntelliJ IDEA is hidden Toolbarand Tool Buttonsthe bloggers prefer to show both. You can choose whether to enable it or not according to your personal preference. But no matter whether we choose to turn it on or not, we must know how to turn it on. When we want to turn it on, we don’t know how to turn it on. Isn’t that embarrassing? Therefore, here, we choose to open Toolbarand Tool Buttonsclick View, as shown in the following figure:

Insert picture description here

As shown in the figure above, Toolbarand the Tool Buttonsdefault is not selected, we click Toolbarand respectively Tool Buttonsto open (the check mark appears):

  • Mark 1 : Toolbar
  • Note 2 : Tool Buttons

As shown in the figure above, Toolbarand Tool Buttonsopened successfully! At this point, the introduction of the IntelliJ IDEA user interface is complete.

Modify the content of IntelliJ IDEA template comments

Insert picture description here

Observing the above picture, I don't know if you have noticed: IntelliJ IDEA has its own template comment function. As shown in the figure above, when creating a Java class, its own template annotation content is as follows:

/**
 * Created by think on 2017/3/16.
 */

SettingsAfter viewing , we will find that its content comes from:

/**
 * Created by ${USER} on ${DATE}.
 */
  • ${USER}: Represents the host name;
  • ${DATE}: Indicates the time when the file was created.

Comparing the two, we found that: ${USER}is set to think; ${DATE}is set to 2017/3/16. Among them, there is ${DATE}no problem, it means the time we created the class, but the ${USER}setting thinkis not so good! What should I do then? Don't say anything, just change it! Next, the blogger will demonstrate two ways to modify the user content in the template comments.

Make Settingschanges in

Insert picture description here

As shown in the figure above, we locate the Editor > File and Code Templatesinterface, and then select the Includesmiddle File Header, ${USER}directly modify the name to our own definition, for example, the blogger sets it to 维C果糖, and then click Apply. Next, democreate a test class in the directory, CeshiUserand its effect is shown in the following figure:

Insert picture description here

As shown in the picture above, obviously our settings have taken effect!

binModify the idea.execonfiguration file in the directory

Insert picture description here

As shown in the figure above, we opened the configuration file in the bindirectory in the IntelliJ IDEA installation directory idea.exeand added a line of content -Duser.name=charies. Next, save the configuration file, restart IntelliJ IDEA, demoand create a test class in the directory CeshiUser2. The effect is as shown below Shown:

Insert picture description here

As shown in the picture above, obviously our settings have taken effect! But here, there are two points to note, that is:

  • ① When idea.exemodifying the user content in the template comment in the configuration file, we cannot set it to Chinese, otherwise there will be garbled Chinese characters.
  • ② After modifying the idea.execonfiguration file, you need to restart IntelliJ IDEA. Only after restarting, the latest configuration can take effect.

Guess you like

Origin blog.csdn.net/weixin_54707168/article/details/114828148