Pycharm Keyboard Shortcuts…

John D Cyber
3 min readOct 14, 2023

One of the most well-known IDEs for Python programming is PyCharm, created by JetBrains. It provides a wide variety of keyboard shortcuts to speed up the coding process. Here are several keyboard shortcuts that may come in handy on Windows, Linux, and macOS:

General

  • Open Quick Search/Navigation:
  • Windows/Linux: Ctrl + N
  • macOS: Cmd + O

Find in File:

  • Windows/Linux: Ctrl + F
  • macOS: Cmd + F

Replace in File:

  • Windows/Linux: Ctrl + R
  • macOS: Cmd + R

Save All:

  • Windows/Linux: Ctrl + S
  • macOS: Cmd + S

Coding Assistance

Auto-Complete Code:

  • Windows/Linux: Ctrl + Space
  • macOS: Ctrl + Space

Quick Documentation:

  • Windows/Linux: Ctrl + Q
  • macOS: F1

Parameter Info:

  • Windows/Linux: Ctrl + P
  • macOS: Cmd + P

Comment/Uncomment Line:

  • Windows/Linux: Ctrl + /
  • macOS: Cmd + /

Navigation

Go to Class:

  • Windows/Linux: Ctrl + N
  • macOS: Cmd + O

Go to File:

  • Windows/Linux: Ctrl + Shift + N
  • macOS: Cmd + Shift + O

Go to Line:

  • Windows/Linux: Ctrl + G
  • macOS: Cmd + L

Find Usages:

  • Windows/Linux: Alt + F7
  • macOS: Cmd + F7

Code Editing

  • Duplicate Line or Selection:
  • Windows/Linux: Ctrl + D
  • macOS: Cmd + D

Delete Line:

  • Windows/Linux: Ctrl + Y
  • macOS: Cmd + Backspace

Expand/Collapse Code Block:

  • Windows/Linux: Ctrl + +/-
  • macOS: Cmd + +/-

Move Line Up/Down:

  • Windows/Linux: Alt + Shift + Up/Down
  • macOS: Cmd + Shift + Up/Down

Reformat Code:

  • Windows/Linux: Ctrl + Alt + L
  • macOS: Cmd + Alt + L

Navigation and Search

Search Everywhere:

  • Windows/Linux: Double Shift
  • macOS: Double Shift

Navigate between open Editor Tabs:

  • Windows/Linux: Alt + Left/Right
  • macOS: Cmd + Shift + [ / ]

Navigate to Last Edit Location:

  • Windows/Linux: Ctrl + Shift + Backspace
  • macOS: Cmd + Shift + Delete

Debugging

Toggle Breakpoint:

  • Windows/Linux: Ctrl + F8
  • macOS: Cmd + F8

Resume Program:

  • Windows/Linux: F9
  • macOS: Cmd + Alt + R

Testing

Run Test:

  • Windows/Linux: Shift + F10
  • macOS: Ctrl + R

Debug Test:

  • Windows/Linux: Shift + F9
  • macOS: Ctrl + D

Navigate Between Test and Test Subject:

  • Windows/Linux: Ctrl + Shift + T
  • macOS: Cmd + Shift + T

Version Control

Show Version Control Window:

  • Windows/Linux: Alt + 9
  • macOS: Cmd + 9

Show Git Log:

  • Windows/Linux: Alt + 9, then 4
  • macOS: Cmd + 9, then 4

Show Diff:

  • Windows/Linux: Ctrl + D (in Version Control window)
  • macOS: Cmd + D (in Version Control window)

File Management

Create New File:

  • Windows/Linux: Alt + Insert
  • macOS: Cmd + N

Close Active Editor Tab:

  • Windows/Linux: Ctrl + F4
  • macOS: Cmd + W

Run/Deployment

Run:

  • Windows/Linux: Shift + F10
  • macOS: Ctrl + R

Stop:

  • Windows/Linux: Ctrl + F2
  • macOS: Cmd + F2

Refactoring

Optimize Imports:

  • Windows/Linux: Ctrl + Alt + O
  • macOS: Cmd + Opt + O

Reformat Code:

  • Windows/Linux: Ctrl + Alt + L
  • macOS: Cmd + Opt + L

References:

1.JetBrains Official Documentation for Keymap

  • This is the official documentation and it provides a comprehensive list of keyboard shortcuts for various operating systems, along with tips and tricks to optimize your workflow using shortcuts.

2. JetBrains Blog

  • The official blog often posts tips, tricks, and updates regarding their IDEs, including PyCharm. It’s a valuable resource for staying updated with new features and best practices.

--

--

Experienced Sr.Security Engineer with demonstrated skills in DevOps, CICD automation, Cloud Security, Information Security, AWS, Azure, GCP and compliance.