PyCharm keyboard shortcuts
PyCharm is JetBrains' dedicated Python IDE, combining intelligent code completion, powerful refactorings, and first-class debugging and testing tools. It shares the IntelliJ platform keymap, so nearly every action has a keyboard route. Learning these shortcuts keeps your hands on the keys and your focus on the code. This cheat sheet covers 74 default shortcuts for Windows and Mac.
General
| Search Everywhere | Double ShiftDouble Shift |
| Find Action | Ctrl+Shift+ACmd+Shift+A |
| Show intention actions / quick fixes | Alt+EnterOption+Enter |
| Open Settings | Ctrl+Alt+SCmd+, |
| Generate code | Alt+InsertCmd+N |
| Paste from clipboard history | Ctrl+Shift+VCmd+Shift+V |
Editing
| Duplicate line or selection | Ctrl+DCmd+D |
| Delete line | Ctrl+YCmd+Backspace |
| Toggle line comment | Ctrl+/Cmd+/ |
| Move line up/down | Shift+Alt+Up/DownShift+Option+Up/Down |
| Move statement up/down | Ctrl+Shift+Up/DownCmd+Shift+Up/Down |
| Reformat code | Ctrl+Alt+LCmd+Option+L |
| Optimize imports | Ctrl+Alt+OCtrl+Option+O |
| Join lines | Ctrl+Shift+JCtrl+Shift+J |
| Toggle case of selection | Ctrl+Shift+UCmd+Shift+U |
| Extend selection | Ctrl+WOption+Up |
| Shrink selection | Ctrl+Shift+WOption+Down |
| Undo | Ctrl+ZCmd+Z |
| Redo | Ctrl+Shift+ZCmd+Shift+Z |
Code Completion & Info
| Basic code completion | Ctrl+SpaceCtrl+Space |
| Smart (type-matching) completion | Ctrl+Shift+SpaceCtrl+Shift+Space |
| Parameter info | Ctrl+PCmd+P |
| Quick documentation | Ctrl+QF1 |
| Surround with (if, try, ...) | Ctrl+Alt+TCmd+Option+T |
| Insert live template | Ctrl+JCmd+J |
Navigation
| Go to class | Ctrl+NCmd+O |
| Go to file | Ctrl+Shift+NCmd+Shift+O |
| Go to symbol | Ctrl+Alt+Shift+NCmd+Option+O |
| Go to line | Ctrl+GCmd+L |
| Go to declaration / usages | Ctrl+BCmd+B |
| Go to implementation | Ctrl+Alt+BCmd+Option+B |
| Find usages | Alt+F7Option+F7 |
| File structure popup | Ctrl+F12Cmd+F12 |
| Recent files | Ctrl+ECmd+E |
| Recent locations | Ctrl+Shift+ECmd+Shift+E |
| Navigate back | Ctrl+Alt+LeftCmd+[ |
| Navigate forward | Ctrl+Alt+RightCmd+] |
| Next error / warning | F2F2 |
| Previous error / warning | Shift+F2Shift+F2 |
Refactoring
| Rename | Shift+F6Shift+F6 |
| Refactor This menu | Ctrl+Alt+Shift+TCtrl+T |
| Extract method | Ctrl+Alt+MCmd+Option+M |
| Extract variable | Ctrl+Alt+VCmd+Option+V |
| Extract constant | Ctrl+Alt+CCmd+Option+C |
| Extract parameter | Ctrl+Alt+PCmd+Option+P |
| Move | F6F6 |
Search & Replace
| Find in file | Ctrl+FCmd+F |
| Replace in file | Ctrl+RCmd+R |
| Find in files (project-wide) | Ctrl+Shift+FCmd+Shift+F |
| Replace in files (project-wide) | Ctrl+Shift+RCmd+Shift+R |
| Find next occurrence | F3Cmd+G |
| Find previous occurrence | Shift+F3Cmd+Shift+G |
Multi-Cursor
| Add selection for next occurrence | Alt+JCtrl+G |
| Unselect last occurrence | Shift+Alt+JCtrl+Shift+G |
| Select all occurrences | Ctrl+Alt+Shift+JCtrl+Cmd+G |
| Add cursor at click position | Shift+Alt+ClickShift+Option+Click |
Run, Debug & Python Console
| Run current configuration | Shift+F10Ctrl+R |
| Debug current configuration | Shift+F9Ctrl+D |
| Run context configuration (file / test at caret) | Ctrl+Shift+F10Ctrl+Shift+R |
| Execute selection in Python console | Shift+Alt+EShift+Option+E |
| Stop | Ctrl+F2Cmd+F2 |
| Toggle breakpoint | Ctrl+F8Cmd+F8 |
| Step over | F8F8 |
| Step into | F7F7 |
| Step out | Shift+F8Shift+F8 |
| Resume program | F9Cmd+Option+R |
| Evaluate expression | Alt+F8Option+F8 |
Version Control & Tool Windows
| Commit changes | Ctrl+KCmd+K |
| Push commits | Ctrl+Shift+KCmd+Shift+K |
| VCS operations popup | Alt+`Ctrl+V |
| Project tool window | Alt+1Cmd+1 |
| Terminal tool window | Alt+F12Option+F12 |
| Hide all tool windows | Ctrl+Shift+F12Cmd+Shift+F12 |
| Return focus to editor | EscEsc |
Put your top PyCharm shortcuts on real keys
The five PyCharm actions most worth binding to a physical macropad key:
Alt+EnterOption+Enter Show intention actions / quick fixes PyCharm's universal fix-it key; the highest-frequency chord in the IDE.
Ctrl+Shift+F10Ctrl+Shift+R Run context configuration Runs the test or script under the caret; the heart of the Python dev loop.
Ctrl+Alt+LCmd+Option+L Reformat code Instant PEP 8 compliance on every save-and-commit cycle.
Shift+Alt+EShift+Option+E Execute selection in Python console REPL-driven development with one physical key.
Shift+F6Shift+F6 Rename Safe project-wide renames are the most-used refactoring.
I hand-build small-batch programmable macropads (QMK/VIA) in Barcelona. One press, any shortcut, any app.
PyCharm shortcut FAQs
Are PyCharm shortcuts the same as IntelliJ IDEA?
Yes. PyCharm is built on the IntelliJ platform and ships the same default keymaps, plus a few Python-specific actions like executing a selection in the Python console (Shift+Alt+E / Shift+Option+E).
How do I run a single Python file or test in PyCharm?
Put the caret in the file or test and press Ctrl+Shift+F10 on Windows or Ctrl+Shift+R on Mac to run the context configuration. Shift+F10 (Ctrl+R on Mac) reruns the last configuration.
How do I see all keyboard shortcuts in PyCharm?
Open Settings (Ctrl+Alt+S on Windows, Cmd+, on Mac) and go to Keymap to browse, search, and remap every action. Double Shift also finds any action by name.
How do I format Python code in PyCharm?
Press Ctrl+Alt+L on Windows or Cmd+Option+L on Mac to reformat according to your code style (PEP 8 by default). Ctrl+Alt+O (Ctrl+Option+O on Mac) cleans up imports.
What does Alt+Enter do in PyCharm?
Alt+Enter (Option+Enter on Mac) opens intention actions and quick fixes: adding imports, fixing type errors, converting code, and other context-aware suggestions.