Linux-vim File Editing Commands tips

Source: Internet
Author: User

linux-vim File Editing exception problem handling Problem Description:

Each time the code is copied, if the code contains//or # Such comments are easy to let the format out of order, the content displayed is not neat, not the desired display format.

cause Analysis:

is due to the automatic indentation of the vim Edit command, so you can suppress automatic indentation when pasting code with comments

Problem Solving:

Vim is automatically indented when pasting the code, making the code mess, and maybe even because a comment on a line causes the code to be commented out, the initial solution is: Use VI to open the file and paste it up, but in fact, the Vim editor can be set to modify.


Vim oldboy.txt #<--Edit a file: Set paste #<--in Vim's command line mode input, turn off the vim Indent function Description: Then in insert mode paste, the code will not be automatically Indentation, you can tap the code when you need to automatically indent, so you need to change back: Set Nopaste #<--to open the Vim indentation function # The convenient way is to modify the user home directory. VIMRC Profile: Set Pastet Oggle=<f9> Description: In the future in insert mode, just press the F9 key to quickly switch to Automatic indentation mode



650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/5A/wKioL1jbp9LRTuiLAAAXhNDRN18089.png "title=" logo-Blog Watermark Information 02.png "alt=" Wkiol1jbp9lrtuilaaaxhndrn18089.png "/>

This article is from the "Hq_oldboy" blog, make sure to keep this source http://heqoldboy.blog.51cto.com/12763466/1911542

Linux-vim file editing commands tips

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.