sponsor Vim development Vim logo Vim Book Ad

phtml.vim : A syntax file to php templates.

 script karma  Rating 18/6, Downloaded by 1599  Comments, bugs, improvements  Vim wiki

created by
Giuliani Sanches
 
script type
syntax
 
description
Use this script to enable syntax coloring when using a mix of html and php or with template engines like those used by CakePHP, Symfony, SolarPHP and others

To use xmledit (vimscript #301) with phtml files change line 105 to:

if &filetype == 'xml' || (!exists ("g:did_xhtmlcf_inits") && exists ("g:xml_use_xhtml") && (&filetype == 'html' || &filetype == 'xhtml' || &filetype == 'php' || &filetype == 'phtml' || &filetype == 'rhtml'))

And line 168 to:

if (&filetype == 'html' || &filetype == 'php' || &filetype == 'phtml') && (!exists ("g:xml_no_html"))

And symlink:

cd $HOME/.vim/ftplugin
ln -s xml.vim phtml.vim
 
install details
Just drop into .vim/syntax

To enable a better identation symlink the default html.vim to phtml.vim:

ln -s $VIMRUNTIME/indent/html.vim $HOME/.vim/indent/phtml.vim
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
phtml.vim 0.1.2 2007-11-20 7.0 Giuliani Sanches Changed name to phtml.
Now the script will override the defaul phtml file (wich has some issues) and can be used with any template using php as script language.
solar.vim 0.1.1 2007-11-19 6.0 Giuliani Sanches This script was based on mako.vim by Armin Ronacher. So.. credits added ;)
solar.vim 0.1 2007-11-19 7.0 Giuliani Sanches Initial upload
ip used for rating: 52.14.126.74

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github