Python Essay: PyCharm commonly used shortcuts and tips

Keyboard Shortcuts

1, Ctrl + Enter: new row below, but without moving the cursor;

2, Shift + Enter: under the new line and moved to the new trekking head;

3, Ctrl + /: Comment (uncomment) selected row;

4, Ctrl + Alt + L: formatting code (and hot key lock conflict QQ, QQ hotkey is closed);

5, Ctrl + Shift + +: expand all code blocks;

6, Ctrl + Shift + -: all code blocks contraction;

7, Ctrl + Alt + I: automatic indent;

8, Alt + Enter: optimized code, automatic guide message packet;

9, Ctrl + Shift + F: Advanced Find;

10, Alt + Shift + Q: update code to a remote server;

 

11, Ctrl + N to find the names of all of the class

12, Ctrl + Shift + N find any file in your project

The use of TIPS

1.1: PyCharm can use more than one item in a window.

To open a window open project, select "Open" in the "File" menu and select "open in the current window" option in the "Open Project" dialog box, and then select "add to the currently open project "check box.

Step: File -> open -> select the project to be opened -> Select by image

 

 

 

3.2: quickly open any class of editor, Ctrl + N, Ctrl + Shift + N

Press Ctrl + N (Navigate | Class) and start typing the name of the class. Select a class from the dropdown list displayed.

You can use Ctrl + Shift + N (navigation | file) in a similar manner to open any file in your project

3.3 code completion feature allows you to quickly complete a variety of statements in the code.

For example, start typing a class name, then press Ctrl + Space to complete it. When there are multiple options are available, they will be displayed in the lookup list.

3.4: Complete the properties by pressing Ctrl + Space twice to call a special variant of the code that allows you to complete any kind of name, regardless of whether it was imported into the current file. If the class has not been imported, it will automatically generate import statements.

3.5: You can quickly find places for all the use of specific classes throughout the project, method or variable, the method is to caret positioned in accordance with the symbolic name or code usage, and then press Alt + F7 (Find Usage in the pop-up menu ).

3.6: To quickly view into the document at the symbol, press Ctrl + Q (view | Quick documentation).

3.7: To navigate to the class code used somewhere, or variable declaration method, using the target set caret position, and then press Ctrl + B. You can also use the mouse click to jump down the Ctrl key statement.

3.8: You can use Ctrl + F12 (navigation | file structure) to quickly navigate through the currently edited document.

It shows the list of members of the current class. To navigate to select the element and press the Enter key or the F4 key.

To easily find items in the list, simply enter the name.

3.9: You can easily rename your local variables, and automatically correct any place to use them.

To try it, the caret placed in the variable you want to rename, and then press Shift + F6 (Refactor | Rename). In the pop-up window that appears enter the new name, or select a suggested name, and then press Enter.

3.10: When using code completion, you can use the Tab key to accept the pop-up list, select the currently highlighted.

And use the Enter key to accept the different, the name of the selected name will cover the rest off the right side of the characters. This is particularly useful in a method for replacing the variable name or the other.

3.11: Do you know that you can close a tab in PyCharm editor and tool window, without having to use the context menu command? Use the mouse to point to a closed tab, then click the middle mouse button or use Shift + click combination is sufficient.

3.12: To quickly select the currently edited element (class, file, method or field) in any view (Project View, Structure View or other), press Alt + F1.

3.13: Speed ​​search is available in all tree view: just start typing, then quickly find the necessary items.

3.14: Any tool window Esc to move the focus to the editor.

Shift + Esc to move the focus to the editor and hide the current tool window (or last active).

F12 to move the focus from the last editor tool window focus.

3.15: editor Ctrl + W (extended selection) at the caret word and select source extension region. For example, the method may select a name, and then expression is to call this method, then the whole sentence, and the like are included in the block. You can also choose the extended character region, and the source code is inserted click target area editor.

3.16: Extract Variable refactoring can help you simplify complex statements in the code. For example, the following code fragment, an expression may be selected in the code, then press Ctrl + Alt + V (Refactor | Extract | Variable).

3.17: editor Ctrl + D to copy the current row or the selected block instead of selecting blocks.

3.18: Code | Mobile sentence up / down operation is very useful for reorganizing file line of code, for example, the variable declaration closer to the variable usage.

For example, selecting a snippet, and then press Ctrl + Shift + Up Arrow or Down Arrow Ctrl + Shift +.

3.19: Ctrl + Shift + J shortcut to two lines together into one, and delete unnecessary white space to match your coding style.

3.20: If the cursor is located between the bracket method calls, press Ctrl + P will bring up a list of valid parameters.

3.21: Ctrl + Shift + Backspace (navigation | edit a location) will take you back to the last place you make changes in your code.

Press Ctrl + Shift + Backspace several times, more in-depth understanding of your change history.

3.22: Use Ctrl + Shift + F7 (Edit | Find | highlighted file usage) quickly highlight the usage of certain variables in the current file.

Use F3 and Shift + F3 keys to navigate highlighted usage.

Press Esc to remove the highlight.

3.23: To see your local file change history, please call the local history | Show History in the context menu (Local History | Show History). You can browse different file versions, see the difference and roll back to any previous version.

Using the same context menu item to view the history of changes on the directory. You never lose any code this feature!

3.24: Ctrl + E (see | recent file) brings pop-up list of recently accessed files. Select the desired file, then press Enter to open it.

3.25: To show the separation line between the method editor, the editor open settings, and then select the "appearance" page "display method Separator" check box.

 

 

 

3.26: When using the Basic code completion (Ctrl + space), the identifier input anywhere in the presence of any character. - Prompt

3.27: Use Alt + Alt + up arrow and down arrow keys to move fast in the method editor.

3.28: Use Ctrl + Shift + V shortcut keys to select and recent clipboard contents into the text.

3.29: You can press Ctrl + O (Code | covering method) easily covers the base class methods.

3.30: In order to help you understand the purpose of each item in the main menu, move the mouse pointer over the item, its brief description appears in the status bar at the bottom of the application framework.

3.31: To quickly open any particular method or field editor, press Ctrl + Alt + Shift + N (navigation | symbol) and start typing its name.

Selecting symbols from the drop down list displayed.

3.32: Use Alt + Shift + C to quickly view your most recent changes to the project.

3.33: You can easily select a column by dragging the mouse pointer, while holding down the Alt key. alt key while selecting multiple lines

3.34: To quickly find a menu command or toolbar operation, you do not need to navigate through the menu. Simply press Ctrl + Shift + A (on the main menu Help | lookup operation) and start typing the name of the operation. Select the desired action from the list of suggestions.
----------------
Disclaimer: This article is the original article CSDN bloggers "MR_labo", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/weixin_37292229/article/details/81737194

Guess you like

Origin www.cnblogs.com/lizhen416/p/11518440.html