PyCharm 3.4.0 Web Help

File | Settings | Project Settings | Code Style - General

settings

Use this page to configure line separator and indentation options for the various languages. When reformatting source code, PyCharm will apply the specified indentation behavior, and skip the sections denoted with the special formatting off/on markers.

Line separators

Item Description
Line Separator (for new files) Use this drop-down list to specify which line separator is to be used in files created by PyCharm. The available options are:
  • System dependent - choose this option to use the default selection.
  • Unix - choose this option to use the Unix line separator.
  • Windows - choose this option to use the Windows line separator.
  • Mac - choose this option to use the Mac line separator.

Refer to the section Configuring Line Separators.

Right Margin (columns) In this text box, specify the number of columns to be used to display pages in the editor.
Wrap when typing reaches right margin Select this check box to ensure that edited text always fits in the specified right margin.

Default indent options

Item Description
Use tab character
  • If this check box is selected, tab characters are used:
    • On pressing the TabTabTabTabTabTabTabTabTabTabTab key
    • For indentation
    • For code reformatting
  • When the check box is cleared, PyCharm uses spaces instead of tabs.
Smart tabs
  • If this check box is selected, PyCharm inserts tabs for indentation and reformatting, but fine alignment to a necessary column is done only via spaces without replacing them with tabs. This is done in order to preserve visual representation of the source code, when the Tab Size is changed.
  • If this check box is cleared, only tabs are used. This means that a group of spaces that fits the specified tab size is automatically replaced with a tab, which may result in breaking fine alignment.

The Smart Tabs check box is available if the Use Tab Character check box is selected.

Tab size In this text box, specify the number of spaces included in a tab.
Indent In this text box, specify the number of spaces (or tabs if the Use Tab Character check box is selected) to be inserted for each indent level.
3.0+

Formatter options

Item Description
Enable formatter markers in comments If this check box is selected, the fields below become available. The formatting markers specified below turn off and on reformatting of the source code.
Markers
Formatter off: Specify here the textual marker after which code reformatting will not take place, or accept the default.
Formatter on: Specify here the textual marker after which code reformatting will resume, or accept the default.
Regular expressions If this check box is selected, regular expressions can be used in the formatter on/off fields instead of the fixed markers.

See Also

Procedures:

Reference:

Web Resources: