IntelliJ IDEA 2022.1 Help

Complete paired characters

IntelliJ IDEA can automatically add closing braces and other paired elements.

Finish code with closing braces

  1. Press Ctrl+Alt+S to open the IDE settings and select Editor | General | Smart Keys.

  2. Select the Insert pair '}' checkbox in the Enter group. This enables adding closing braces when you press Enter.

  3. Configure automatic insertion of other paired elements by selecting these checkboxes:

    • Insert pair brackets (), [], {}, <>

    • Insert pair quote

    • Insert pair %> on Enter in JSP

    • Auto-close tag on typing '</' (on the HTML/CSS page)

    • Auto-insert closing }} and %} in Django templates (on the HTML/CSS page if the Python plugin is installed))

  4. Click OK to apply changes.

The indentation level is defined in the Code Style settings.

Last modified: 16 May 2022