Some initial settings and optimizations about IDEA to improve development efficiency

Show Toolbar

(1) Effect drawing

(2) Setting method

  • Note 1: View–>Toolbar Higher version: View->Appearance–>Toolbar
  • Note 2: View–>Tool Buttons Higher version: View–>Appearance–>Tool Windows Bars

Set mouseover hints

(1) Effect drawing

(2) Setting method

File–>settings–>Editor–>General–>勾选Show quick documentation on mouse move

show method separator

(1) Effect drawing

(2) Setting method

File–>settings–>Editor–>General->Appearance–>勾选Show method separators

Ignore case hints

(1) Effect drawing

Remarks: The default setting of idea is to strictly distinguish case prompts. For example, entering a string will not prompt String, which is inconvenient for encoding.

(2) Setting method

File–>settings–>Editor–>General -->Code Completion -->

theme settings

(1) Effect drawing

Remarks: There are two styles of black and white

 

 (2) Setting method

File–>settings–>Appearance & Behavior–>Appearance–>

Eye protection theme settings

(1) Effect drawing

(2) Setting method

If you want to change the theme of the editing page, you can go to the settings to adjust the background color

Automatically import packages

(1) Effect drawing

Remarks: By default, the package needs to be imported manually. For example, if we need to import the Map class, it needs to be imported manually. If it is not needed, the instance of Map is deleted, and the imported package also needs to be deleted manually. If this function is set, it will not work. It needs to be done manually, and it will help you automatically import and remove packages. It is not convenient to take screenshots. Please test the effect~

(2) Setting method

File–>settings–>Editor–>general–>Auto Import–>

Display multiple Tabs on a single line

(1) Effect drawing

The default is to display a single row of Tabs:

Display multiple rows of Tabs:

(2) Setting method

File–>settings–>Editor–>General -->Editor Tabs–>去掉√

set font

(1) Effect drawing

Remarks: The font size of Idea is very small when the default installation is started, and it is not used to it. You need to adjust the font size and font (you can adjust it if necessary)

(2) Setting method

File–>settings–>Editor–>Font–>

Configure class documentation comment information and method comment templates

(1) Effect drawing

Remarks: It is convenient for accountability and management to view during team development

 The effect diagram is as follows:
class annotation:

Method annotation:

 idea will not set it for us by default, so it needs to be set manually.

(2) Class annotation settings (IDEA will automatically add annotations when creating a class)
File–>settings–>Editor–>File and Code Templates–>Files

  1. NAME: set the class name, and the following {NAME}: set the class name, and the following NAME: set the class name, the same as the following {NAME} to get the created class name
  2. TODO: mark of to-do items, general generated classes or methods need to add description
  3. USER, DATE, TIME: Set the current system user {USER}, the date of creation {DATE} and time {TIME} to create the class. These are built-in methods of IDEA, and there are some other methods marked in the red box, such as If you want to add a project name, you can use {PROJECT_NAME}

 (3) Method comment setting (method comment needs to be manually entered /* and then press Enter)

1、File–>Settings–>Editor–>Live Templates

*
 * @Author user
 * @Description //TODO  
 * @Date $date$ $time$
 * @Param $param$
 * @Return $return$
 **/

Display code horizontally or vertically

(1) Effect drawing

Remarks: If you need to compare codes in Eclipse, you only need to drag the Tabs, but the idea needs to be set

(2) Setting method

Right-click Tabs

Replace shortcut keys

(1) Effect drawing

Remarks: When transplanting from Eclipse to idea coding, many shortcut keys are inconsistent, resulting in reduced writing efficiency. Now let’s replace the shortcut keys

(2) Setting method

  • method one:

File–>Setting–>Keymap

 For example, if it is set to Eclipse, you can ctrl+d to delete a single line of code after setting (idea is ctrl+y)

  • Method 2: Set up a template
  • File–>Setting–>Editor-->Live Templates

  • Method three:

 Take the ctrl+o rewriting method as an example

Remove italics from comments

 (1) Effect drawing

 (2) Setting method

File–>settings–>Editor–>Color Scheme

Code detection warning prompt level setting

Strongly recommend, don’t turn it off, don’t feel troublesome, his tips are all good for you, help you improve your code quality, very helpful

Project Directory Related – Collapse Empty Bundle

PS: IntelliJ IDEA will fold empty packages by default, as shown in the figure, so that the package names will be connected together. If you don’t like it, it’s OK

window reset

This is when you suddenly mess up the window, you can still restore it, just restore it directly, and it will be fine.

View local code history

Quick completion semicolon

CTRL + SHIFT + ENTER can quickly generate a semicolon at the end anywhere in the current line

Quickly find Controller methods

If there are a lot of controllers in your project, there are a lot of http or resful methods in it. How to quickly find these methods? At this time, ctrl+alt+shift+n can come in handy.

For example, if you vaguely remember that there is a path of users in the interface related to login, then use ctrl+alt+shift+n and directly enter /users.

 When you are looking for methods in thousands of Controllers, this trick can greatly improve efficiency.

brace matching

This is also very useful, because the code is too long, and a for loop may have filled the entire screen. At this time, it is very difficult to find the other side corresponding to a certain brace. You can position the cursor on one side of a brace, and then use ctrl+] or ctrl+[ to go back and forth.

Supplement: The above configuration information is saved in .idea under the user directory of the system disk

By default, there will be these two files

config: During the initial installation of IntelliJ IDEA, you are asked whether to import the existing configuration information. This config is your configuration information, which is convenient for reinstallation when changing computers and systems. The premise is to save this folder.

system: This folder is when an unpredictable error occurs in IntelliJ IDEA, such as a blue screen, a sudden power failure and the project cannot be started, you can try to delete this file and let the system regenerate a system file

Guess you like

Origin blog.csdn.net/qq_44858888/article/details/123951845