IntelliJ IDEA is currently the best, strongest and most intelligent Java IDE, he just turned 18 years old a few days ago.

In this article, I recommend a few plug-ins that I’ve been keeping in my closet for a long time and that I use frequently to improve code efficiency.

Introduction to IDEA Plug-in

Common IDEA plug-ins are as follows:

Common Tool Support

Java daily development requires access to many common tools. For ease of use, many tools also have IDEA plug-ins for development, most of which are integrated in IDEA by default. Examples include Maven, Git, SVN, tomcat, Jetty, JRebel, Gradle, etc.

enhancements

There are also plug-ins that provide functionality not found in ides, such as static code scanning, automatic code generation, and so on.

Framework for the integration

The main purpose of the integration framework is to provide the generation of framework custom code and configuration, as well as quick access to the functionality provided by the framework. Such as integrated Spring framework, Mybatis framework and so on.

UI customization and optimization

UI customization plug-ins mainly provide personalized customization, such as modifying the background image of the edit area plug-in, modify the code color, etc.

Other programming languages support

IDEA mainly supports Java. To use other languages, plugins that support other languages can be used to implement parsing, color matching themes, code formatting, and hints. For example, the Go language supports plug-ins.

Special needs of individuals or companies

Internal company plug-in

Take a look at my plugin

Here are a few of the plug-ins I use in my daily development. The following is a list of plug-ins I have installed for my IDEA. These are the plug-ins THAT I have saved after using them for a long time and are worth installing. The one I coded was the company’s internal plug-in.

IDEA Plug-in Installation

IDEA plug-in installation is very simple, for many plug-ins, as long as you know the name of the plug-in can be directly installed in IDEA.

Preferences– >Plugins– > Find the required plug-ins –>Install

or

Preferences– >Plugins– >Install Plug from disk –> Select the downloaded plug-in to Install

After the installation, restart IDEA to take effect

IDEA Plug-in Repository

IntelliJ IDEA has inspired many Java developers to write plug-ins, and IntelliJ IDEA Plugins (plugins.jetbrains.com/?idea) currently contain over 3000 plug-ins and growing.

The basic function

The IntelliJ IDEA version the author is currently using is Professional Edition 2018.2.4 (Ultimate Edition)

Many of the functions provided in the plug-in have been integrated in this version, here is a simple few may be more commonly used, these several functions do not need to install the plug-in.

The background image

Currently, IDEA supports setting background images. This is a good feature for programmers. Working with boring code all day can be exhausting. If you can set up a picture of a beautiful woman…

Set the method

Ctrl+Shift+A(or help -> find Action) call the popover and type Set Background Image

Set the Image to “Image” and set the opacity to about 15. Save.

Results the following

Built-in terminal

At present, IntelliJ IDEA already has a built-in terminal tool, which can easily use shell commands.

Built-in support

At present, many support plug-ins have been built into many new versions of IntelliJ IDEA, such as markdown Support, UML support and Android support.

PS: Since the author is using the professional edition, IT is not known whether the community edition will also have these plug-ins built-in, if not, readers can download the relevant plug-ins and install them according to their needs.

With markdowm Support, you can preview the content of the MD syntax directly.

Necessary plug-in

Maven Helper

Today, much of Java development uses Maven for project management and automated builds.

In daily development, you may encounter jar conflicts and other problems, so you need to check the dependency status by looking at the Maven dependency tree. This approach is not very efficient, so I recommend a plug-in that, after installation, opens the POM file directly to view the dependency count and automatically analyzes for jar package conflicts.

Once the Maven Helper plug-in is installed, you can open the Dependency Analyzer view of the POM file by simply opening it (after the file is opened, a TAB will appear below the file).

After entering the Dependency Analyzer view, there are three viewing options, Conflicts, All Dependencies as List, and All Dependencies as Tree respectively. The page also supports search.

FindBugs-IDEA

Many of you are familiar with FindBugs. There are plug-ins in Eclipse that help you find hidden bugs in your code, including IDEA.

The way to use it is simple: you can finbugs multiple levels of content

A view prompts you after the analysis, specifying what kind of problem it is.

Alibaba code protocol detection

