Vim doesn't want to highlight my target named " * .o " and its dependencies because of the char ' * ' that I use to target all object files. When I replace the ' * ' by letters the highlighting works correctly.

Vim makefile bad syntax highlighting

Is this behavior normal or is it a vim bug ? Would be nice to know if there is a way to fix it.


That rule could be better written as

%.o: %.cpp
    clang++ -Wall (...) $<

This way, only the source files newer than their object files are compiled. And the highlighting will also work as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.