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?

  • 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

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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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