On October 14, 2017, Hangzhou Cloud Computing Conference, the global launch ceremony of Java code protocol scanning plug-in was officially launched, and the specification was officially opened to the industry in the form of plug-in, leading the way of Java language specification.

Java code specification scan plug-in to the “Alibaba Java development specification” issued at the beginning of this year as the standard, as Eclipse, IDEA plug-in form exists, detect the existence of non-standard location in Java code and then give hints. The statute plug-in is developed using kotlin language, interested students can go to open the plug-in source code.

The Alibaba protocol plug-in contains three sub-menus: code protocol scan, close the test detection function.

Also, the plug-in supports prompting while writing code,

This plug-in, really can greatly improve the quality of the code, be sure to install.

GsonFormat

In Java development, there is often a need to convert json content into Object. For example, when a project partner provides you with a JSON request/ Response format, you need to define it as a Java class. The GsonFormat plug-in can achieve this function.

Lombok plugin

In Java, we often define many Javabeans. These beans need to have getters, setters, toString, equals, hashCode, and so on.

Normally, we can generate this code using the IDEA shortcut keys, but automatically generated code, if the bean properties are changed, need to be generated again, which adds some burden to the code maintenance.

There is a great plugin that can help developers save this work. Lombok.

Once the plug-in is installed in IDEA, just add a line of annotation code to the JavaBean and the plug-in automatically generates getters, setters, toString, equals, hashCode, and other methods for us.

Of course, these methods are needed not only for code calls in the IDE, but also for real online deployment, so you need to use Maven to introduce a Lombok package.

< the dependency > < groupId > org. Projectlombok < / groupId > < artifactId > lombok < / artifactId > < version > 1.16.10 < / version > </dependency> /** * @author Hollis */ public class HollisLab { public static void main(String[] args) { Wechat wechat = new Wechat(); wechat.setId("Hollis"); SetDesc (" Updated Java technology articles daily "); System.out.println(wechat); } } @Data class Wechat { private String id; private String desc; }Copy the code

Output result:

Wechat(id=Hollis, desc= daily update Java technology articles)Copy the code

We added the @data annotation to the Wechat class, and the plugin automatically added getter/setter and toString methods for us.

String Manipulation

Strings are often used in everyday development, but different string types may have different rules in different places, such as class names should be humped, constants should be all uppercase, and sometimes also need to be encoded and decoded. String Manipulation is a powerful String Manipulation tool.

To see just how powerful it is, take a look at its list of features:

  • Text conversion operation
    • Hyphen-lowercase, hyphen-uppercase, snake_case, SCREAMING_SNAKE_CASE, dot. Case, words lowercase, Words Capitalized, PascalCase)
    • Convert to SCREAMING_SNAKE_CASE (or convert to camelCase)
    • Convert to snake_case (or convert to camelCase)
    • Convert to dot.case (or convert to camelCase)
    • Convert to hyphen-case (or convert to camelCase)
    • Convert to hyphen-case (or convert to snake_case)
    • Convert to camelCase (or convert to Words)
    • Convert to camelCase (or lowercase Words)
    • Convert to PascalCase (or convert to camelCase)
    • Select uppercase text
    • Style inversion
  • Un/Escape
    • Un/Escape Selected Java text
    • Un/Escape Selected javascript text
    • Un/Escape The HTML text selected
    • Un/Escape Selected XML text
    • Un/Escape Selected SQL text
    • Un/Escape Selected PHP text
    • Convert Diacritics (Accents) to ASCII
    • Converts non-ASCII to escaped Unicode
    • Converts escaped Unicode to a string
  • Encode/Decode
    • Encode selected text is MD5 Hex16
    • The text selected by De/Encode is the URL
    • De/Encode selected text is Base64
  • Increase/decrease
    • Incrementing/decrementing all numbers found
    • Copy the rows and increment/decrement all the numbers found
    • Create a sequence: Keep the first number and incrementally replace all other numbers
    • Incrementing the repeated number
  • Sort in natural order
    • According to the line of reverse
    • Sort randomly by row
    • Case-sensitive A-Z sort
    • Case sensitive z-A sort
    • Case insensitive A-Z sort
    • Case insensitive z-A sort
    • Sort by line length
    • Sort by subselection line: only one selection/caret is processed per line
  • alignment
    • Formats the selected text as a column/table with the selected delimiter
    • Align the text left/center/right
  • Filter/delete/Remove
    • Grep the selected text, and all lines that do not match the input text will be deleted. (Does not work in column mode)
    • Removes the selected text
    • Removes all whitespace from the selected text
    • Deletes all Spaces in the selected text
    • Delete duplicate rows
    • Only duplicate rows are kept
    • Remove empty lines
    • Delete all newline characters
  • other
    • Swap characters/selections/lines/markers
    • Toggle file path separators: Windows < – > UNIX

