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
2. VIM/ETC/VIMRC
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.
softtabstop
Indicates that the length of the indent is returned when you press the BACKSPACE bar while in edit mode, expandtab
especially useful when used.
shiftwidth
Indicates 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