Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the configuration of common shortcut keys and comments for IDEA

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about IDEA commonly used shortcut keys and annotation configuration, the editor feels very practical, so share with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.

Friendly Tip: it is also a very water article, recording the keyboard shortcuts commonly used in work.

Shortcut key operation shortcut key search classcommand o find filecommand shift o open recent file command e this class find command f global find command shift f replace command r global replace command shift r selected variable The cursor jumps to the next same variable ctrl g code moves up and down command shift copies a line command d deletes a line command delete toggles case command shift u format alt command L returns where it was last edited alt command finds the methods in the class around the fn command f12import class alt enter removes redundant packages ctrol alt o ends complete command shift enter method parameters prompt command p common method shortcuts command j variables where to use fn alt f7 to generate getter, Setter method command n rename fn shift f6 displays the class diagram of the current class command h jumps to the concrete implementation class method option command b jumps to method declaration command b displays method structure command 7 opens and sets command Merging multiple lines into one line removes blank lines where the ctrl shift j view method is called ctrl option h closes the current class window command w overrides the method control o adds classes, interfaces, enumerations comments

1.command +, open preferences

2. Editor-> File and Code Templates

Scheme Select Default

When Includes- > File Header is selected in the tab, an editable box appears on the right, plus the following code:

# set ($str = "") # set ($stringClass=$str.getClass ()) # set ($localeClass=$stringClass.forName ("java.util.Locale")) # set ($date=$stringClass.forName ("java.util.Date"). NewInstance ()) # set ($locale=$localeClass.getConstructor ($stringClass) .newInstance ("zh_CN")) # set ($dateFormat=$stringClass.forName ("java.text.SimpleDateFormat"). GetConstructor ($stringClass, $localeClass) .newInstance ("yyyy/MM/dd ah:mm") $locale) # set ($fdate=$dateFormat.format ($date)) / * * description * * @ author xxxx * @ Date ${fdate} * /

A lot of the above code is to format the time. If you don't want to set it, you can add the following code:

/ * description * * @ author ${user} * @ Date ${date} ${time} * /

The effect is as follows:

/ * textbook series controller * @ author xxxx * @ date 2019-08-02 PM3:44 * /

Add method comment

1. Edit-> Live Templates, click + in the upper right corner, add Template Group, and name it at will, preferably MyGroup.

two。 Click + to add Live Templates again

3. Click Edit variables and click as shown below.

The effect is as follows:

/ * * description * * @ return * @ date 2019-08-05 AM9:56 * / above are the common shortcut keys and annotation configurations for IDEA. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report