"Go" vim change tab to four spaces

Source: Internet
Author: User

Original URL: http://blog.sina.com.cn/s/blog_620ccfbf01010erz.html

For vim to better support Python to write code, modify the tab default 4 spaces There are two ways to set up:

1. VIM/ETC/VIMRC

1 setts=4
2 setsw=4

2. VIM/ETC/VIMRC

1 setts=4
2 setexpandtab
3 setautoindent
The second is recommended, which results in 4 spaces when you press the TAB key, which has the best compatibility. Set Tab in Vim

Indentation tab or space, this is not a problem, just like python with four spaces to indent, this is to see a person's preferences. In Vim, it is convenient to set the Tab tab or space according to different file types, and also to set the length, which is very flexible.

First, let's see how to set the tab width and how to determine whether to use Tab tab or empty Glyd to represent an indentation:

Set tabstop=4
Set softtabstop=4
Set shiftwidth=4
Set Noexpandtab/expandtab Description:

Which tabstop represents the length of how many spaces a tab displays, default 8.

softtabstopIndicates that the length of the indent is returned when you press the BACKSPACE bar while in edit mode, expandtab especially useful when used.

shiftwidthIndicates the length of each level of indentation, generally set to the softtabstop same.

When set expandtab to, indentation is represented by an empty glyd, and noexpandtab a tab is used to denote an indentation.

"Go" vim change tab to four spaces

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.