Skip to content

↑↓ moveEnter openEsc close

Surround with (if, try, with) in PyCharm

PyCharm 2025.2 · 48 shortcuts · checked Nov 2026 · Source: JetBrains docs

In PyCharm, press Option+Cmd+T (Mac), Ctrl+Alt+T (Windows, Linux).

What else uses Option+Cmd+T? · What else uses Ctrl+Alt+T?

More PyCharm shortcuts: editing

ActionMacWindowsLinux
Show intention actions and quick fixesOptionEnterAltEnterAltEnter
Basic completionCtrlSpaceCtrlSpaceCtrlSpace
Parameter infoCmdPCtrlPCtrlP
Reformat codeOptionCmdLCtrlAltLCtrlAltL
Optimize importsCtrlOptionOCtrlAltOCtrlAltO
Comment with line commentCmd/Ctrl/Ctrl/
Duplicate the lineCmdDCtrlDCtrlD
Delete the lineCmdBackspaceCtrlYCtrlY
Move the statement upShiftCmd↑CtrlShift↑CtrlShift↑
Move the statement downShiftCmd↓CtrlShift↓CtrlShift↓

All 13 in editing · All 48 PyCharm shortcuts