# Insert live templates

This page describes how to generate source code using [live templates](using-live-templates.html). To explore the list of available live templates, open the `Settings | Editor | Live Templates` dialog.

Procedure: Insert a live template

1. Place the caret at the desired position where the new construct should be added.

2. Do one of the following:

* From the main menu, choose `Code | Insert Live Template`.

* Press `Ctrl+J` (Windows), `⌘ J` (macOS), `⌘ J` (IntelliJ IDEA Classic (macOS)), `⌘ J` (macOS System Shortcuts), `Ctrl+J` (XWin), `Ctrl+J` (GNOME), `Ctrl+J` (KDE), `Ctrl+J` (Emacs), `Ctrl+J` (Sublime Text), `Ctrl+J` (Sublime Text (macOS)), `⌘ J` (Xcode), `Ctrl+K, X` (Visual Studio), `⌘ E, L` (Visual Studio (macOS)), `Ctrl+J` (ReSharper), `⌘ J` (ReSharper (macOS)), `Ctrl+J` (QtCreator), `Ctrl+J` (QtCreator (macOS)), `Ctrl+J` (NetBeans), `Ctrl+Alt+Shift+J` (Eclipse), `Ctrl+J` (Eclipse (macOS)).

* Type some initial letters of the [template abbreviation](using-live-templates.html#abb) to get the matching abbreviations in the suggestion list. Note that the suggestion list may contain same abbreviations for different templates.

3. From the [suggestion list](auto-completing-code.html#completion_tips), select the desired template. While the suggestion list is displayed, it is possible to view Quick Documentation for the items at caret, by pressing `Ctrl+Q` (Windows), `F1` (macOS), `⌃ J` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Ctrl+Q` (XWin), `Ctrl+Q` (GNOME), `Ctrl+Q` (KDE), `Ctrl+Q` (Emacs), `Ctrl+Q` (Sublime Text), `Ctrl+Q` (Sublime Text (macOS)), `⌘ ⌃ ⇧ /` (Xcode), `Ctrl+K, I` (Visual Studio), `⌘ K, I` (Visual Studio (macOS)), `Ctrl+Q` (ReSharper), `⌃ Q` (ReSharper (macOS)), `Ctrl+Q` (QtCreator), `Ctrl+Q` (QtCreator (macOS)), `Ctrl+Q` (NetBeans), `Alt+Middle-Click` (Eclipse), `⌥ Middle-Click` (Eclipse (macOS)).

![List of the available live templates](https://resources.jetbrains.com/help/img/idea/2026.2/cl_qsg_livetemplates_before.png)

4. Press the template invocation key (this may be `Space` (Windows), `Space` (macOS), `Space` (IntelliJ IDEA Classic (macOS)), `Space` (macOS System Shortcuts), `Space` (XWin), `Space` (GNOME), `Space` (KDE), `Space` (Emacs), `Space` (Sublime Text), `Space` (Sublime Text (macOS)), `Space` (Xcode), `Space` (Visual Studio), `Space` (Visual Studio (macOS)), `Space` (ReSharper), `Space` (ReSharper (macOS)), `Space` (QtCreator), `Space` (QtCreator (macOS)), `Space` (NetBeans), `Space` (Eclipse), `Space` (Eclipse (macOS)), `Tab` (Windows), `⇥` (macOS), `⇥` (IntelliJ IDEA Classic (macOS)), `⇥` (macOS System Shortcuts), `Tab` (XWin), `Tab` (GNOME), `Tab` (KDE), `Tab` (Emacs), `Tab` (Sublime Text), `⇥` (Sublime Text (macOS)), `⇥` (Xcode), `Tab` (Visual Studio), `⇥` (Visual Studio (macOS)), `Tab` (ReSharper), `⇥` (ReSharper (macOS)), `Tab` (QtCreator), `⇥` (QtCreator (macOS)), `Tab` (NetBeans), `Tab` (Eclipse), `⇥` (Eclipse (macOS)) or `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)), depending on the template definition). The new code construct is inserted in the specified position.

![The result of inserting a live temlate](https://resources.jetbrains.com/help/img/idea/2026.2/cl_qsg_livetemplates_after.png)

5. If the selected template is [parametrized and requires user input](using-live-templates.html#param), the editor enters the template editing mode and displays the first input field highlighted with the red frame. Type your value in this frame and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) or `Tab` (Windows), `⇥` (macOS), `⇥` (IntelliJ IDEA Classic (macOS)), `⇥` (macOS System Shortcuts), `Tab` (XWin), `Tab` (GNOME), `Tab` (KDE), `Tab` (Emacs), `Tab` (Sublime Text), `⇥` (Sublime Text (macOS)), `⇥` (Xcode), `Tab` (Visual Studio), `⇥` (Visual Studio (macOS)), `Tab` (ReSharper), `⇥` (ReSharper (macOS)), `Tab` (QtCreator), `⇥` (QtCreator (macOS)), `Tab` (NetBeans), `Tab` (Eclipse), `⇥` (Eclipse (macOS)) to complete input and pass to the next input field. After completing the last input field, the caret moves to the end of the construct, and the editor returns to the regular mode of operation.

It is also possible to type a template abbreviation, and then press `Ctrl+J` (Windows), `⌘ J` (macOS), `⌘ J` (IntelliJ IDEA Classic (macOS)), `⌘ J` (macOS System Shortcuts), `Ctrl+J` (XWin), `Ctrl+J` (GNOME), `Ctrl+J` (KDE), `Ctrl+J` (Emacs), `Ctrl+J` (Sublime Text), `Ctrl+J` (Sublime Text (macOS)), `⌘ J` (Xcode), `Ctrl+K, X` (Visual Studio), `⌘ E, L` (Visual Studio (macOS)), `Ctrl+J` (ReSharper), `⌘ J` (ReSharper (macOS)), `Ctrl+J` (QtCreator), `Ctrl+J` (QtCreator (macOS)), `Ctrl+J` (NetBeans), `Ctrl+Alt+Shift+J` (Eclipse), `Ctrl+J` (Eclipse (macOS)).

