Skip to content

↑↓ moveEnter openEsc close

PyCharm keyboard shortcuts

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

PyCharm is JetBrains' Python IDE. These default keys run and debug scripts, send code to the Python console, navigate a project and refactor.

Most used PyCharm keyboard shortcuts

The PyCharm shortcuts worth learning first. The full list follows, grouped by task.

Run Python code and debug in PyCharm

Run only the selected code
Select lines and press Alt+Shift+E (Option+Shift+E on Mac) to send them to the Python console.
48 shortcuts

Small screen: your system's keys only. Pick another system in the tabs above.

Run and debug

12 shortcuts
ActionMacWindowsLinux
Run the current fileCtrlShiftRCtrlShiftF10CtrlShiftF10
Debug the current fileCtrlShiftDCtrlShiftF9CtrlShiftF9
Run the last configurationCtrlRShiftF10ShiftF10
Debug the last configurationCtrlDShiftF9ShiftF9
Run the selection in the Python consoleOptionShiftEAltShiftEAltShiftE
Toggle a breakpointCmdF8CtrlF8CtrlF8
Step overDebuggingF8F8F8
Step intoDebuggingF7F7F7
Step outDebuggingShiftF8ShiftF8ShiftF8
ResumeDebuggingOptionCmdRF9F9
Run to the cursorDebuggingOptionF9AltF9AltF9
Evaluate an expressionDebuggingOptionF8AltF8AltF8
ActionMacWindowsLinux
Search everywhereShift,ShiftShift,ShiftShift,Shift
Find an actionShiftCmdACtrlShiftACtrlShiftA
Go to a classCmdOCtrlNCtrlN
Go to a fileShiftCmdOCtrlShiftNCtrlShiftN
Recent filesCmdECtrlECtrlE
Go to a lineCmdLCtrlGCtrlG
File structureCmdF12CtrlF12CtrlF12
Go to the declarationCmdBCtrlBCtrlB
Find usagesOptionF7AltF7AltF7
Quick documentationF1CtrlQCtrlQ
Find in filesShiftCmdFCtrlShiftFCtrlShiftF
Replace in filesShiftCmdRCtrlShiftRCtrlShiftR

Editing

13 shortcuts
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↓
Extend the selectionOption↑CtrlWCtrlW
Surround with (if, try, with)OptionCmdTCtrlAltTCtrlAltT
Generate codeCmdNAltInsertAltInsert
ActionMacWindowsLinux
RenameShiftF6ShiftF6ShiftF6
Extract methodOptionCmdMCtrlAltMCtrlAltM
Extract variableOptionCmdVCtrlAltVCtrlAltV
Refactor thisCtrlTCtrlAltShiftTCtrlAltShiftT
TerminalOptionF12AltF12AltF12
Project tool windowCmd1Alt1Alt1
CommitCmdKCtrlKCtrlK
PushShiftCmdKCtrlShiftKCtrlShiftK
SettingsCmd,CtrlAltSCtrlAltS
Show the key map: which keys PyCharm uses mostDarker orange = used by more shortcuts

Comment, format and indent code in PyCharm

Comment multiple lines
Select the lines and press Ctrl+/ (Cmd+/ on Mac); the same keys uncomment them. Ctrl+Shift+/ wraps a selection in a block comment where the language has one.
Indent
Tab and Shift+Tab indent and unindent the selected lines; Ctrl+Alt+I (Ctrl+Option+I) fixes their indentation.
Format JSON and other files
Ctrl+Alt+L (Cmd+Option+L) reformats any open file, including JSON, HTML and SQL.
Collapse all functions
Ctrl+Shift+Minus (Cmd+Shift+Minus) folds every block; Ctrl+Shift+Plus unfolds them.

Terminal, project window and Git shortcuts in PyCharm

  • Project tool windowMacCmd1WindowsAlt1LinuxAlt1
  • CommitMacCmdKWindowsCtrlKLinuxCtrlK
  • PushMacShiftCmdKWindowsCtrlShiftKLinuxCtrlShiftK
  • SettingsMacCmd,WindowsCtrlAltSLinuxCtrlAltS
New file
Select a folder in the Project window and press Alt+Insert (Cmd+N on Mac) to create a Python file or any other file type.
Zoom the editor
Turn on Change font size with Ctrl+Mouse Wheel in Settings > Editor > General, then zoom with the mouse wheel.

Change PyCharm shortcuts or use VS Code keys

Settings > Keymap (Ctrl+Alt+S, or Cmd+Comma on Mac) lists every PyCharm shortcut. PyCharm shares its keymap with the other JetBrains IDEs, so the steps in changing the IntelliJ IDEA keymap work here too.

Coming from VS Code or Jupyter
Pick the VS Code keymap at the top of Settings > Keymap so Ctrl+Shift+P, Ctrl+P and Ctrl+/ behave as you expect; Jupyter notebooks in PyCharm Professional keep the Shift+Enter and Ctrl+Enter keys to run cells.

PyCharm keyboard shortcuts: questions

How do I run a Python file in PyCharm?
Press Ctrl+Shift+F10 (Ctrl+Shift+R on a Mac) to run the file in the editor. Shift+F10 (Ctrl+R on a Mac) runs the last configuration again.
Why are PyCharm keyboard shortcuts not working?
Another program or the system may take the keys first (Ubuntu workspaces use Ctrl+Alt+arrows, macOS uses some F-keys). Check Settings > Keymap for a changed or switched keymap, and on laptops whether F-key shortcuts need Fn.
How do I add a PyCharm shortcut to the desktop on Ubuntu?
Install PyCharm with the JetBrains Toolbox App, which creates the menu and desktop entries for you, or install it as a snap (sudo snap install pycharm-community --classic).

These are the default key bindings in PyCharm 2025.2, as published by JetBrains. Shortcuts that need an extension, an add-in or a changed keymap are left out. Where two combinations do the same thing, both are shown.

Single-system lists: PyCharm keyboard shortcuts for Mac, PyCharm keyboard shortcuts for Windows, PyCharm keyboard shortcuts for Linux.

Each shortcut has its own page with the keys for every system, related shortcuts and the same action in other apps. The printable cheat sheet fits the whole list on one or two pages.