My current configuration makes vim automatically expand TAB to 4 spaces for me:
" Define tab as 4 spaces " Taken from http://stackoverflow.com/questions/1878974/redefine-tab-as-4-spaces 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
While it is nice to make Tab 4 spaces in Python, a four-space indent in HTML files is just too much. I want to make vim detect the file type, and choose how many spaces to expand Tab into. For example, 2 for HTML and 4 for other file types.