After the plug-in is installed, select the content to be processed and press Alt+ M to display the tool function list.

A very good and powerful string processing tool.

.ignore

At present, a lot of development is using Git as a version control tool, but sometimes there is some code that we do not want to mention in our repository, such as some configuration files generated automatically by the IDE, or some JAR files generated by packaging, etc., when you need to write a file. To exclude files that do not want to be versioned.

Here is a good plugin. Ignore, he can help us easily generate a variety of ignore files.

After installing the plugin, right-click the project and create a new one. Ignore file option, which can be used to create an ignore file.

In the dialog box that pops up, you can automatically generate a. Ignore file for us. Here we ask it to automatically exclude all files related to IDEA.

Mybatis plugin

Currently, Mybatis is very popular among ORM frameworks. However, Mybatis also has a lot of XML configuration files, which can be difficult to modify.

Here is a recommended artifact, you can edit mybatis files like Java code.

Intellij Idea Mybatis plugin

  • Provides navigation of the Mapper interface and corresponding SQL in the configuration file
  • Automatic completion when editing XML files
  • Use shortcuts to generate XML files and SQL tags according to the Mapper interface
  • Properties in the ResultMap support automatic completion and cascading (attribute A). Attribute B. attribute C)
  • Shortcuts generate @param annotations
  • When editing SQL in XML, parentheses are automatically completed
  • Support parameter auto-completion when editing SQL in XML (identify parameters based on @param annotations)
  • Automatically checks for ID conflicts in Mapper XML files
  • Automatically checks for incorrect attribute values in Mapper XML files
  • Support the Find the Usage
  • Support refactoring from naming
  • Support alias
  • Automatically generates ResultMap attributes

www.oschina.net/p/intellij-…

However, this plug-in is charged, but it does not affect it is really a very practical, can greatly improve the development efficiency of the plug-in. You can use the Free Mybatis Plugin (I haven’t used this plugin yet, but I don’t know whether it works or not).

Key promoter X

For many developers just starting out with IDEA, the most frustrating thing is not knowing what the shortcut keys are.

Using IDEA, if you are using the mouse for everything, then you are not a good programmer.

Here I recommend a plug-in Key Promoter X that can perform shortcut Key prompt.

Key Promoter X is a prompt plug-in, when you use the mouse in IDEA, if the mouse operation can be replaced by shortcut keys, then the Key Promoter X will pop up a prompt box, telling you what shortcut keys can be replaced by this mouse operation.

When I use the mouse to see which classes a method is used by, I will be prompted:

After memorizing this shortcut key, you can use the shortcut key instead of the mouse.

AceJump

After introducing a plug-in that replaces mouse operations with shortcut keys, here’s another one that does away with the mouse entirely: AceJump

AceJump allows you to quickly navigate the cursor anywhere visible in the editor by clicking “CTRL +;” “, then type a character you want to jump to, and then type a matching character to jump to the place you want to challenge.

So if I want to jump to println in this class, as I said above, all I have to do is press CTRL +; , and then enter println to locate the target location.

In the figure above, after I typed pri, the page displayed three options marked with G, H and D respectively. At this time, I only need to press the corresponding letters to quickly locate the specified location, isn’t it very convenient?

activate-power-mode

Finally, there is an activate-power-mode plugin that programmers can install X in front of girls.

After installing the plugin, you’ll be able to add some cool effects to your code:

conclusion

This article introduces a total of 11 software can improve programmer development efficiency, improve the quality of code, improve the mood of coding. Welcome to install and try.