Set tab and wrap in vim

Source: Internet
Author: User

Today when using the Vim editor to find the default tab key is 8 characters, so think of it set to four spaces, after Baidu, got the following methods:

First Enter/ETC/VIM/VIMRC

Then add the following code at the end of the document:

Set tabstop=4 setting tab indent to 4 characters

Set Expandtab converted to spaces

Set autoindent setting Auto Indent

But then there came a new problem in the Run Times error: taberror:inconsistent use of tabs and spaces in indentation

In order to solve this problem, search again, after several failures, and finally got the solution:

Set tabstop=4

Set softtabstop=4

Set shiftwidth=4

Set Expandtab

Set Autoindent

It works fine thereafter.

Summed up is the Vim space bar and tab can not be mixed, when mixed with error

Set tab and wrap 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.