Pycharm Use Tips

Source: Internet
Author: User

JetBrains's IDE has a lot of tricks that are generic, saying that some of the skills that are used daily but not necessarily limited to pycharm:

' ctrl+alt+l ', format code, once in eclipse, formatting code must first select a region of the code block and then format, using the JetBrains IDE after the habitual format, but also have to hand a few more formats to be comfortable, but there are sequelae, Later in the various edit boxes always like ' ctrl+alt+l ' a few to be comfortable

' Alt+enter ' universal key, different scenes have different modes of expression, in the import (install) module name on the import (install) corresponding to the module, the method name on the use of complementary comments, in the test to help you add the assertion code ... No matter how wrong, do not know how to do, know how to do so when all press this shortcut key, there are surprises

' Ctrl+space ' universal cue key, Pycharm will provide completion according to the context. Not only is the code hint, ' ctrl+f ' search, do not know when to type when the press, often give people surprises. In Windows because the input method cannot use this shortcut key, ' Ctrl+alt+s ' opens the setting to type Keymap, searches in Keymap to find and modify it

' CTRL+SHIFT+F10 ' run the current file, very intelligent, if it is test code, run in test mode, and list the test pass

The ' ctrl+w ' extension selection and ' ctrl+shift+w ' reduces the selection, extending the selected area one layer at a time, for example, value->key:value-> dict-> ..., at the level of each click, ' CTRL + Shift+w ' is used to cancel the last extended selection operation, pay attention to Sequela, most software in the ' Ctrl+w ' is closed. It's the ' ctrl+shift+ Arrow ', not ' ctrl+w '.

The ' ctrl+alt+shift+t ' refactoring the selection to extract the selections into variables, methods, and so on. Different refactoring methods have different shortcuts, such as extracting a.b from A.B.C, selecting a.b, and typing ' ctrl+alt+v ' visible effects

' Ctrl+q ' Check notes

' Ctrl+shift+i ' no comment when checking source

The ' Ctrl+p ' method is called to view the parameters, press in parentheses, you know the current position to give what parameters, but because it is python, the use of ' ctrl+space ' can also achieve good results

' Shift+enter ' another row, the cursor can be a row anywhere in the row, and does not break the row structure

' Ctrl+alt+enter ' up another line

' Ctrl+shift+ number key ' and ' CTRL + Number ' bookmark function

' Ctrl+shift+a ' Search IDE features, like looking at the history of this file, type history to find the local history

The last type of the variable or expression. (point) ', when prompted, look at the bottom section for a variety of code templates, such as an existing variable a, type A. (point) Print in the next line and type ' tab ', Python2 will become ' Print a ', Python3 will become ' print ', and if, else, and many other common code templates

Double-click ' Shift ' to search for everything, whether it's IDE features, files, methods, variables ... Can search

Under each window, whether it is project,setting,debugger ... You can simply type in the content you want to search for, and it will help you highlight, type ' ↑ ' or ' ↓ ' to toggle the match to the target

Consolidated REPL, because JetBrains can achieve many of the same effects as the editor

Consolidates git through plug-ins to support git flow, excellent code comparisons, and conflict resolution during merge is helpful

Local history, folders, every file has a record history version

Consolidated source Code Pro font +darcula Theme (Dark Theme), no pain in the eye

Tip of the day, always brings some useful small features, do not wearies, ah, write code tired, Help > Tip of the day to open a look at

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.