The most complete Pycharm tutorial (41) -- Notes for Pycharm Extension

Source: Internet
Author: User

The most complete Pycharm tutorial (41) -- Notes for Pycharm Extension

1. Subject

You often need to create a task list during the development process. For some small tasks, inserting notes in the Code may be miraculous.

The format of this annotation is as follows:

2. Create notes

Very simple:

First, move the cursor to the corresponding line.

Then, create a line of comment (Ctrl + Slash ).

Finally, enterTODOOrTodo,Enter comments

3. Browse notes

Browse in the todo tool window (Alt + 6 or View → Tool Windows → TODO ):

For more information about Windows, see Using Tool Windows.

4. navigation between tabs

One way is to switch by clicking the tab on the right side of the window.

Another method is to switch in the TODO tool window. Run the shortcut menu command Jump to Source in the window, or select a tab and press F4.

5. Private order of the Note Mode

Pycharm comes with two note modes"Todo"Or start"TODO". As long as the annotation meets the preceding format, it will be displayed in the TODO tool window.

Here we will introduce how to create notes in other formats.

Click the Settings button in the main toolbar. Under the IDE Settings node, click TODO to open the TODO page:

Suppose we want to create a tab for code browsing in a specific line, including the "review" keyword. Next we will create this tab mode.

InPatternsClick the green plus sign and enter the following regular expression:

Change the icon and color scheme at the same time:

After the settings are complete, Pycharm will automatically detect all comments in the current project. If any comments that meet the conditions are found, the new color scheme will be displayed in the TODO tool window:

6. Create a note Filter

Suppose we only want to see the tab information related to code browsing and hide other tabs. here we need to use the tab filter.

Click the TODO tool window icon and select Edit Filters:

Of course, you can also perform related operations on the TODO page in the Setting Dialog Box (set → IDE Settings → TODO ).

InFiltersArea, click the green plus sign.

InAdd FilterThe dialog box displays two modes: \ btodo \ B. * And \ breview \ B .*. Here we choose to hide the traditional mode, and only keep the \ breview \ B/* mode. Select this mode and enter the Filter Name:

7. Filter tabs

Return to the TODO tool window and click:

Select the review command to display the filtering result in the tool window. Double-click the corresponding entry to achieve quick jump:

8. Create a template for notes

Creating a template helps you quickly compile notes.

Open the Settings dialog boxIDE SettingsUnder the node, click Live Templates: Settings → IDE Settings → Live Templates:

Click the green plus sign to add the template and enter the relevant information:

Note that the new template is automatically added to the user group.

Pay attention to the red prompt at the bottom, and clickDefineTo view the optional information about the template.

Finally, define the template body:

There are two variables $ WHO $ and $ TEXT $. The former is the input area, and the latter is automatically filled. ClickEdit variablesButton:

In the Edit Template Variables dialog box, select the content of the variable $ WHO $:

Test the template. Create a comment line, enter rv, and press TAB:

Enter the text and press Enter:

The template takes effect.

 

Related Article

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.