IDEA custom template type

Foreword

I do not know Esclipse to IDEA, how many people are not used to. You do not say there are a variety Esclipse smell? But with the integration and the introduction of various frameworks, IDEA alternative Esclipse has become a necessity. All we can do is to adapt faster IDEA. Today we are saying is that we Eclise in a very commonly used shortcut Alt + / how to use (we use most often syso in Eclipse, and then marked Alt + / output can have print statements in the IDEA, but not in IDEA in this way, it has a more powerful template functions)

A. Custom template type (a function similar Esclipse Alt + /)

[1] Create a prompt code

By File-> Settings-> Editor-> Live Templates- > + -> Template Group created our template groups, which help us manage templates
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
click on our custom template set -> + Live Template, we created a template
Here Insert Picture Description
Here Insert Picture Description
Click define defined (for example, here we define as the use of Java)
Here Insert Picture Description
results show
Here Insert Picture Description
then press the Tab key to
Here Insert Picture Description
this simple statement output function is complete, do not look troublesome steps than the Eclipse, but we can set up your own habits of various fast template statement .

[2] set the component content templates (such as html pages related to our style, etc.)

We carried out the appropriate create page content defined by the File-> Settings-> Editor-> File and Code Templates
Here Insert Picture Description

[3] Note Templates settings class (that is, our class annotations head)

We carried out the appropriate create page content definitions> Includes - by File-> Settings-> Editor-> File and Code Templates
Here Insert Picture Description

进行相应类注释内容的添加 如:
/**
  * @Auther: Gs
  * @Date: ${DATE}
  * @Description: ${PACKAGE_NAME}
  * @version: 1.0
  */

Here Insert Picture Description
Results show (when we create a new Hello class, we will find more information on custom annotation):
Here Insert Picture Description

to sum up:

Gradually I found this forgotten ex-girlfriend Eclipse, IDEA can be really too sweet.

Published 51 original articles · won praise 2 · Views 3699

Guess you like

Origin blog.csdn.net/TheWindOfSon/article/details/104435436