Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell Vim to ignore certain "second extensions"?

Tags:

vim

E.g. foo.php.tpl should be highlighted as PHP, foo.js.erb as Javascript, foo.py.tmp as Python...

like image 879
Tgr Avatar asked Sep 11 '25 05:09

Tgr


1 Answers

I would add something like this in ~/.vimrc

au BufEnter,BufRead *.php.tpl set filetype=php
au BufEnter,BufRead *.js.erb set filetype=javascript
au BufEnter,BufRead *.py.tmp set filetype=python

Same as that of @leaf's answer but accounted for BufRead event also.

like image 160
dlmeetei Avatar answered Sep 13 '25 19:09

dlmeetei