filetype plugin indent on" show existing tab with 4 spaces widthset tabstop=4" when indenting with '>', use 4 spaces widthset shiftwidth=4" On pressing tab, insert 4 spacesset expandtab
在您的[. vimrc:][1]文件中:
set smartindentset tabstop=4set shiftwidth=4set expandtab
" Only do this part when compiled with support for autocommands.if has("autocmd")" Use filetype detection and file-based automatic indenting.filetype plugin indent on
" Use actual tab chars in Makefiles.autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtabendif
" For everything else, use a tab width of 4 space chars.set tabstop=4 " The width of a TAB is set to 4." Still it is a \t. It is just that" Vim will interpret it to be having" a width of 4.set shiftwidth=4 " Indents will have a width of 4.set softtabstop=4 " Sets the number of columns for a TAB.set expandtab " Expand TABs to spaces.