Add this line to yourCreate ~/.vimrcvim/ftdetect/SOME_EXTENSION.vim
fileand add this line to easily set up your custom filetype detection for a given extensionit:
autocmd BufNewFile,BufRead *.SOME_EXTENSION set syntax=SOME_FILETYPEfiletype=SOME_FILETYPE
So if you wanted vim to use the filetype html
for all files with an .Rhtml
extension you would doadd this to ~/.vim/ftdetect/rhtml.vim
:
autocmd BufNewFile,BufRead *.Rhtml set syntax=htmlfiletype=html