- 1, IDEA common configuration
- 1.0、Appearance & Behavior
- 1.1 Editor - General
- 1.2、Editor – Font
- 1.3、Editor – Color Scheme
- 1.4、Editor – Code Style
- 1.5、Editor – File and Code Templates
- 1.6、Editor – File Encodings
- 1.7、Build,Execution,Deployment
- 1.8, the power saving mode is set (negligible)
- 1.9, the code is provided horizontally or vertically
- 2, set the shortcut keys (Keymap)
- 3, on the template (Templates)
- 4. Create a Java Web Project or Module
Common arrangement
- IntelliJ IDEA has many user-friendly settings, but also because these user-friendly settings for those diehard IntelliJ IDEA powder is more dead set on using it and sharing it.
Enter the setting interface:
the directory structure as follows:
- Set the theme
here by default provides three themes: IntelliJ, Darcula, Windows. Here you can choose according to their preferences. - Set the form and menu font and font size (negligible)
- Added: Setting editing area theme (negligible)
If you want more theme effects, you can go to the following website: http://www.riaway.com/
After downloading, importing a theme :( way) file -> import setttings -> select the jar file to download the theme -> all the way to confirm -> Restart. After the restart, the new theme will be automatically enabled. If not enabled, you can choose as follows:
After the download, import theme :( Second way)
- Added: through plug-ins (plugins)
Like the black theme, you can also download plug-ins: Material Theme UI
after the click of a button, in a networked environment following search plugin - install - restart IDEA to:
- Setting the mouse wheel to change the font size (negligible)
we can check after this setting, increase Ctrl + mouse wheel shortcuts to control code font size. - Set Hover tips
- Set up automatic pilot package features
the Add unambiguous Imports ON at The Fly : automatically import unclear structure
Optimize Imports ON at The Fly : automatically help us optimize the imported package - Setting display separator between the line and the method
as shown in FIG red circle, can check Show line numbers: the number of lines. I generally recommend to check on this.
As shown in FIG red circle, you can check the Show method separators: display method of dividing line. This helps separate line method in our district, it is recommended to check on. - Set single-line display tabs cancel the operation
as shown in Note icon, open many files at the time, IntelliJ IDEA default is to open all the file names Tab single-line display. But now my personal habits is to use a multi-line, multi-line efficiency than a single line, because more than a single line will hide the interface section Tab, this is not convenient to find files.
- Set the default font, font size, line spacing, font
- Modify the current theme font, font size, font, line spacing (negligible)
if the current theme does not want to use the default font, font size, font, line spacing, you can set separately:
- Modify the console output of the current theme font and font size (negligible)
- Modify the code in the comment color
Doc the Comment - Text : modify document annotations font color
The Comment Block : change the font color multi-line comments
The Comment Line : change the font color when the line comment
- Set exceeds a specified number of import, read * (negligible)
- 修改类头的文档注释信息
常用的预设的变量,这里直接贴出官网给的:
${PACKAGE_NAME} - the name of the target package where the new class or interface will be created.
${PROJECT_NAME} - the name of the current project.
${FILE_NAME} - the name of the PHP file that will be created.
${NAME} - the name of the new file which you specify in the New File dialog box during the file creation.
${USER} - the login name of the current user.
${DATE} - the current system date.
${TIME} - the current system time.
${YEAR} - the current year.
${MONTH} - the current month.
${DAY} - the current day of the month.
${HOUR} - the current hour.
${MINUTE} - the current minute.
${PRODUCT_NAME} - the name of the IDE in which the file will be created.
${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL} - full name of a month. Example: January, February, etc.
- Set the project file coding
Description : Transparent native-to-ascii conversion is mainly used to convert ascii, are generally required to check, or Properties to display the comments in the file will not be Chinese. - Set the encoding of the current source file (negligible)
coding changes to individual files can also click on the lower right corner of the encoding settings. If the code content that contains Chinese, as will pop operation selection. among them:
①, Reload indication reload new code, the new code will not be saved to a file, reopen the file, the old code is still what or what.
②, Convert For indication to convert new code, the new code will be saved to a file, reopen the file, the new code is what is yes.
③, code file containing the Chinese, the Chinese may make after Convert garbled, so please make a backup converted into, or the conversion process may appear garbled, can not be restored.
- Set automatically compile
build project is the java code we write, the frame profile, international and other resource files, JSP pages and pictures and other resources as "raw materials", to "produce" out of a running process.
Intellij Idea default status is not automatically compiled state, Eclipse default is automatically compiled: many of my friends are from Eclipse to Intellij, which often
lead us to forget about the java class files modified recompiled when action is required class file, so the old file operation
After shown above, there is something called IntelliJ IDEA of power saving mode, this mode is turned on will turn off IntelliJ IDEA check codes and code tips and other functions. It is generally considered that this is a read mode, if you experience a sudden code file in the development process can not be checked and tips, you can see if there are open the function.
Set shortcut keys (Keymap)
About template (Templates)
(Editor – Live Templates 和 Editor – General – Postfix Completion)
- Its principle is to configure some common code initials, the code may appear in your fixed pattern predefined in the abbreviated input, allowing developers to greatly improve efficiency, but also can add a personal touch. The simplest example is the input sout will appear System.out.println () in Java;
Template official introduction Live S:
https://www.jetbrains.com/help/idea/using-live-templates.html
-
The default Postfix Completion is as follows:
-
Live Templates silent as follows:
-
Difference between the two: Live Templates can be customized, and Postfix Completion can not. At the same time, both operations have provided some templates, Postfix Templates Live Templates can be faster than 0.01 seconds
-
Example:
PSVM: generate a main method
sout: System.out.println () Quick output
- If for existing templates, not used to the feeling, inappropriate, you can modify:
- For example:
by calling psvm Calling the main method used to, you can change, like Eclipse, using the main retrieval.
- IDEA provides many ready-made Templates. But you can also create a new configuration using the Template according to their needs.
First define a template group:
Select the group from the template definition, click on the "+" to define a template.
①, ABBREVIATION : template abbreviated name
②, the Description : template description
③, Template text : snippet template
④, the Define : Applications. For example, click Define. : Select as
defined above manner can test method, and then to test the java class file.
Create a Java Web Project or Module / div>
- Engineering bar space new - module:
Here we must check the Web Application, you can create a Web project.
It provides Web project name. Note here that tinkering Content root and Module file location. After the creation of the project is structured as follows:
Open index.jsp. Modified to read as follows. Here you will find the code hinting IDEA better than Eclipse
- Configuring Tomcat
Before you configure Tomcat in the IDEA, the need to ensure that Tomcat is already installed and configured the environment variables. Let's look at how to configure the IDEA:
Configure the name and location of the Tomcat application server configuration here. Depending on the installation location of their decision Tomcat.
Other positions default value (set to start the browser and a port number), as described above. Then Deployment:
Click Apply to. In this case:
index.jsp to perform just created: the
effect is as follows:
Note: The
information displayed after running Tomcat:
you can click on the red box, just click finish and can not shut down the server immediately, just disconnect the connection to the server, later, when the stop button is grayed out, it means closed.
Next chapter, (3) IDEA association database, version control, and break-tone arrangement Maven