google: how to get extend from a file
sudo vim /usr/share/vim/vimrc
在打开的文件里加上这几句:
let s:extension = expand('%:e')
set syntax=lex
endif
ps:
:e Extension of the file name.
vim help doc: http://vimdoc.sourceforge.net/index.php