Notes on PyCharm

This page is managed by StJohn Piano.

Notes on PyCharm

If you have any questions, comments, corrections, or suggestions - please contact StJohn Piano on Tela:‌‌

Search Everywhere

Tap Shift twice i.e. Shift+Shift (⇧⇧ on macOS) to open the Search Everywhere dialogue.

Include stdout in pytest summary

Run / Edit Configurations / Python tests / [pytest config] / Additional Arguments

Set to "--capture=no"

Include warnings in pytest output

Settings / Advanced Settings

  • Tick: [Pytest: do not add "--no-header --no-summary -q"]

Note: When the same warning occurs multiple times, only the first occurrence is displayed in the warning summary.

Show all tabs in main window

Settings / Editor / General / Editor Tabs / Show tabs in

Select "Multiple rows"

Activate license

  • Purchase license.
  • In PyCharm, log in with your JetBrains account.
  • Help / Register / Activate New License
  • Get license from: JetBrains Account
  • Click "Refresh license list"

Trim whitespace on Save

Settings / Editor / General / On Save

  • Remove trailing spaces on / All lines
  • Keep trailing spaces on caret line
  • Remove trailing blank lines at the end of saved files
  • Ensure every saved file ends with a line break

Note: A "caret line" is a line on which there is an active cursor. To add another cursor on Mac, use Opt-Click.

Move cursor to beginning / end of file

Mac: Cmd + Home, Cmd + End

Close current tab

Mac: Cmd + W

Reopen last closed tab

Right-click any tab and select Reopen Closed Tab from the context menu.

Soft wrap Python files automatically

  • Settings / Editor / General / Soft Wraps
  • Soft-wrap these files: *.md; *.txt; *.rst; *.adoc; *.py; *yml‌‌Note: Use * and ? as wildcards and ; to separate patterns.

Soft wrap output in Run window

On the right-hand side of the Run window, below the up and down arrow buttons, there is a Soft-Wrap toggle button.