if exists("did_load_filetypes") finish endif augroup filetypedetect au BufRead,BufNewFile *.JS setf javascript au BufRead,BufNewFile *.jas setf asm au BufRead,BufNewFile *.swfml setf xml au BufRead,BufNewFile *.hx setf haxe au BufRead,BufNewFile *.tpl setf xhtml au BufRead,BufNewFile massif.*.txt setf massif " HTML (.shtml and .stm for server side) au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml() au BufNewFile,BufRead {mad,}mutt{ng,}-*-\w\+ setf mail au BufNewFile,BufRead */X11/xkb/* setf xkb au BufNewFile,BufRead *.as setf actionscript au BufNewFile,BufRead *.dox setf doxygen au BufNewFile,BufRead *.iop setf d au BufNewFile,BufRead .gitsendemail.* setf gitsendemail " Distinguish between HTML, XHTML and Django fun! s:FThtml() let n = 1 while n < 10 && n < line("$") if getline(n) =~ '' setf htmldjango return endif let n = n + 1 endwhile setf html endfun augroup END