Mac version IntelliJ idea common shortcut keys and configurations

Source: Internet
Author: User
Tags require try catch

Just transferred from Eclipse to IntelliJ idea, sharing some configuration experience, IntelliJ is the best Java development tool in the Smart Code assistant, code automation prompts, refactoring, Java EE support, Ant, JUnit, CVS consolidation, code review, Innovative GUI design features and support for program development based on Android platform.

IntelliJ idea Common Shortcuts Mac version

Command + N Lookup class

Command + SHIFT + N Find File

ALT + ENTER Quick Import class

ALT + Command format code

SHIFT + CONTROL + F Search All Files

SHIFT + COMMAND + u case Conversion

Command + ALT + T
Using * to surround the selected lines of code (* including if, while, try catch, and so on) is also handy, putting what I had to do before: ① first write If-else,② and then adjust the indentation format of the code, and pay attention to whether the parentheses match, now use this function to do, It's much easier (but it makes me lazier)

F2/shift + F2
Jump to the next/previous Error statement the idea provides a convenient jump between error statements, you can use this shortcut to quickly jump between the wrong statement.

Command + Alt + O
Optimizing import automatically removes useless import statements, a pretty good feature.

Command +//[
Jump to the end of the code block/start, this feature VI also have, but also a very common code editing function.

Command + E
can display a list of recently edited files

Command + Shift +backspace
You can jump to the last edit place

Command + F12
can display the structure of the current file

Command + F7
You can query the current element's reference in the current file, and then press F3 to select

Command+alt+v
You can introduce variables. For example, to assign the SQL in parentheses to a variable

Command+shift+f7
You can display the use of the current element in a file

ALT + F7
Find where the method is called

The key style I chose is set in Eclipse (Mac OS X) preferences=>keymaps

Shortcut keys for common use

Code Fill CTRL + Space

Delete line COMMAND + D

Note COMMAND +/

Import Package Command + SHIFT + O

Format Code COMMAND + SHIFT + F

Run Ctrl + ALT + R

Incremental Searchcommand + J enables quick lookup in the editor with contextual search by up and down arrows

Quick definition Command + Y It will play window display the content of the method definition in the suggestion list, if you are not sure which method to use

Find Nextcommand + K

Find Previouscommand + SHIFT + K

Detailed method, class CTRL + click class Name, method

Edit class:

Find/Replace class:

Search class:

To edit a running class:

Debug class:

Navigation class:

Code Refactoring Class:

Vcs/History class:

Dynamic Template classes:

General class:

Adjust the interface for cool black

Preferences=>appearance=>theme=>darcula

To set shortcut keys:

Preferences=>keymaps

Auto-complement:

The default is Clt+space under Mac, and you can use Keymaps=>main menu=>code=>competion settings. A better place than Eclipse is spring, maven XML, and even the Freemarker template and Ibatis sqlmap support highlighting and automatic completion.

To remove the case sensitivity of auto-completion:

Do not know how many children's shoes and I have been spoiled by eclipse, the use of automatic completion is completely not attention to the case, IntelliJ default case-sensitive, very sad. However, in Editor=>code completion, the case sensitive completion set to none is OK.

Expand catalogs Automatically

Eclipse has the ability to automatically expand the directory by opening a file, and in IntelliJ select AutoScroll to Source and AutoScroll from source on the gears in the left column of project.

Automatic compilation

IntelliJ idea the default JDK version changes

IntelliJ The default is not to automatically compile the project, so before run there will be a make process, the habit of automatically compiling the project can be opened here: Compiler=>make Project automatically. Because the IntelliJ project has little space, it will not have a build workspace like Eclipse for a long time after it is turned on.

IntelliJ idea by default, the version of the JDK used is 1.6, and when you first start idea, if the system does not have a JDK installed, the system automatically downloads the JDK installation files to the Apple website. If your system has a jdk1.7 or higher version, it will also require you to install Apple's website jdk1.6 the first time you open idea. To avoid redundant JDK installations, the solution is as follows: Find IntelliJ idea 13 under/applications, right-click-> Display package content->contents-> Info.plist, use a text editor or the default Xcode to open the file and find

IntelliJ idea by default, the version of the JDK used is 1.6, and when you first start idea, if the system does not have a JDK installed, the system automatically downloads the JDK installation files to the Apple website. If your system has a jdk1.7 or higher version, it will also require you to install Apple's website jdk1.6 the first time you open idea.

To avoid redundant JDK installations, the solution is as follows:

Find IntelliJ Idea 13 under/applications, right-click-> Display package content->contents->info.plist, open the file using a text editor or the default Xcode, and locate the following code

<key>JVMVersion</key>
<string>1.6*</string>

Change <string>1.6*</string> to <string>1.7*</string> save.

The JDK used by idea at this point is version 1.7 and above.

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.