查看PyCharm自帶的默認快捷鍵的方法,請移步:
PyCharm默認快捷鍵(系統默認最全)英文版
紅色高亮顯示文本為本人最常用的快捷鍵。
系統默認快捷鍵之外,還有一些其他的操作技巧,請移步:
PyCharm設置自動換行
PyCharm使用最多也最常用默認快捷鍵介紹
自定義PyCharm快捷鍵的設置方法
1、編輯 Editing
快捷鍵 |
功能(中文) |
功能(英文) |
Ctrl + Space |
基本代碼補全(任何類、方法或變量的名稱) |
Basic code completion (the name of any class, method or variable) |
Ctrl + Alt + Space |
類名補全(任何獨立於當前導入的項目類的名稱) |
Class name completion (the name of any project class independently of current imports) |
Ctrl + Shift + Enter |
語句自動補全 |
Complete statement |
Ctrl + P |
參數信息(在方法中調用參數) |
Parameter info (within method call arguments) |
Ctrl + Q |
快速查找文檔 |
Quick documentation looku p |
Shift + F1 |
外部文檔 |
External Doc |
Ctrl + mouse over |
代碼簡介 |
code Brief Info |
Ctrl + F1 |
在caret中顯示錯誤或警告信息 |
Show descriptions of error or warning at caret |
Alt + Insert |
自動生成代碼 |
Generate code… |
Ctrl + O |
重寫方法 |
Override methods |
Ctrl + Alt + T |
選中 |
Surround with… |
Ctrl + / |
行注釋/取消行注釋 |
Comment/uncomment with line comment |
Ctrl + Shift + / |
塊注釋/取消塊注釋 |
Comment/uncomment with block comment |
Ctrl + W |
選擇新增的代碼塊 |
Select successively increasing code blocks |
Ctrl + Shift + W |
將當前選擇回退到上一步的狀態 |
Decrease current selection to previous state |
Alt + / |
循環往上查找相同單詞補全 |
Cyclic Expand Word |
Alt + Shift + / |
循環往下查找相同單詞補全 |
Cyclic Expand Word (Backwrad) |
Alt + Shift + Up |
代碼上移 |
code move up |
Alt + Shift + Down |
代碼下移 |
code move down |
Ctrl + Shift + ] |
選擇到代碼塊結束位置 |
Select till code block end |
Ctrl + Shift + [ |
選擇到代碼塊起始位置 |
Select till code block start |
Alt + Enter |
★顯示可執行操作和快速修正★ |
Show intention actions and quick-fxes |
Ctrl + Alt + L |
格式化文檔所有代碼 |
Reformat code |
Ctrl + Alt + O |
優化導入 |
Optimize imports |
Ctrl + Alt + I |
自動縮進已選擇的縮進行 |
Auto-indent line(s) Tab Indent selected lines |
Shift + Tab |
取消縮進選擇行 |
Unindent selected lines |
Ctrl + X , Shift + Delete |
剪切 |
Cut current line or selected block to clipboard |
Ctrl + C , Ctrl + Insert |
復制 |
Copy current line or selected block to clipboard |
Ctrl + V , Shift + Insert |
粘貼 |
Paste from clipboard |
Ctrl + Shift + V |
從最近的緩沖區中粘貼內容 |
Paste from recent buffers… |
Ctrl + D |
向下復制當前行或選擇代碼塊所占的行 |
Duplicate current line or selected block |
Ctrl + Y |
刪除當前行 |
Delete line at caret |
Ctrl + Shift + J |
添加智能線 |
Smart line join |
Ctrl + Enter |
智能線分割 |
Smart line split |
Shift + Enter |
從任意位置向下另起一行 |
Start new line |
Ctrl + Shift + U |
在選定的區域或代碼塊中切換 |
Toggle case for word at caret or selected block |
Ctrl + Delete |
刪除到字符尾部 |
Delete to word end |
Ctrl + Backspace |
刪除到字符頭部 |
Delete to word start |
Ctrl + NumPad+ |
展開當前的代碼塊 |
Expand code block |
Ctrl + NumPad- |
折疊當前的代碼塊 |
Collapse code block |
Ctrl + Shift + NumPad+ |
展開全部的代碼塊 |
Expand all |
Ctrl + Shift + NumPad- |
折疊全部的代碼塊 |
Collapse all |
Ctrl + F4 |
關閉當前激活的編輯選項卡 |
Close active editor tab |
2、運行 Running
快捷鍵 |
功能(中文) |
功能(英文) |
Alt + Shift + F10 |
運行模式配置 |
Select configuration and run |
Alt + Shift + F9 |
調試模式配置 |
Select configuration and debug |
Shift + F10 |
運行 |
Run |
Shift + F9 |
調試 |
Debug |
Ctrl + Shift + F10 |
運行編輯器配置 |
Run context configuration from editor |
Ctrl + Alt + R |
運行manage.py任務 |
Run manage.py task |
3、調試 Debugging
快捷鍵 |
功能(中文) |
功能(英文) |
F8 / F7 |
跳過/跳入 |
Step over/into |
Shift + F8 |
跳出 |
Step out |
Alt + F9 |
運行到光標所在位置 |
Run to cursor |
Alt + F8 |
驗證表達式 |
Evaluate expression |
Ctrl + Alt + F8 |
快速驗證表達式 |
Quick evaluate expression |
F9 |
恢復程序 |
Resume program |
Ctrl + F8 |
切換斷點 |
Toggle breakpoint |
Ctrl + Shift + F8 |
查看斷點 |
View breakpoints |
4、導航 Navigation
快捷鍵 |
功能(中文) |
功能(英文) |
Ctrl + N |
跳轉到類 |
Go to class |
Ctrl + Shift + N |
跳轉到文件 |
Go to file |
Ctrl + Alt + Shift + N |
跳轉到符號位置處 |
Go to symbol |
Alt + Right |
跳轉到下一個編輯器選項卡 |
Go to next editor tab |
Alt + Left |
跳轉到上一個編輯器選項卡 |
Go to previous editor tab |
F12 |
跳回上一步的工具窗口 |
Go back to previous tool window |
Esc |
跳轉到編輯器(從工具窗口) |
Go to editor (from tool window) |
Shift + Esc |
隱藏活動窗口或隱藏最近活動窗口 |
Hide active or last active window |
Ctrl + Shift + F4 |
關閉當前開啟的運行/信息/發現/…選項卡 |
Close active run/messages/find/… tab |
Ctrl + G |
跳轉到指定行 |
Go to line |
Ctrl + E |
彈出最近打開的文件 |
Recent files popup |
Ctrl + Alt + Right |
前進 |
Navigate forward |
Ctrl + Alt + Left |
向后退 |
Navigate back |
Ctrl + Shift + Backspace |
定位到最近編輯區域 |
Navigate to last edit location |
Alt + F1 |
在任何視圖中選擇當前文件或符號 |
Select current file or symbol in any view |
Ctrl + B , Ctrl + Click |
跳轉到聲明 |
Go to declaration |
Ctrl + Alt + B |
跳轉到實現 |
Go to implementation(s) |
Ctrl + Shift + I |
查看快速定義 |
Open quick definition lookup |
Ctrl + Shift + B |
跳轉類型聲明 |
Go to type declaration |
Ctrl + U |
跳轉到父類方法/超類 |
Go to super-method/super-class |
Alt + Up / Down |
切換到上一個/下一個方法 |
Go to previous/next method |
Ctrl + ] / [ |
移動到代碼塊結束/開始 |
Move to code block end/start |
Ctrl + F12 |
彈出文件結構 |
File structure popup |
Ctrl + H |
類型層次結構 |
Type hierarchy |
Ctrl + Shift + H |
方法的層次結構 |
Method hierarchy |
Ctrl + Alt + H |
調用層次結構 |
Call hierarchy |
F2 / Shift + F2 |
下一條/上一條錯誤高亮顯示 |
Next/previous highlighted error |
F4 |
編輯源代碼 |
Edit source |
Ctrl + Enter |
查看源代碼 |
View source |
Alt + Home |
顯示導航欄 |
Show navigation bar |
F11 |
切換書簽 |
Toggle bookmark |
Ctrl + Shift + F11 |
采用記憶切換書簽 |
Toggle bookmark with mnemonic |
Ctrl + #[0-9] |
跳轉指定編號的書簽 |
Go to numbered bookmark |
Shift + F11 |
顯示書簽 |
Show bookmarks |
5、查找/替換 Search/Replace
快捷鍵 |
功能(中文) |
功能(英文) |
Ctrl + F / Ctrl + R |
當前文檔中查找/替換 |
Find/Replace |
F3 / Shift + F3 |
查找下一個/查找上一個 |
Find next/previous |
Ctrl + Shift + F |
全局查找(可選在當前項目中) |
Find in path |
Ctrl + Shift + R |
全局替換(可選在當前項目中) |
Replace in path |
6、搜索相關 Usage Search
快捷鍵 |
功能(中文) |
功能(英文) |
Alt + F7 / Ctrl + F7 |
查找用法/在文件中查找用法 |
Find usages / Find usages in file |
Ctrl + Shift + F7 |
文件中高亮顯示用法 |
Highlight usages in file |
Ctrl + Alt + F7 |
顯示用法 |
Show usages |
7、重構 Refactoring
快捷鍵 |
功能(中文) |
功能(英文) |
F5 / F6 |
復制/移動 |
Copy / Move |
Alt + Delete |
安全刪除 |
Safe Delete |
Shift + F6 |
重命名 |
Rename |
Ctrl + F6 |
更改簽名 |
Change Signature |
Ctrl + Alt + N |
內聯 |
Inline |
Ctrl + Alt + M |
方法抽取 |
Extract Method |
Ctrl + Alt + V |
變量抽取 |
Extract Variable |
Ctrl + Alt + F |
字段抽取 |
Extract Field |
Ctrl + Alt + C |
常量抽取 |
Extract Constant |
Ctrl + Alt + P |
參數抽取 |
Extract Parameter |
8、版本控制/本地歷史記錄 VCS/Local History
快捷鍵 |
功能(中文) |
功能(英文) |
Ctrl + K |
提交項目到VCS |
Commit project to VCS |
Ctrl + T |
從VCS更新項目 |
Update project from VCS |
Alt + Shift + C |
查看最新變化 |
View recent changes |
Alt + BackQuote (`) |
快速彈出‘VCS’ |
‘VCS’ quick popup |
9、模板 Live Template
快捷鍵 |
功能(中文) |
功能(英文) |
Ctrl + Alt + J |
當前行使用模板 |
Surround with Live Templates |
Ctrl + J |
插入模板 |
Insert Live Template |
10、常規 General
快捷鍵 |
功能(中文) |
功能(英文) |
Alt + #[0-9] |
打開/關閉相應的工具窗口 |
Open corresponding tool window |
Ctrl + S |
全部保存 |
Save all |
Ctrl + Alt + Y |
同步 |
Synchronize |
Ctrl + Shift + F12 |
編輯器界面最大化 |
Toggle maximizing editor |
Alt + Shift + F |
添加到收藏 |
Add to Favorites |
Alt + Shift + I |
根據配置檢查當前文件 |
Inspect current file with current profile |
Ctrl + BackQuote (`) |
快速切換現有組合 |
Quick switch current scheme |
Ctrl + Alt + S |
打開設置對話框 |
Open Settings dialog |
Ctrl + Shift + A |
查找編輯器里的所有操作 |
Find Action |
Ctrl + Tab |
在選項卡和工具窗口之間切換 |
Switch between tabs and tool window |
結語:
玩轉文中的快捷鍵,相信可以達到與Vim同樣的神奇效果!