Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use Vim for edit files. When I open file with .tt extension I have to use command set filetype=html in order to set syntax highlighting on for this file. How can I use this command by default automatically when I open an *.ff files in Vim?

p.s. or may be you know some good and proven vim plugins to set .tt syntax highlighting?

share|improve this question
    
Is it .tt or .ff, and what kind of (supposedly HTML-like) file type is that?! –  Ingo Karkat Feb 2 '13 at 19:49
    
.tt is extension of template-toolkit files which may content html code too. –  edem Feb 2 '13 at 20:05
add comment

1 Answer 1

up vote 2 down vote accepted

See :help new-filetype; you have some choices where to put the command (lump them together in ~/.vim/filetype.vim, or separate them in a file in ~/.vim/ftdetect/...), but it boils down to this:

au! BufRead,BufNewFile *.tt     setfiletype html
share|improve this answer
    
Thank you very much for the advice! –  edem Feb 2 '13 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.