Last Updated: February 25, 2016
·
647
· orlando

Different indentation per filetype using vim

put those line in your .vimrc

autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
autocmd Filetype javascript setlocal ts=4 sts=4 sw=4

source: http://stackoverflow.com/a/1562645/536984