Hi folks:
My current setting assumes 8 spaces; how could i redefine it?
Thanks.
Hi folks:
My current setting assumes 8 spaces; how could i redefine it?
Thanks.
Depending on what you mean by tab, one of the following should work:
" size of a hard tabstop
set tabstop=4
" size of an "indent"
set shiftwidth=4
" a combination of spaces and tabs are used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
You may also want to try the following:
" make "tab" insert indents instead of tabs at the beginning of a line
set smarttab
" always uses spaces instead of tab characters
set expandtab
See :help 'optionname'
(eg: :help 'tabstop'
) for more details on any of these.
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
To make any of the above permanent you can put them in a .vimrc file in your home directory (or _vimrc) on Windows.