vim set tab to 4 spaces code example
Example 1: vim replace tabs with spaces
" Vi:
" To replace tabs with spaces whilst typing
set tabstop=4 shiftwidth=4 expandtab
Example 2: linux vim set tab to 4 spaces
set tabstop=4
Example 3: vim tab 2 spaces
set smartindent
set tabstop=2
set expandtab
set shiftwidth=2
Example 4: linux vim set tab to 4 spaces
set ts=4 sw=4
Example 5: linux vim set tab to 4 spaces
syntax enable