Need to find out why: vim对于.flex后缀文件无法识别为.lex文件的solution(适用于其他后缀文件)
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