Skip to content


Add a file extension to vim syntax highlighting

I am trying to edit my template files containing *.ctp and on vim, you usually won’t see any syntax highlighting if it is not a known file extension.

So, to activate it for my *.ctp templates. Just add this on your ~/.vimrc file

:syntax on
:filetype on
:au BufNewFile,BufRead *.ctp set filetype=xml

Save and re-edit your *.ctp file.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Posted in Linux, Operating Systems, PHP, Programming.

Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.