PyCharm

PyCharm Keyboard Shortcuts

Complete PyCharm keyboard shortcuts. Code editing, navigation, debugging, and refactoring shortcuts.

32
Shortcuts
4
Categories
Free
100% Free

PyCharm uses the shared JetBrains keymap, so almost everything on this page also holds in IntelliJ IDEA, WebStorm and GoLand — the differences are in what completion and refactoring know about Python, not in the keys. The table is the default Windows/Linux keymap; PyCharm on macOS substitutes Cmd for most Ctrl bindings and uses its own keymap reference for the rest.

Editing & Code Generation10

Alt+Enter
Quick Fix / Intention
Show quick-fix options for errors or warnings.
Ctrl+Space
Basic Completion
Show basic code completion suggestions.
Ctrl+Shift+Space
Smart Completion
Show type-aware smart completion.
Ctrl+/
Line Comment
Toggle line comment on current or selected lines.
Ctrl+Shift+/
Block Comment
Apply block comment to selection.
Ctrl+D
Duplicate Line
Duplicate the current line or selected block.
Ctrl+Y
Delete Line
Delete the current line.
Ctrl+Alt+L
Reformat Code
Reformat code according to style settings.
Ctrl+Shift+Up/Down
Move Line
Move the current line or block up or down.
Ctrl+Alt+T
Surround With
Surround selected code with if/try/for etc.

Navigation8

Ctrl+P
Find File
Quickly open a file by name.
Shift+Shift
Search Everywhere
Search files, classes, symbols, and actions.
Ctrl+Shift+F
Find in Files
Search text across the entire project.
Ctrl+B
Go to Definition
Navigate to the definition of a symbol.
Alt+F7
Find Usages
Find all usages of the current symbol.
Ctrl+E
Recent Files
Show recently opened files.
Ctrl+G
Go to Line
Jump to a specific line number.
Ctrl+F12
File Structure
Show the class/method structure of the current file.

Run & Debug8

Shift+F10
Run
Run the current configuration.
Shift+F9
Debug
Start debugging the current configuration.
Ctrl+F2
Stop
Stop the running program.
F8
Step Over
Step over to the next line during debugging.
F7
Step Into
Step into a function call.
Shift+F8
Step Out
Step out of the current function.
F9
Resume
Resume execution until the next breakpoint.
Ctrl+F8
Toggle Breakpoint
Add or remove a breakpoint on the current line.

Refactoring6

Shift+F6
Rename
Rename a variable, function, or class everywhere.
Ctrl+Alt+M
Extract Method
Extract selected code into a new method.
Ctrl+Alt+V
Extract Variable
Extract a selected expression into a variable.
Ctrl+Alt+C
Extract Constant
Extract a value into a constant.
Ctrl+Alt+N
Inline Variable
Inline a variable at its usage sites.
F6
Move
Move a class or file to another package.
📜 Source: JetBrains — PyCharm keymap reference (Windows/macOS). Default keymap for the current PyCharm release, listed side by side for Windows and macOS. Checked 2026-09-04. How we verify ›
📄 View Printable Cheat Sheet — Download as PDF or print

Search Everywhere, then everything else

Shift + Shift — a double tap — opens Search Everywhere, a single box that finds files, classes, symbols, actions and settings; for a new user it replaces half the menu bar. Ctrl + P in PyCharm shows parameter info for the call under the cursor rather than opening a file, another point where VS Code habits misfire. Ctrl + B jumps to the definition of the symbol under the cursor and Alt + F7 finds every usage of it, including across the project's virtualenv packages. Ctrl + E lists recent files and Ctrl + F12 pops up the structure of the current file so you can jump to a function by name.

Alt + Enter is the shortcut PyCharm is built around

Alt + Enter shows intentions and quick fixes for whatever is under the cursor: add a missing import, create a function that does not exist yet, convert a string to an f-string, ignore an inspection. Learn it before any other key. PEP 8 formatting (or whatever formatter the project configures) is one keypress, Ctrl + Alt + L, and Ctrl + Alt + T surrounds the selection with an if, try/except, with block or for loop from a list. Ctrl + Shift + Up/Down moves whole statements while keeping indentation valid.

Running and debugging a Python file

Shift + F10 runs the current run configuration and Shift + F9 debugs it; the first time you run a file, PyCharm creates a configuration for it automatically. Ctrl + F8 toggles a breakpoint on the current line, and once stopped, F8 steps over, F7 steps into (including into library code if you allow it) and Shift + F8 steps out. F9 resumes to the next breakpoint. These are identical across the JetBrains family, so a debugger habit built here transfers to Java or Go later.

Refactoring safely

Shift + F6 renames a symbol and updates every reference, including in docstrings if you tick the option. Ctrl + Alt + M extracts a method from the selection, Ctrl + Alt + V extracts an expression into a variable, and Ctrl + Alt + N does the reverse by inlining a variable back into its uses. F6 moves a function or class to another module and rewrites the imports that pointed at it.

Frequently asked questions

Are PyCharm shortcuts the same as IntelliJ IDEA?

Yes. All JetBrains IDEs share the default keymap; only language-specific actions differ.

What does Ctrl + P do in PyCharm?

It shows parameter info for the function call at the cursor. It does not open a file — use Shift + Shift or Ctrl + Shift + N for that.

How do I fix a missing import quickly?

Put the cursor on the unresolved name and press Alt + Enter, then choose the import suggestion.

Can I switch to VS Code keybindings?

Yes. Settings › Keymap includes VS Code, Eclipse and Emacs keymaps, and any binding can be changed individually.

No shortcuts found
Copied!
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

🤖 Ask AI about PyCharm shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok