Hameedullah Khan
Hameedullah Khan

Reputation: 346

Vim auto indent of HTML in PHP filetype not working

I have been using Vim for a very long time now, I was never bothered about auto indentation and it was always off. But now I need to try auto indentation and enabled it.

I am having a strange issue that HTML auto indenation inside .php files doesn't work properly. It does work in .html files but not in .php files. I have tried every solution I could found on Google or on Stack overflow.

I have tried following:

The only solution that work for me is following but it break php auto indentation:

http://www.vim.org/scripts/script.php?script_id=604

The Vim version is: VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 28 2010 07:11:04)

These are the indent scripts loaded when I open a php file:

I also tried the spf-13 vim bundle, but that doesn't indent html inside php either.

Upvotes: 3

Views: 5233

Answers (1)

Rakesh Sankar
Rakesh Sankar

Reputation: 9415

Try the following link and it seems to be working for me:

https://github.com/2072/PHP-Indenting-for-VIm - pure for PHP

If you want to try PHP + HTML, then

http://vim.wikia.com/wiki/Better_indent_support_for_php_with_html

Upvotes: 4

Related Questions