PyCharm Keyboard Shortcuts
PyCharm runs on the same IntelliJ platform as the rest of JetBrains' IDE lineup, which means its shortcut set is dense, consistent across JetBrains products, and built around the idea that nearly every refactoring and navigation action deserves a dedicated key combination rather than relying on a generic command palette alone. The categories that matter most day to day are navigating a Python codebase (jumping to definitions, recently edited files, and symbols), running and debugging code, and the safe-refactoring shortcuts JetBrains IDEs are particularly known for. Windows and Linux share the same Ctrl/Alt-based keymap; Mac uses Cmd/Option, with JetBrains providing a distinct macOS keymap rather than a simple find-replace of the modifier key, so a few bindings genuinely differ in structure, not just key name. This page is written for Python developers already inside PyCharm daily — data scientists working in the Professional edition's scientific tools, backend engineers on a Django or Flask codebase, or anyone who's switched from VS Code and needs a translation layer for muscle memory. Because PyCharm shares its keymap foundation with IntelliJ IDEA, WebStorm, and other JetBrains IDEs, most of what's covered here transfers directly if you ever work across more than one JetBrains product. PyCharm's breakpoint properties popup and its type-inference-aware Extract Method refactor are both genuinely Python-specific implementations rather than generic IDE features ported across languages, since exception-type breakpoints rely on Python's own exception hierarchy, and Extract Method's parameter inference depends on PyCharm's Python-specific static analysis engine understanding duck-typed and dynamically typed code well enough to make a reasonable extraction suggestion.
Navigation
| Action | Windows | Mac | Description |
|---|---|---|---|
| Search Everywhere | Shift+Shift (double tap) | Shift+Shift | Hitting Shift twice in quick succession opens PyCharm's all-in-one search, scanning files, classes, symbols, and IDE actions at the same time — useful the moment you know what you're after but not which category it falls into. |
| Go to file by name | Ctrl+Shift+N | Cmd+Shift+O | Opens a fuzzy filename search scoped specifically to files rather than the broader Search Everywhere, useful when you know you want a file and don't want symbol results mixed in. |
| Go to declaration/definition | Ctrl+B | Cmd+B | Follows the symbol under the cursor back to its actual definition, resolving the jump across your own project files and any installed packages in the active virtual environment using PyCharm's code intelligence. |
| Show recent files | Ctrl+E | Cmd+E | Shows a short chronological stack of files you've had open recently, quicker to scan than typing into Go to File when the file you want is simply whatever you were looking at a few minutes back. |
| Find Usages | Alt+F7 | Option+F7 | Scans the project for every place the symbol under the cursor gets used and lists them in a dedicated results panel, the context-gathering step worth doing before touching a function or class that other code might depend on. |
| Navigate back to previous location | Ctrl+Alt+Left | Cmd+Option+Left | Steps back through your recent navigation history across files and positions, letting you return to where you were before a Go to Declaration or Find Usages jump took you elsewhere. |
Refactoring
| Action | Windows | Mac | Description |
|---|---|---|---|
| Rename symbol (safe refactor) | Shift+F6 | Shift+F6 | Renames the symbol under the cursor and every genuine reference to it across the project, using PyCharm's understanding of Python scoping rather than blind text replacement. |
| Extract variable | Ctrl+Alt+V | Cmd+Option+V | Pulls the selected expression out into a new local variable, automatically replacing the original expression with a reference to it and prompting for a variable name. |
| Extract method/function | Ctrl+Alt+M | Cmd+Option+M | Lifts the highlighted block out into a brand-new function, leaving a call to it behind in the original spot, and works out the parameter list on its own from whatever variables the extracted code actually uses. |
| Optimize imports | Ctrl+Alt+O | Ctrl+Option+O | Clears out import lines the file no longer references and rearranges what's left to match PyCharm's configured import ordering, tidying up the top of the file in a single pass. |
| Reformat code | Ctrl+Alt+L | Cmd+Option+L | Rewrites the current file's whitespace, indentation, and line-wrapping to match whatever code style is configured for the project, and most Python teams run it right alongside Optimize Imports as a pre-commit pair. |
| Open Refactor This menu | Ctrl+Alt+Shift+T | Ctrl+T | Opens a context-aware menu listing every refactoring applicable to whatever is currently selected, including Extract Method, which in PyCharm's Python-specific implementation infers parameter types from PyCharm's type inference engine and offers a live preview diff before committing the change, distinguishing it from a purely mechanical text-extraction refactor. |
Run Debug
| Action | Windows | Mac | Description |
|---|---|---|---|
| Run current file/configuration | Shift+F10 | Ctrl+R | Executes the current run configuration, whether that's the active file or a previously configured run target like a Django server or test suite. |
| Debug current file/configuration | Shift+F9 | Ctrl+D | Starts the current run configuration under the debugger, stopping at any breakpoints set in the code. |
| Toggle breakpoint | Ctrl+F8 | Cmd+F8 | Toggles a breakpoint marker onto or off the current line — a red dot in the gutter — so a running debug session pauses right there the next time execution reaches it. |
| Step Over (debug) | F8 | F8 | Advances past the current line without descending into any function it calls. Because Python resolves so much at runtime, stepping into unfamiliar third-party library internals by accident is a common annoyance during debugging — PyCharm lets you mark specific libraries as 'do not step into' in its debugger settings so this command reliably skips past them even when a stray Step Into is pressed instead. |
| Add conditional or logging breakpoint | Right-click gutter breakpoint > Condition/Log | Right-click gutter breakpoint | Right-clicking an existing breakpoint (set via Ctrl/Cmd+F8) opens a small popup for adding a condition expression, a log message, or an evaluate-and-log action without stopping execution — PyCharm's breakpoint properties dialog also supports Python-specific exception breakpoints that trigger on a raised exception type rather than a fixed line. |
| Evaluate expression (debug) | Alt+F8 | Option+F8 | Opens a dialog for evaluating an arbitrary Python expression using the paused debug session's current variable scope, letting you inspect or even call a function live without adding a temporary print statement to the code. |
Frequently Asked Questions
Why does Mac use completely different shortcuts in some cases, not just Cmd instead of Ctrl?
JetBrains maintains a genuinely separate macOS keymap rather than a simple modifier substitution, partly to avoid colliding with macOS system-reserved shortcuts and partly because some Windows/Linux bindings (like Ctrl+E for Recent Files) had no natural Mac equivalent without conflicts, so JetBrains chose different combinations outright for several actions rather than forcing a literal swap.
Is Rename really safe across an entire project?
For symbols PyCharm can statically resolve — most well-typed, conventionally structured Python code — yes, it correctly finds and updates genuine references project-wide. Highly dynamic code (heavy use of getattr, string-based attribute access, or metaprogramming) can confuse static analysis, in which case Rename may miss references that aren't resolvable without actually running the code.
What's the practical difference between Search Everywhere and Go to File?
Search Everywhere casts the widest net, searching files, classes, symbols, and even IDE settings and actions in one unified result list. Go to File deliberately narrows the search to just filenames, which produces a shorter, more predictable list when you already know you're looking for a file specifically rather than a class or function.
What's the difference between Find Usages and Go to Declaration?
Go to Declaration (Ctrl/Cmd+B) takes you to the single location where a symbol is originally defined — its one source of truth. Find Usages (Alt/Option+F7) does the reverse, gathering every place that symbol is referenced throughout the project into a results list, which is the action you want before renaming, deleting, or changing the signature of something to understand the actual blast radius of that change.
Should Reformat Code and Optimize Imports be run together before every commit?
Many teams do exactly that, often via a pre-commit hook or a single combined action, since both are non-semantic cleanups (they change whitespace and import ordering, not logic) and running them consistently keeps diffs focused on actual code changes rather than incidental formatting noise that has nothing to do with the substance of a given commit.
How does PyCharm's breakpoint system differ from a plain line breakpoint in another IDE?
PyCharm supports conditional breakpoints (only pausing when a typed Python expression evaluates true), logging breakpoints (printing a message or evaluating an expression without actually pausing execution), and Python-specific exception breakpoints that trigger whenever a chosen exception type is raised anywhere in the codebase rather than at one specific line, all configured through the same right-click breakpoint properties popup rather than requiring separate dedicated tools for each variant.