Pycharm常用快捷键

记录一些Pycharm中常用的快捷键

创建和编辑

功能 描述 注释
Show Intention Actions Alt+Enter .
Basic Code Completion Ctrl+Space .
Smart Code Completion Ctrl+Shift+Space .
Type Name Completion Ctrl+Alt+Space 类型名补全,几乎可以补全任何东西
Quick Definition Ctrl+Shift+I 可以在当前页面浏览定义.不可直接编辑 它会展示方法的内容
Quick/External Documentation Ctrl+Q / Shift+F1 可以快速查看函数文档,按两次q可以开一个单独的侧边窗口
Surround With… Ctrl+Alt+T 可以将选择的代码用什么框住。比如if语句 while语句 try catch之类
Extend/Shrink Selection Ctrl+W / Ctrl+Shift+W 从光标处逐渐扩大选区
Copy Document Path Ctrl+Shift+C 可以直接复制当前打开文件的绝对路径
Duplicate Current Line or Selection Ctrl+D 在需要连续复制代码的时候特别有用,比如需要连续写很多print函数

Move Line Up Ctrl+Shift+Up
Move Line Down Ctrl+Shift+Down
Delete Line at Caret Ctrl+Y
Join/Split Line Ctrl+Shift+J / Ctrl+Enter
Start New Line Shift+Enter
Toggle Case Ctrl+Shift+U
Expand/Collapse Code Block Ctrl+NumPad +/-
Expand/Collapse All Ctrl+NumPad +/-
Save All Ctrl+S

Analyze and Explore

Show Error Description Ctrl+F1
Next/Previous Highlighted Error F2 / Shift+F2
Run Inspection by Name… Ctrl+Alt+Shift+I
Type Hierarchy Ctrl+H
Call Hierarchy Ctrl+Alt+H

VERSION CONTROL 版本控制

VCS Operations Popup… Alt+`
Commit Ctrl+K
Update Project Ctrl+T
Recent Changes Alt+Shift+C
Revert Ctrl+Alt+Z
Push… Ctrl+Shift+K
Next Change Ctrl+Alt+Shift+Down
Previous Change Ctrl+Alt+Shift+Up

MASTER YOUR IDE 管理IDE
Find Action… Ctrl+Shift+A
Open a Tool Window Alt+[0-9]
Synchronize Ctrl+Alt+Y
Quick Switch Scheme… Ctrl+`
可以快速切换主题 我觉得挺实用的

Settings… Ctrl+Alt+S 打开设置
Jump to Source/Navigation Bar F4 / Alt+Home
Jump to Last Tool Window F12
Hide Active/All Tool Windows Shift+Esc / Ctrl+Shift+F12
Go to Next/Previous Editor Tab Alt+Right / Alt+Left
Go to Editor (from a Tool Window) Esc
Close Active Tab/Window Ctrl+Shift+F4 / Ctrl+F4

FIND EVERYTHING 查找

功能 描述 注释
Search Everywhere Double Shift 按两下shift
Declaration Ctrl+B 可以转到函数和类等的声明处,与下面的快捷键不同,如果声明的函数不在同一个文件则会开一个新的页面去查看,并且可以编辑
Find Usages / Find Usages in File Alt+F7 / Ctrl+F7 查找引用,这个查找是全局的,比如查找print的引用就会发现有数百个引用

Find/Replace Ctrl+F / Ctrl+R
Find/Replace in Path Ctrl+Shift+F / Ctrl+Shift+R
Next/Previous Occurence F3 / Shift+F3
Find Word at Caret Ctrl+F3
Go to Class/File Ctrl+N / Ctrl+Shift+N
Go to File Member Ctrl+F12
Go to Symbol Ctrl+Alt+Shift+N

NAVIGATE FROM SYMBOLS 从符号处定位

Type Declaration (JavaScript only) Ctrl+Shift+B
Super Method Ctrl+U
Implementation(s) Ctrl+Alt+B

Highlight Usages in File Ctrl+Shift+F7 把引用高亮显示出来
Show Usages Ctrl+Alt+F7 用一个小框直接展示引用,看起来比较方便
NAVIGATE IN CONTEXT 在上下文中定位
Select In… Alt+F1
Recently Viewed/Changed Files Ctrl+E / Ctrl+Shift+E
Last Edit Location Ctrl+Shift+Back
Navigate Back/Forward Ctrl+Alt+Left / Ctrl+Alt+Right
Go to Previous/Next method Alt+Up / Alt+Down
Line/Column… Ctrl+G
Go to Code Block End/Start Ctrl+] / Ctrl+[
Add to Favorites Alt+Shift+F
Toggle Bookmark F11
Toggle Bookmark with Mnemonic Ctrl+F11
Go to Numbered Bookmark Ctrl+[0-9]
Show Bookmarks Shift+F

BUILD, RUN, AND DEBUG 构建 运行和调试
Run context configuration Ctrl+Shift+F10
Run/Debug Selected Configuration Alt+Shift+F10 / Alt+Shift+F9
Run/Debug Current Configuration Shift+F10 / Shift+F9
Step Over F8
Step Into F7
Smart Step Into Shift+F7
Step Out Shift+F8
Run to Cursor Alt+F9
Force Run to Cursor Ctrl+Alt+F9
Show Execution Point Alt+F10
Evaluate Expression… Alt+F8
Stop Ctrl+F2
Stop Background Processes… Ctrl+Shift+F2
Resume Program F9
Toggle Line Breakpoint Ctrl+F8
Toggle Temporary Line Breakpoint Ctrl+Alt+Shift+F8
Edit breakpoint Ctrl+Shift+F8
View Breakpoints… Ctrl+Shift+F8
REFACTOR AND CLEAN UP
Refactor This… Ctrl+Alt+Shift+T
Copy… F5
Move… F6
Safe Delete… Alt+Delete
Rename… Shift+F6
Change Signature… Ctrl+F6
Inline… Ctrl+Alt+N
Extract Method Ctrl+Alt+M
Introduce Variable Ctrl+Alt+V
Introduce Field Ctrl+Alt+F
Introduce Constant Ctrl+Alt+C
Introduce Parameter Ctrl+Alt+P
Reformat Code Ctrl+Alt+L

鼓励一下:D