[Python development tools] Pycharm's shortcut keys
1
Global search: ctrl+shift+f, but pycharm more powerful, you can click on the left side of a directory and then press ctrl+shift+f, so the default will be searched directory; Tip: If you just want to highlight the file, Simply selecting Project Navigator and typing directly will automatically highlight all matching files;
2
Add Comment: ctrl+/, and then press again to uncomment
3
Refactoring Refactor: ctrl+alt+shift+t
Sometimes the code is very long, found that the original file name is not reasonable, manual modification needs to traverse all the reference place? Then select the corresponding File/folder, after ctrl+alt+shift+t select Rename; If the file directory classification is unreasonable want to move, select Move; If you select any variable or constant in the code, function name, and so on, select Rename, automatically help you to change all references to the place and definition, and provide the preview function to ensure that there is no mistake to modify some places.
4
Auto PEP8 style: ctrl+alt+l
An eyeful of wavy lines prompts you to use the code when the style is confusing, the world is pure;
5
Smart correction : alt+enter
The module that corresponds to import (install) is used in the name of the import (install) module, which avoids running to the top of the code to write import;
Use a complement comment on the method name and use it in the test to help you add the assertion code ... No matter what error, do not know how to do, know what to do when you press this shortcut key, there are surprises!
6
Run current file: ctrl+shift+f10
Very smart, if it is a test code, run in test mode, and list the test pass condition
7
Check Note (docstring): ctrl+q
8
Check the definition (source code): ctrl+b/ctrl+i
9
View parameters: ctrl+p
If you press inside the parentheses, you know what parameter the current position is given.
10
Another line: shift+enter
The cursor can be placed in a row anywhere in the line without destroying the row structure;
11
Copy Current line: ctrl+d
12
Delete Current line: ctrl+x
13
Pop-up common snippet: *ctrl+j
For example: if name = = "Main":
14
Search everything: Double-clickshift
Search everything, whether it's IDE features, files, methods, variables ... We can search.
15
CTRL + CURSOR
When you hold down CTRL and the mouse moves over the identifier, some hints are displayed.
When you hold down CTRL and click, you can jump to the definition or the box lists all references, and there is only one place where the reference will jump directly
16
Recently opened files: ctrl+e
17
Smart Fill tab:
This should all know, add one, enter a.print and press TAB to have a surprise
18
Surround with: ctrl+alt+t
For example, the cursor is located in the statement or block with try...except ... Wrap it up.
19
Extend Selection: ctrl+w
Extend the selection range outward. I usually use the word, two quotation marks or parentheses between the contents.
20
Surround selection on typing quote or brace:
This is a setting, set up a lot of convenience, ctrl+shift+a search smart keys, check the surround selection on typing quote or brace, so that you select the text after the quotation marks or brackets or automatically add to both sides of the head, without is the replacement text;
[Python development tools] Pycharm's shortcut keys