Ubuntu + VIM + CakePHP 1.2 + .ctp syntax highlighting

Found this blog post concerning setting up the Cakephp view extension (.ctp) to use the same highlighting as (.php).

blog

I didn’t find his solution that helpful, but one of the comments said to add this to my ‘.vimrc’ file in my home directory.


if has(”autocmd”)
autocmd BufEnter *.ctp set syn=php
endif

And since we are on the topic here is how my .vimrc is setup

set tabstop=2
set shiftwidth=2
set expandtab

if has("autocmd")
autocmd BufEnter *.ctp set syn=php
endif

syn on

-later