The Surround with feature allows you easily put expressions or statements within blocks or language constructs. This feature in PyCharm applies to:

ContextSurround withExample
XML/HTML /XHTML tags wrapTags.png
Python statements
  • if
  • while
  • try/except
  • try/finally
python_wrapStatement.png
Django templates
  • {% if %}
  • {% for %}
  • {% with %}
  • {% block %}
  • Zen coding
python_surroundInTemplate
JavaScript statements
  • (expr)
  • !(expr)
  • if
  • if / else
  • while
  • do / while
  • for
  • try / catch
  • try / finally
  • try / catch / finally
  • with
  • function
  • { }
  • function expression
surround_with_java_script.png
Custom folding region commentsAny fragment of code, where Surround With is applicablecustomFolding1

See Also

Concepts:

Reference:

Web Resources: