Você pode usar algo assim em ~/.vimrc
para ajustar-se a usar espaços / guias, conforme apropriado:
" By default, use spaced tabs.
set expandtab
" Display tabs as 4 spaces wide. When expandtab is set, use 4 spaces.
set shiftwidth=4
set tabstop=4
function TabsOrSpaces()
" Determines whether to use spaces or tabs on the current buffer.
if getfsize(bufname("%")) > 256000
" File is very large, just use the default.
return
endif
let numTabs=len(filter(getbufline(bufname("%"), 1, 250), 'v:val =~ "^\t"'))
let numSpaces=len(filter(getbufline(bufname("%"), 1, 250), 'v:val =~ "^ "'))
if numTabs > numSpaces
setlocal noexpandtab
endif
endfunction
" Call the function after opening a buffer
autocmd BufReadPost * call TabsOrSpaces()