IntelliJ Idea's usage experience

Source: Internet
Author: User
Tags comments reserved

First, about the new project, the introduction of engineering, configuration Jdk,tomcat here do not do too much to tell, must network on this kind of configuration a bunch of.

Second, coding shortcut keys (more commonly used shortcut keys) The set of shortcut keys selected is: Mac OS X 10.5+

1,    alt+f7 very very frequent use of a shortcut key, can help you find   your function or variable or the class of all references to the place.
2,    cmd+e     Recent Files
3,    cmd+r   replacement
4,    shift+enter   Another line
5,    Shift+f6    It's a very, very easy shortcut, you can rename your classes, methods, variables, and so on, and this renaming can even choose to replace the content in the comments
6,    cmd+k          commit code to CVS
7,    cmd +t            Update Code
8,    ctrl+enter  Generator (getter/setter)
9,    alt+enter  absolute Divine shortcut keys from CVS. Intelligent Optimization Code
10,    alt+cmd+l    code formatting shortcut keys
11,    atrl+o        override or implementation (overwrite) method
12,    cmd+o            Find class
13,    cmd+shilf+o Find File
14,    cmd+b            Find class declaration (Find all references to method, similar shortcut key: ALT+F7)
15,    Cmd+alt +b   Find class implementation
16,    cmd+u            Parent class or Parent method (Super-class, Super-method)
17,    ctrl+shilf+b  Find type declaration source
18,    ctrl+h            View the class's inheritance relationship
19,    cmd+f12        Displays the structure of the current class (outline) that is: Methods and properties
20,    F1                Display Document comments
21,    cmd+alt+t      Select code block, quickly generate surround with, including if...else/try...catch/do...while/while/ Runnable et cetera
22,    ctrl+alt+o    Optimization Import Package
23, Cmd+g Select the next word, select a word in a file, and then every time cmd+g find the next occurrence of the word position, Very useful shortcut keys, plus shift into the previous one.

Third, the theme of the adjustment bias

The default has two kinds of themes, the individual prefers the black cool theme, looks very windy has the wood to have ...

No nonsense, the black theme has been very cool, the default code color is very cool, but some local variables, single-line comments, such as the theme of the color is not too clear

Original self-brought theme

I modified the look:

Modify the method: Preferences-->editor-->colors-->java in accordance with their preferences to set.

Third, the Code standard chapter

1. Use Eclipse's Codeformatter format code.

To download the plugin: Eclipse Code Formatter Plugin

Then configure the following figure, Codeformatter.xml file is already there, import use can, here is the company's coding specification file does not provide O (∩_∩) o~:

2, the configuration of the note template, the specific path is as follows: Editor-->file and Code Templates-->templates under the configuration of classes, interfaces, enumerations, and annotations, these are more commonly required template configuration, as shown below:

Here are a few configurations:

------class------/** * Company * Copyright (C) 2004-${year} All rights Reserved. */#if (${package_name} && ${package_name} = "") package ${package_name}; #end/** * * * @author ${user} * @ver

sion \ $Id ${name}.java, v 0.1 ${year}-${month}-${day} ${time} ${user} Exp $$ */public class ${name} {}------interface------
 /** * Company * Copyright (C) 2004-${year} All rights Reserved. */#if (${package_name} && ${package_name} = "") package ${package_name}; #end/** * * * @author ${user} * @ver sion \ $Id ${name}.java, v 0.1 ${year}-${month}-${day} ${time} ${user} Exp $$ * * Public interface ${name} {}------enumeration---
 ---/** * Company * Copyright (C) 2004-${year} All rights Reserved. */#if (${package_name} && ${package_name} = "") package ${package_name}; #end/** * * * @author ${user} * @ver

sion \ $Id ${name}.java, v 0.1 ${year}-${month}-${day} ${time} ${user} Exp $$ * * Public enum ${name} {}------annotations------ /** * Company * Copyright (C) 2004-${year} All rights Reserved. */#if (${package_name} && ${package_name} = "") package ${package_name}; #end/** * * * @author ${user} * @ver sion \ $Id ${name}.java, v 0.1 ${year}-${month}-${day} ${time} ${user} Exp $$ */public @interface ${name} {}

There is getter, setter generation configuration comment template, directly cmd+n call up this page

Modify the desired style template and comments, here is a style:

-------Getter----------/** * Getter method for property <tt> $field. Name</tt>. * * @return Property value of $field. Name */Public # # #if ($field. modifierstatic) Static # # #end $field. Type # # #set ($nam E = $StringUtil. Capitalizewithjavabeanconvention ($StringUtil. Sanitizejavaidentifier ($helper. Getpropertyname ($ field, $project))) #if ($field. Boolean && $field. Primitive) #if ($StringUtil. Startswithignorecase ($name, ' Is ') #set ($name = $StringUtil. Decapitalize ($name)) #else is## #end #else get## #end ${name} () {Retu
RN $field. Name;
}-------Setter----------/** * Setter method for property <tt> $field. Name</tt>. * * @param $field. Name value to being assigned to property $field. Name * * #set ($paramName = $helper. Getparamname ($field, $ Project) Public # # #if ($field. modifierstatic) Static # # #end void Set$stringutil.capitalizewithjavabeanconvention ($St Ringutil.sanitizejavaidentifier ($helper. Getpropertyname ($field, $project)))($field. Type $paramName) {#if ($field. Name = = $paramName) #if (! $field. modifierstatic) this.## #else $classname. # # #end
nd $field. name = $paramName; }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.