Comment out the code in VIM using Python Programming

Source: Internet
Author: User

If you are interested in the method for commenting out the entire code segment in Python programming in VIM, you can browse the following articles to see how Python programming is implemented in actual operations, the following is the main description of the article. I hope you can learn more from it.

For example, You Need To comment out the following three lines of Python code:

 
 
  1. Def say_hello ():
  2. Print 'Hello world! '
  3. Return None

1. Press Ctrl + V to enter the block Operation Mode of VIM.

2. Use the j and k keys to move up and down. To select these three rows, make sure that the first column of each row is included in the selected block.

3. Type I (capital I), that is, insert at the beginning of the row. Enter the Python annotator '#'.

4. Press ESC.

Then you will find that '#' is inserted in the first column of each row '#'.

 
 
  1. # Def say_hello ():
  2. # Print 'Hello world! '
  3. # Return None
  4. Mission completed.
  5.  

This is how Python programming operates in VIM, which is fast and accurate.

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.