The
number of shortcut keys commonly used in PyCharm Use the shortcut keys of the development tool to effectively improve the efficiency of program development; the
most important shortcut keys
Ctrl+Shift+A | Universal command line | Press Shift twice | View resource files |
---|
Comment
Ctrl+/ | Comment the selected line |
---|
Cursor operation
Ctrl+Alt+Enter | Insert upward | Shift+Enter | Insert down |
---|---|---|---|
End | cursor | – | – |
Operation code
Ctrl+D | Copy and paste a line | Ctrl+Y | Delete a line |
---|---|---|---|
Shift+F6 | Rename | Ctrl+O | Copy code |
Format code and its function
Ctrl+Alt+L | Format code | Ctrl+Alt+T | Add try/catch |
---|---|---|---|
Ctrl+Alt+M | Extract code | Ctrl+Alt+F | Variable extraction global variables |
Ctrl+Alt+V | Method in vivo value extraction into variables | Shift+Tab | Reverse backspace (indent) |
Tab | Backspace (indent) | Alt+Shift+Up and down keys | Selected code move |
Ctrl+Shif+Enter | Completion code | – | – |
Enter code
Ctrl+B | Enter code | Ctrl+Shift+F12 | Maximize window |
---|
Replace find
Ctrl+R | replace | Ctrl+F | Find |
---|---|---|---|
Ctrl+Shift+F | Global search | Ctrl+Shift+R | Global replacement |
Ctrl+Shift+I | Quick view method to achieve content | Ctrl+P | View parameters |
Ctrl+Q | View document description | Shift+F1 | View API documentation |
Ctrl+F12 | View method of class | Ctrl+H | View class inheritance relationship |
Ctrl+Alt+H | See where the method is called | Ctrl+{} | Brackets for positioning method body |
F3 | View selected content | Shift+F3 | View content in reverse |
Ctrl+Alt+B | Query the class that implements the interface where the cursor is located | Ctrl+U | View parent category |
Ctrl+E | List of recently edited files | Ctrl+Alt+Home | View layout and corresponding class |
Project directory operation
Alt+Insert | New files and projects | Ctrl+Alt+S | Open software settings |
---|---|---|---|
Ctrl+Alt+Shift+S | Open module settings | Ctrl+Tab | Switch directory and view |
Alt+Shift+C | View recent changes to the project | Ctrl+J | livetemp template view |
Run compilation
Ctlrl+F9 | Construct | Shift+F10 | run |
---|
Code shortcuts
F11 | Define bookmark | Shift+F11 | View bookmarks |
---|---|---|---|
Ctrl+J | Quickly recall templates | Alt+click breakpoint | Disable breakpoint |
Press Alt in debugging state | View variable can inspect the value of expression |
Combination shortcut
F2 | Definition error | Alt + Enter | Fix mistakes |
---|---|---|---|
Alt+mouse | Enter column edit mode | Ctrl+W | Selected word |
Ctrl+Alt+Left and Right Arrow | Position to edit | – | – |
PyCharm common settings
1. Set Python to automatically import packages
In File → Setting → Editor → General → Autoimport, set Python to show popup, and then press the shortcut key <Alt+Enter> to automatically add the package.
2. "Code auto complete" time delay setting
In File → Setting → Editor → Code Completion, set Auto code completion in (ms) to 0, and then set Autopopup in (ms) to 500.
3. Use Ctrl+mouse scroll wheel to change font size
By default in Pycharm, you cannot use Ctrl+mouse scroll wheel to change the font size, you can set it in Flie → Setting → Editor → Mouse.
4. Display "line number" and "blank character"
Check the "Show line numbers", "Show whitespaces" and "Show method separators" checkboxes in File → Setting → Editor → Appearance.
5. Set the editor "color and font" theme
The color is set in Flie → Setting → Editor → Colors & Fonts → Scheme name; if you want to modify the font size, set it in File → Setting → Editor → Colors & Fonts → Font → Size.
6. Set the indent to tab "Tab"
在File → Setting → Editor → Code Style → Python 中勾选"Use Tab character" 复选框。
7.Python文件默认编码
在File → Setting → Editor → File Ebcodings,将"Global Encoding"设置为UTF-8(也可以选择其他编码方式),将"Project Encoding"也设置为UTF-8(也可以设置其他编码方式)。
8.修改IDE快捷键方案
打开File → Settings → Keymap进行设置。
9.设置IDE皮肤主题
打开File → Settings → Appearance & Behavior → Appearance,选择Theme项的值即可。