1

I've tried a dozen rainbow plugins.

They all work, until i open a php file or set filetype=php. Then I get parentheses with the same color in that buffer.

what is the reason for this? I tried learning about vim's syntax highlight files, but it is harder then picking up a new low level language and then reading an undocumented program... not really something i can do in a few hours :( only the php.vim syntax is over 700 lines.

I've found this: https://defuse.ca/blog/vim-rainbow-parentheses-work-in-php suggesting i edit php.vim and change:

- syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch
+ syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch,level16

but it did nothing... and i could find anything else, not even looking on the g:rbpt_max var that article mentions.

ideas? Anything that works on php for you?

3
  • Here is an idea: it is the plugin author's responsibility to make his language-agnostic plugin work across languages. Use your favorite rainbow parentheses plugin's issue tracker to notify the author/maintainer of your issue and work with him toward a solution.
    – romainl
    Apr 21, 2014 at 11:06
  • I plant to, but first i want to understand if i should instead bug php syntax file authors :) since it is a problem that affects all plugins of that sort, it may not even be their fault or there may not even be something they can do if the syntax file breaks the features they use... anyway, need to understand better. that is why I want to know if anyone has any recipe that works before.
    – gcb
    Apr 21, 2014 at 19:10
  • 14 hours without an answer is not a good sign. But you are right, keep waiting for answers on the wrong site instead of actively trying to solve your issue with the plugin authors themwelves.
    – romainl
    Apr 21, 2014 at 19:21

2 Answers 2

0

Works with https://github.com/amdt/vim-niji

Screenshot

syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch,paren1,paren2,paren3,paren4,paren5,paren6,paren7,paren8,paren9,paren10
0

This is a very very late answer :)

I think this plugin solved your problem.

The reason why it is hard for vim rainbow plugins to support php is described here

And the above plugin solves these problems via these lines

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .