new php auto indent

6 views
Skip to first unread message

Robin Wood

unread,
Mar 30, 2008, 3:56:43 PM3/30/08
to vim...@googlegroups.com
Hi
Is it just me or has the way the php auto indent works changed recently?

I do a lot of php work and have recently found that I'm getting new
indents where I didn't before and, worse for me, when I switch out of
php with a ?> and go to a new line to enter some html the indent drops
to the start of the line where it used to stay at the same indent
level. I like to keep my html indented with my php (I didn't use to
but a boss forced me to do that and now I can't stop) so I'd like to
go back to the old method. There are also other issues when switching
between entering php and html with the indents jumping all over the
place.

Is there an easy way to switch back or should I just get an indent
file from an older version of vim and overwrite the new one?

Robin

Mr Shunz

unread,
Mar 31, 2008, 5:22:53 AM3/31/08
to vim...@googlegroups.com
>
> Hi
> Is it just me or has the way the php auto indent works changed recently?
>
[snip]

> Is there an easy way to switch back or should I just get an indent
> file from an older version of vim and overwrite the new one?
>

hi,
have a look here:

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

it should fix the issue.

cheers

--
Daniele Santi .o.
MrS...@gmail.com ..o |,,,/_
Linux User #415108 ooo
---------------------------------------------------------
() ascii ribbon campaign - against html mail
/\ - against microsoft attachments
---------------------------------------------------------

John Beckett

unread,
Mar 31, 2008, 6:35:13 AM3/31/08
to vim...@googlegroups.com
Mr Shunz wrote:
> have a look here:
> http://vim.wikia.com/wiki/Better_indent_support_for_php_with_html
> it should fix the issue.

Good, but it would be great if someone who understands the issues would fix
the tip.

Should the body of the tip be deleted and replaced with the version in the
Comments written by Heptite? I'm happy to edit the tip if someone could
confirm that would be desirable.

John

Mr Shunz

unread,
Mar 31, 2008, 6:48:22 AM3/31/08
to vim...@googlegroups.com

I personally modified the original indent/php.vim (and then saved it
for future uses) as the tip suggested.

The solution in the comment is actually more elegant, it simply make
a local version which includes both original php.vim and html.vim and
apply the needed modifications. It also has the advantage that survives
upgrades of the plugin.

So, yes, i think the best way is that on the comment ...

btw on vim scripts there are some alternative php.vim to download with
addeded features, you can check if they suit your needs ...

Bram Moolenaar

unread,
Apr 1, 2008, 6:13:26 AM4/1/08
to Mr Shunz, vim...@googlegroups.com

Daniele Santi wrote:

> > Hi
> > Is it just me or has the way the php auto indent works changed recently?
> >
> [snip]
> > Is there an easy way to switch back or should I just get an indent
> > file from an older version of vim and overwrite the new one?
> >
>
> hi,
> have a look here:
>
> http://vim.wikia.com/wiki/Better_indent_support_for_php_with_html
>
> it should fix the issue.

Please get together with the indent script writer, John Wellesz, and
come up with the best version to be included with Vim.

--
hundred-and-one symptoms of being an internet addict:
201. When somebody asks you where you are, you tell them in which chat room.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages