11

I use vim for web development. These are almost always .php files, which also contain HTML and sometimes Javascript. While working in a block of PHP, indenting works fine. The syntax highlighting is okay, but only really useful for the PHP-code. When I want to edit an HTML block, I usually switch: :set ft=html, so that highlighting and indenting work well for that. Of course, I keep switching back and forth, which is time-consuming. I'd like to have all three languages' highlighting and indenting intelligently combined. Being able to =G the whole file at once and have it work for each block according to its own rules would be fantastic.

While I know that "I can do this myself", I somehow doubt that I'm the first person wanting this, and I'm looking for an existing solution.

Can anyone help me out?

2 Answers 2

4

I haven't tried this, but what about Better indent support for php with html.

Sign up to request clarification or add additional context in comments.

Comments

1

Hope this might help you.. https://github.com/2072/PHP-Indenting-for-VIm

and Why dont you use gedit as the editor its light weight and supports well for various file types. just a suggestion for you.

1 Comment

Thanks for the link. As far as gedit goes, I know plenty of people who like it, but I've been using vim for five years and I don't think I'll be switching soon :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.