Live Templates in IntelliJ Not Working?

Viewed 2560

When I create a new Java project and a class for it and try to use shortcuts like sout +tab, it just highlights sout in red and does not do the println shortcut.

I checked my Live Templates settings in Editor/Settings but everything looks fine. I've restarted IDEA and created another new Java project and nothing changed. What do I need to do to enable Live Templates?

Edit: enter image description here

enter image description here

3 Answers

If someone still have problem try to define it everywhere look on below image: enter image description here

Make sure your Code Completion preferences are checked.

enter image description here

with Postfix code completion somewhat like:

enter image description here

Note: I am using Mac OSX 10.5+ keymap as the default keymap for my IDE.

Template sout is context sensitive. Will not work inside a class you just created.

Define a main method (you can use main shortcut for it). Try sout inside the main method.

public static void main(String[] args) {
    sout<Tab>
}

or inside a static block

class SoutCheck {
    { 
       sout<Tab>
    }
}
Related