1

When I enable syntax highlighting in vim, in PHP I get a red highlight on a semi-colon followed by a single or multiple line comment. I originally thought this was some conflict in vim, but my .vimrc only has syntax enable at this point and I still get the error.

ex://

<?php
require_once 'autoloader.php';

/* Initialize variables */

will display as: output

Has anyone else seen this?

3
  • Does require_once('autoloader.php'); work? Commented Feb 4, 2014 at 16:03
  • No, it still gets the same highlighting error. It seems like there's an overzealous regex somewhere, but I don't know where it could be. Nothing is in the vimrc except syntax enable. Commented Feb 4, 2014 at 17:36
  • What is interesting is it doesn't do it with echo "Output"; as the first line and if it's doing it, it doesn't matter how many blank lines are in between. Commented Feb 4, 2014 at 17:38

1 Answer 1

2

It looks like the issue was with my copy of the php syntax file. I renamed ~/.vim/syntax/php.vim and things went back to normal.

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

Comments

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.