Skip to content

PyCharm

Comprehensive PyCharm shortcuts and workflows for Python development with Django, Flask, and data science tools.

General Shortcuts

Windows/LinuxmacOSDescription
Ctrl+Shift+ACmd+Shift+AFind Action
Ctrl+Shift+NCmd+Shift+OGo to File
Ctrl+NCmd+OGo to Class
Ctrl+Shift+Alt+NCmd+Option+OGo to Symbol
Ctrl+ECmd+ERecent Files
Ctrl+Shift+ECmd+Shift+ERecent Locations
Ctrl+GCmd+LGo to Line
Ctrl+F12Cmd+F12File Structure
Alt+F1Option+F1Select In
Windows/LinuxmacOSDescription
Ctrl+BCmd+BGo to Declaration
Ctrl+Alt+BCmd+Option+BGo to Implementation
Ctrl+Shift+BCmd+Shift+BGo to Type Declaration
Ctrl+UCmd+UGo to Super Method
Alt+F7Option+F7Find Usages
Ctrl+F7Cmd+F7Find Usages in File
Ctrl+Shift+F7Cmd+Shift+F7Highlight Usages
Ctrl+Alt+F7Cmd+Option+F7Show Usages
Ctrl+ClickCmd+ClickGo to Declaration

Editing

Windows/LinuxmacOSDescription
Ctrl+SpaceCtrl+SpaceBasic Code Completion
Ctrl+Shift+SpaceCtrl+Shift+SpaceSmart Code Completion
Ctrl+Alt+SpaceCtrl+Option+SpaceClass Name Completion
Ctrl+Shift+EnterCmd+Shift+EnterComplete Current Statement
Ctrl+PCmd+PParameter Info
Ctrl+QCtrl+JQuick Documentation
Shift+F1Shift+F1External Documentation
Ctrl+F1Cmd+F1Show Error Description
Alt+InsertCmd+NGenerate Code
Ctrl+OCtrl+OOverride Methods
Ctrl+ICtrl+IImplement Methods

Code Formatting

Windows/LinuxmacOSDescription
Ctrl+Alt+LCmd+Option+LReformat Code
Ctrl+Alt+OCtrl+Option+OOptimize Imports
Ctrl+Alt+ICtrl+Option+IAuto-Indent Lines
TabTabIndent Selection
Shift+TabShift+TabUnindent Selection
Ctrl+Alt+TCmd+Option+TSurround With
Ctrl+/Cmd+/Comment/Uncomment Line
Ctrl+Shift+/Cmd+Shift+/Comment/Uncomment Block

Refactoring

Windows/LinuxmacOSDescription
F5F5Copy
F6F6Move
Shift+F6Shift+F6Rename
Ctrl+F6Cmd+F6Change Signature
Ctrl+Alt+NCmd+Option+NInline
Ctrl+Alt+MCmd+Option+MExtract Method
Ctrl+Alt+VCmd+Option+VExtract Variable
Ctrl+Alt+FCmd+Option+FExtract Field
Ctrl+Alt+CCmd+Option+CExtract Constant
Ctrl+Alt+PCmd+Option+PExtract Parameter

Running and Debugging

Windows/LinuxmacOSDescription
Shift+F10Ctrl+RRun
Shift+F9Ctrl+DDebug
Ctrl+Shift+F10Ctrl+Shift+RRun Context Configuration
Ctrl+Shift+F9Ctrl+Shift+DDebug Context Configuration
F8F8Step Over
F7F7Step Into
Shift+F7Shift+F7Smart Step Into
Shift+F8Shift+F8Step Out
Alt+F9Option+F9Run to Cursor
Alt+F8Option+F8Evaluate Expression

Python-Specific Features

Windows/LinuxmacOSDescription
Ctrl+Shift+F10Ctrl+Shift+RRun Python File
Alt+Shift+F10Option+Shift+RRun Python Console
Ctrl+Alt+SCmd+,Open Settings
Ctrl+Alt+Shift+SCmd+;Project Structure
Ctrl+Shift+ACmd+Shift+AFind Action

Django Shortcuts

Windows/LinuxmacOSDescription
Ctrl+Alt+RCmd+Option+RManage.py Tasks
Ctrl+Shift+XCmd+Shift+XRun Django Server
Ctrl+Alt+GCmd+Option+GDjango Console

Data Science Tools

Windows/LinuxmacOSDescription
Shift+EnterShift+EnterExecute Cell
Ctrl+EnterCmd+EnterExecute Cell (Stay)
Alt+EnterOption+EnterExecute and Insert Below
Ctrl+Shift+ACmd+Shift+AAdd Cell Above
Ctrl+Shift+BCmd+Shift+BAdd Cell Below

Version Control (Git)

Windows/LinuxmacOSDescription
Ctrl+KCmd+KCommit
Ctrl+Shift+KCmd+Shift+KPush
Ctrl+TCmd+TUpdate Project
Alt+9Cmd+9Version Control Tool Window
Ctrl+Alt+ZCmd+Option+ZRollback

Search and Replace

Windows/LinuxmacOSDescription
Ctrl+FCmd+FFind
F3Cmd+GFind Next
Shift+F3Cmd+Shift+GFind Previous
Ctrl+RCmd+RReplace
Ctrl+Shift+FCmd+Shift+FFind in Path
Ctrl+Shift+RCmd+Shift+RReplace in Path

Tool Windows

Windows/LinuxmacOSDescription
Alt+1Cmd+1Project Tool Window
Alt+2Cmd+2Favorites
Alt+3Cmd+3Find Tool Window
Alt+4Cmd+4Run Tool Window
Alt+5Cmd+5Debug Tool Window
Alt+6Cmd+6TODO Tool Window
Alt+7Cmd+7Structure Tool Window
Alt+8Cmd+8Services Tool Window
Alt+9Cmd+9Version Control
Alt+0Cmd+0Messages Tool Window

Best Practices

Virtual Environment Setup

  1. Create Virtual Environment: Use python -m venv venv
  2. Configure Interpreter: File → Settings → Project → Python Interpreter
  3. Install Packages: Use PyCharm's package manager or pip in terminal

Code Quality

  1. Enable Inspections: File → Settings → Editor → Inspections
  2. Use Type Hints: Enable type checking for better code completion
  3. Configure Code Style: File → Settings → Editor → Code Style → Python

Django Development

  1. Enable Django Support: File → Settings → Languages & Frameworks → Django
  2. Configure Templates: Set template directories and language
  3. Database Tools: Use built-in database browser and SQL console

Debugging Tips

  1. Conditional Breakpoints: Right-click breakpoint to add conditions
  2. Exception Breakpoints: Run → View Breakpoints → Python Exception Breakpoints
  3. Remote Debugging: Configure remote interpreter for debugging on servers