Slowness in Vim's bracket-matching with the default PHP syntax

Solution 1:

I don't see this locally; the matching parens is instantly highlighted. Try this:

:set filetype=txt

...and see if things improve. If so, something in vim's PHP handling configuration may be a bit out of whack. Do you see the same behaviour on very small PHP files? I'm on 7.2 on ubuntu and not seeing what you're seeing.

Hope this helps!
-Paul

UPDATE: thanks for updating your question to include your .vimrc - this leads to another thing for you to test. Please see if this doesn't help the situation - change php_folding to 1 rather than 2. 2 folds all { } regions so this may be somehow interacting with the parens-matching logic and causing the delay.

Solution 2:

Type this to turn it off per-instance:

:NoMatchParen

(capitalization is important)

Add this to your ~/.vimrc to disable it before the module loads:

let loaded_matchparen = 1

You only need one. With the first, you have to type it every time you open a PHP file, but you can turn it on again at any time. With the second, it's always off, but you can't simply turn it on again.