Annotate multiple lines of Python code in vim

Source: Internet
Author: User

It is troublesome to annotate multiple lines of Python code in Vim, mainly by following several methods:

(1) Render the code that needs comments as a document string

(2) render the code that needs comments as a function

(3) Use Vim's own shortcut keys

We mainly use the third way, the following is the method of commenting and uncomment.

1. Multi-line Comment:  1. First press ESC to enter command line mode, press CTRL + V to enter the column (also known as block) mode;  2. Use the upper and lower keys at the beginning of the line to select multiple lines needing comments; 3. Press the keyboard (uppercase) "I" key to enter the insertion mode; 4.  Then enter the comment symbol ("//", "#", etc.); 5. Finally press the "ESC" key.
Note: After pressing the ESC key, will wait a moment to appear the comment, do not worry ~ ~ Time is very short 2. Delete Multiline Comment: 1.  First press ESC to enter command line mode, press CTRL + V to enter the column mode;  2. Select multiple lines to uncomment; 3. Press "X" or "D".
Note: If it is a "//" comment, it needs to be done twice, if it is a "#" comment, once


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Annotate multiple lines of Python code in vim

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.