My IntelliJ IDEA customization

Posted on Sun 28 Sep 21:51 2014  Modify on Tue 14 Oct 16:37 2014

IntelliJ IDEA is a full-featured IDE with a high level of usability and outstanding advanced code editing and refactoring support. I turned to that since 2012, now I'm a big fans of JetBrains series. I'm enthusiasm for customizing my IDE. As some records for my development life. I wish to show here about all my settings.

General Settings

As the most popular way, I applied the Darcula theme as well. I got used to the Ubuntu font when I developing on Ubuntu platform, thus I followed my habit.

Because I'm work in China, so I must make the IDE supports Chinese without problems. I prefer Microsoft YaHei and Consolas, so I finally found a font which mix them into one.

Keymap

Start from Eclipse, I enjoy to use shortcut key to speed up my developing. Now I absolutely broke away the Mouse in my job, only the Keyboard. The reason of why I can do that is I've been changed plenty key settings to fulfill my desires with the Keyboard rather than the Cursor. Eventually I almost own all the frequently-used keys.

Shortcut Key Understanding
Alt+Shift+Z Code > Generate... : Invoking the Generate menu. This quick menu is helpful, I often use it to generate Getter and Setter, Override parent's methods.
Ctrl+Shift+F Code > Reformat Code... : Reformat the caret pointing to file code.
Ctrl+Shift+O Code > Optimize Imports... : An unnecessary imports would never be a good thing. Especially for a person who pursue of perfect like me. Always keep your imports optimized and rearrange those statements.
e.g. before is :

after optimize :
Alt+Up/Down Code > Move Statement Up/Down : Swapping the caret laying on code block by block. e.g. swap of while block and if block, before is :

After press Alt+Up :
Ctrl+Shift+. Code > Folding > Fold Selection/Remove region : Expand/collapse the code block. Can be beneficial while checking a big file.
Ctrl+Shift+Down Edit > Duplicate Lines : Duplicating the caret laying on line or selecting lines at below. e.g. duplicate an if block, before is :

After performed :
Ctrl+Shift+U Edit > Toggle Case : Toggle between uppercase and lowercase for the caret laying on code block or selecting text.
Ctrl+Shift+C Edit > Copy Paths : Copy the caret pointing to resource's absolute path to the Clipboard.
Ctrl+Shift+V Edit > Paste from History... : Display a dialog listed your recent copy string, select one to synchronize to the Clipboard and paste at caret.
Ctrl+,(Comma) Edit > Find Previous : Invoking the finding text view in editor, or navigating the caret to the previous match result after search.
Ctrl+.(Period) Edit > Find Next : Invoking the finding text view in editor, or navigating the caret to the next match result after search.
Alt+Shift+Left/Right Edit > Move caret to code block start/end with selection : Forward or Backward to select code block.
Ctrl+Shift+L Edit > Select Word at Caret : Select the independent word at caret.
Ctrl+M Edit > Scroll to Center : Scroll caret line to center of editor.
Ctrl+Shift+R Navigate > File... : Navigating to a file in project by name.
Ctrl+O Navigate > File Structure : Show us that the IDE recognized file structure.
Ctrl+K Navigate > Implementation(s) : Navigating to the caret laying on method's implementation, display a choose dialog if more.
F3 Navigate > Declaration : Just navigating to the place where the object declaring. Maybe an Interface method means take not valueable code. So I use Ctrl+K all the time.
Ctrl+Shift+J/K Navigate > Previous/Next Highlighted Error : Navigating the caret to previous or next reported error or warning.
Alt+Shift+H Navigate > Select In... : Select a Target to open the caret laying on file.
Ctrl+Q Navigate > Last Edit Location : Navigating the caret to the last edit location.
F2 Refactor > Rename... Renaming correspond.
Alt+Shift+V Refactor > Move... : In Project explorer, move file to another place.
Alt+Enter Other > Show Intention Actions : Showing the caret laying on object's intentions. Sometime are error solutions :
Sometime are optimize advices :
I'm used to pay attention for these tips because I trust IDEA's wisdom for code, they're capable to make my work better.
Ctrl+N Other > Show Context Menu : Showing the caret pointing to resource's menu. Equivalent to use the right mouse button invoke's menu.
Ctrl+Shift+A Help > Find Actions : Typing the action name to perform, you can invoke any action if you have remembered his name.
Ctrl+J Code Completion > Basic : Default key is Ctrl+Space. But it's conflict with System's switch input method key. This customization was inherited since I use Visual Studio 2008 to study .Net. It's within easy reach while we typing with two hands.
Shift+Alt+Space Code Completion > SmartType : Relative to the Basic, this completion will estimate the expression which you just write or the caret laying on, finally supply us some smart suggests.
Alt+Shift+X Run > Run : Running the configuration scheme which the last time has been ran.
Alt+Shift+F10 Run > Run... : Choosing a configuration scheme to run.
Alt+Shift+F9 Run > Debug... : Choosing a configuration scheme to debug.
Ctrl+Shift+B Run > Toggle Line Breakpoint... Handy way to switch the Breakpoint of lines.
Ctrl+Shift+F8 Run > View Breakpoints... : Managing all Breakpoints in project.
Or easily checking the caret laying on Breakpoint's detail :
Alt+Shift+Y View > Compare with Clipboard : Compare the caret laying on file or selecting text with Clipboard.
Alt+Shift+J View > Parameter Info : Checking the method's parameter info.
Alt+Shift+U View > Quick Documentation : Invoking the object(class, method, argument, parameter)'s documentation which the caret standing on.
Ctrl+E View > Recent Files : Show recent files operations.
Ctrl+Shift+I View > Quick Definition : View the caret laying on object's definition.
Alt+1 Tool Windows > Project : Open the Project window.
Alt+2 Tool Windows > Android : Open the Android DDMS window.
Alt+3 Tool Windows > Changes : Open the Changes(Local/Log) window.
Ctrl+Shift+D Window > Hide All Tool Windows : Hide all tool windows, maximize the editor.
Ctrl+W Window > Close Tab : Close a Tab in editor or hide a window in Tools.
Ctrl+Shift+W Window > Close All Tab : Close All Tab in editor.
Ctrl+Shift+N/M Window > Select Previous/Next Tab : Switch the tabs circularly.
Ctrl+Shift+Y File > New... : Showing the new file dialog. Once perform in the editor, means creating a file in the same directory for the editing file.
psvm+Tab Live Templates : Input "psvm" then press Tab, IDEA will generate the java main method, look at the Live Templates for more patterns.
Ctrl+Shift+Z VCS > Show History : Show the caret laying on object's history.
Ctrl+Shift+X VCS > Compare with the Same Repository Version

System Setting

I switch from Windows-style keyboard to Mac OS X. I already got used to the Control key always separated by another key(normally is Windows key). So I did a small remap for my Mac keyboard, swapped the Option(Alt) key and the Command key.

Additional

In the age of Eclipse, we can only compressing the workspace's .metadata folder then keep that package to backup our settings. It's usually being large file and harder to sharing to others.

Thanks for JetBrains, enable us to holding our entire settings through a small size file. Here's all settings of mine that exported from my IDEA. Just import into your IDE if you wants to share my customization.