faqts : Computers : Programming : Languages : PHP : Not Quite PHP : Editors

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 6 people (33%) answered Yes
Recently 0 of 4 people (0%) answered Yes

Entry

How can I make a .php vi syntax file work for .phtml files too?

Jul 14th, 1999 10:26
n, Nathan Wallace,


If you are using http://www.vim.org on linux

1. edit the syntax.vim file

:e $VIM/syntax/syntax.vim

2. look for the php syntax extensions

/php

3. add the .phtml type to that line so it looks something like:

au BufNewFile,BufRead *.php3,*.inc,*.php,*.phtml        so
$VIM/syntax/php3.vim

You might have to do that stuff as root depending on who you installed
vim as.

If you're using some nonstandard extension, and you find that this 
doesn't work, check the rest of the file. It's possible that another 
language is using the same extension and thereby trampling your change.