When working with .haml files, Vim keeps working with soft-tabs

For some reason Vim continues to use soft-tabs (tabs as spaces) every time I work on Haml files. I prefer regular tabs and I have this in my vimrc:

set autoindent
set noexpandtab
set tabstop=4
set shiftwidth=4

      

Which seems to work great for all file types except Haml. When editing Haml files, Vim uses two spaces and not a tab, any suggestions on how this can be reverted back to my default settings (i.e. regular tabs)?

+3


source to share


1 answer


This is because the indent script for haml sets the expandtab for you automatically when VIM detects that the current file is in haml format. The script is in $VIMRUNTIME/indent/haml.vim

. It contains:

setlocal autoindent sw=2 et

      



To turn this off, you can put this line in ~/.vimrc

yours to clear the expandtab parameter again:

au! FileType haml set noet

      

+7


source







All Articles