Live templates

Last modified: 22 October 2024

Use live templates to insert common constructs into your code, such as loops, conditions, declarations, or print statements.

To expand a code snippet, type the corresponding template abbreviation and press . Keep pressing to jump from one variable in the template to the next one. Press to move to the previous variable.

The following example shows the use of the custom live template.

https://resources.jetbrains.com.cn/help/img/idea/2024.2/py_live_templates_example.png
Gif