auto file type detection
Merge pull request #1 from chouqin/ftdetect

auto file type detection