The first step:
Open terminal, enter on terminal, vim ~/.vimrc
return.
Step Two:
Input:
set helplang=cn "Chinese help document (if the Chinese package is down) syntax Enablesyntax on" Automatic syntax highlighting set number Show line number ColorScheme Desert "Set color scheme set guifont=consolas:h12:cansi "English font set guifontwide=simsun-extb:h12:cgb2312set tabstop=4" means tab represents 4 spaces width set expandtab" means tab is automatically converted to space set autoindent "means auto indent after line break set autoread "automatically re-read the set history=400 when the file is modified externally" the number of historical operations that Vim remembers , the default is 20set nocompatible Use Vim's own keyboard mode instead of the VI-compatible mode set confirm "when handling unsaved or read-only files, give a hint set smartindent "smart Align set shiftwidth=4
Then save the exit.
One drawback to this is that with the Vim editor, the tab will be converted into 4 spaces, regardless of the program you write.
so , if you just want to have these features in writing Python, or C or C + +,
In the second step, replace the
autocmd FileType python set tabstop=4 | set expandtab | set autoindent
In this case, the tab space is used only when writing a python file.
Reprint: http://blog.csdn.net/qq_32306905/article/details/51327463
Solve the problem of using vim to write Python's indentation incorrectly in Linux