Common shortcut keys
Shift+enter: Inserts a new row below the current line, which is value when the cursor is in the middle of a line
Ctrl+shift+enter: Inserting a new row on the current line
Ctrl+d: Delete entire row
Ctrl+alt+j: Merge line, equivalent to J in VI
Ctrl+alt+up/down: Copy rows up/down
Alt+up/down: Line up/down move
F2: Show Tip
Ctrl+shift+f:format, formatting documents
Ctrl+alt+/:word Auto-complete
Ctrl+1: Fast fix (quick fix)
alt+/: Content Assist, for activating input templates, etc.
Input template (Java)
How to use: Enter the name of the template, and then use the alt+/shortcut key
Cast
${type} ${new_name} = (${type}) ${name};
Catch:
catch (${exception} ${exception_variable_name}) {
${cursor}//${todo}: Handle exception
}
Do
do {
${line_selection}${cursor}
} while (${condition:var (Boolean)});
Else
else {
${cursor}
}
ElseIf
else if (${condition:var (Boolean)}) {
${cursor}
}
For
for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
${line_selection}${cursor}
}
Foreach:
For (${iterable_type} ${iterable_element}: ${iterable}) {
${cursor}
}
If
if (${condition:var (Boolean)}) {
${line_selection}${cursor}
}
instanceof:
if (${name:var} instanceof ${type}) {
${type} ${new_name} = (${type}) ${name};
${cursor}
}
Main
public static void Main (string[] args) {
${cursor}
}
New
${type} ${name} = new ${type} (${arguments});
Private_method:
Private ${return_type} ${name} (${}) {
${cursor}
}
Private_static_method:
private static ${return_type} ${name} (${}) {
${cursor}
}
Protected_method:
Protected ${return_type} ${name} (${}) {
${cursor}
}
Public_method:
Public ${return_type} ${name} (${}) {
${cursor}
}
Runnable
New Runnable () {
public void Run () {
${line_selection}
}
}
Static_final:
${visibility:link (public,protected,private)} static final ${type:link (String,int)} ${name};
Switch
Switch (${key}) {
Case ${value}:
${cursor}
Break
Default
Break
}
Synchronized
Synchronized (${mutex:var}) {
${line_selection}
}
Syserr:
System.err.println (${word_selection}${}); ${cursor}
Sysout:
System.out.println (${word_selection}${}); ${cursor}
Systrace:
System.out.println ("${enclosing_type}.${enclosing_method} ()");
Test
public void Test${name} () throws Exception {
${cursor}
}
ToArray
(${type:elemtype (collection)}[]) ${collection}.toarray (new ${type}[${collection}.size ()))
Try
try {
${line_selection}${cursor}
} catch (${exception} ${exception_variable_name}) {
${todo}: Handle exception
}
While
while (${en:var (java.util.Enumeration)}.hasmoreelements ()) {
${type:argtype (en)} ${elem:newname (type)} = (${type}) ${en}.nextelement ();
${cursor}
}
Java shortcut keys