# Postfix completion

> **Warning:**
> Postfix completion is currently not available for C/C++.

With postfix templates, you can transform an already-typed expression to a different one based on a postfix after the dot, the type of the expression, and its context. CLion includes a set of predefined postfix completion templates that you can use for other programming languages as well. You can copy, enable, and disable these templates.

![Postfix templates in suggestion list](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_postfix_completion_list.png)

In CLion, postfix code completion is available for C/C++, [Python](python.html), [Rust](https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-code-completion.html), [JavaScript](javascript-specific-guidelines.html), [TypeScript](typescript-support.html), and [SQL](relational-databases.html).

For C++, postfix completion can be especially useful for the cases of wrapping with a C++-style cast, `make_shared`/`make_unique`, various loops, and `begin`/`end` idioms.

Procedure: Enable and configure postfix completion

* In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), open `Editor | General | Postfix Completion` and select the Enable postfix completion checkbox.

* Enable or disable postfix templates for the selected language.

![Postfix completion settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_postfix_cpp_settings.png)

* Set the `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)), `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)), 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))  key to expand postfix templates.

Procedure: Transform a statement with a postfix

1. Type an expression and then type a postfix after a dot. For example, type `.if`.

2. Press `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)).

Before:

```CPLUSPLUS
void myfunc (int arg) {
    arg.if
}
```

After:

```CPLUSPLUS
void myfunc (int arg) {
    if (arg)
}
```

The initial expression gets wrapped with an `if` statement.

Postfix completion options are shown as part of the basic completion suggestion list. To see a full list of postfix completions applicable in the current context, 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)).

Procedure: Edit a postfix template name

You can edit the predefined postfix templates, for example, to replace a long key with a shorter one, or to expand the list of applicable expression types.

> **Note:**
> Editing and creating custom postfix templates is currently not available for C/C++.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | General | Postfix Completion`.

2. Double-click a template name in the tree or click the ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.edit.svg) icon above the list of templates and edit it as required.

![Editing a template name](https://resources.jetbrains.com.cn/help/img/idea/2026.2/cl_postfix_cpp_edit.png)

> **Note:**
> The `algorithmFunction` and `freeFunction` template names are not editable.

Procedure: Create custom postfix templates (JavaScript, TypeScript, SQL, Rust)

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | General | Postfix Completion`.

2. Click the Add button (![the Add button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)) on the toolbar.

3. In the Create New Template dialog that opens, specify Key, a combination of symbols after the dot that will invoke the template.

4. Select which expression types the new template will be applicable to, and type the target expression in the following format: `$EXPR$ <target_expression>`, for example,  `$EXPR$ =!null`  .

Procedure: Share postfix templates

You can share postfix templates in the following ways:

* Use the Backup and Sync plugin to [synchronize templates and their settings](sharing-your-ide-settings.html#IDE_settings_sync) between IDEs.

* [Manually export postfix](sharing-your-ide-settings.html#import-export-settings) templates from one IDE and import them into another IDE.

## Postfix vs. live templates

Postfix code completion is similar to [live templates](using-live-templates.html) which allow you to create custom constructs to be used anywhere inside your code.

The difference is that live templates insert predefined code snippets, while postfix completion wraps or modifies existing expressions.

## See also

### Settings

[Postfix code completion settings](settings-postfix-completion.html)

