[Intellij Idea] Intellij Idea common configuration settings

1. Configure the configuration file of Intellij Idea to transfer from the default c drive to another drive letter
Find the installation file of Intellij idea, find the idea.properties configuration file in the bin directory, and configure the configuration folder of Idea and the system folder of Idea to Other drive letters except C drive.

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
 idea.config.path=D:/java/IntellijIdea/.IntelliJIdea/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
 idea.system.path=D:/java/IntellijIdea/.IntelliJIdea/system

2. Set the shortcut key habit style to the eclipse habit:
"ctrl+alt+s" to enter the setting menu, enter "keymap" in the search bar, and then select "eclipse" as shown in the figure, so that most shortcut keys will be the same as those in the eclipse tool. agree.
write picture description here
3. Set "font":
enter the setting menu, select the font you like as shown in the figure below, of course, I still love the "consolas" font:
write picture description here
4. Set your own file comment template:
enter the settings, and then find the following location, and then you can follow the Set your own habits:

 /**
 *Created with ${PRODUCT_NAME}
 *Created By Kinsey
 *Date: ${DATE}
 *Time: ${TIME} 
 */

write picture description here
5. Set the character encoding of your IDEA.
write picture description here
6. Cancel the settings of the built-in svn. Many problems will occur when downloading projects from svn at the beginning, because he has specified his default svn at this time (all cancellations are OK)
write picture description here
7 , Set the corresponding jdk compilation environment for the project
write picture description here
8. Enter the lib package into the "buildpath"
write picture description here

Several shortcut keys
"psvm" that can be used frequently: quickly create a main method

    public static void main(String[] args) {

    }

"sout": Quickly create print statements

System.out.println();

"alt+enter": quick completion
Example 1 (auto-completion for local variables): "alt+enter" at the position of object a automatically completes the completion and creation of local variables
write picture description here

User a = new User() ;

Example 2: Complete type coercion, as follows

 User user =  jdbc.queryForObject(sql, new Object[]{id}, new UserMapper());

Place the mouse to the right of the equals sign and then "alt+enter" to convert the result to "User"

 User user =  (User)jdbc.queryForObject(sql, new Object[]{id}, new UserMapper());

Example 3. The method of automatically implementing the interface:
Suppose there is a "Dao interface" with many methods defined in it. When the implementation class is completed, the cursor is near the interface to be implemented, and then "alt+enter", as shown in the figure, the interface is automatically implemented Methods.
write picture description here

……etc. "alt+enter" is still quite powerful.
"shift+alt+r": Quickly rename "alt+insert": This shortcut key is also frequently used ①: Automatically create a construction method that meets your needs ②: Quickly implement the setget method ③: Quickly create "toString() " Wait


write picture description here




"ctrl+shift+r": Quickly open the resource file
"ctrl+l": Quickly locate the position of the line in the file
"shift+ctrl+alt+s": Quickly enter the project structure setting
"ctrl+alt+s": Quickly enter Settings menu
"shift+alt+z": quickly create ifelse or quickly complete try catch

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325789918&siteId=291194637