How to create a new group under Live Templates?


Would anyone know how I can create a custom group (as the top level tree) name to orgainze my own Live Templates under Settings?

Also I found the name "other" is very misleading for many of the Java templates. Shouldn't these be named "Java"? I am suprised that "Java" name is not even in the list!


Comment actions Permalink
Also I found the name "other" is very misleading

That is there because of some historical reasons I think. Select it, right click, select rename. Problem solved ;)

Would anyone know how I can create a custom group

I do not know of a way via the UI. But you can hack one:

  1. Shut down IntelliJ IDEA
  2. Go to ~/.IntelliJIdea12/configs/templates
    1. see if you need assistance finding your configs directory.
  3. Create an XML file with the minimalistic content shown below.
    1. You must have at least one template for it to show in the IDE
    2. The 'group' attribute is the name of the group shown in the IDE
  4. Start IDEA
  5. Add templates to the group and then delete the placeholder template.

  6. <?xml version="1.0" encoding="UTF-8"?>
    <templateSet group="My Group Name">
      <template name="x" value="x" description="x" toReformat="true" toShortenFQNames="true">
        <context />

Comment actions Permalink

Cool. thanks for the details info Mark!

I think IntelliJ should provide a button to support such a simple feature more easily for users. :)

Comment actions Permalink

You can do it in UI -- it's just not obvious at all.

This is the ticket to make it possible (if it ever gets implemented):

Current workflow is:

  1. Create new Live Template anywhere (in any group)
  2. Right click on it and choose "Move | New Group"
Comment actions Permalink

Nice Andriy. Thanks. I did not know that. As you say, it's not obvious.

Comment actions Permalink

Thanks for this tips Andriy!

I have actually opened an feature request for this: before your reply. I have just now updated with your related issue as well.


Please sign in to leave a comment.