Here's a PHP snippet
$foo = array( 'bar' => 'baz' );
When I enter this in Vim, I will get a bell/beep on pressing >
. This does not happen if I type <something>
, so I think it's trying to be helpful in saying "ah, you've closed an angle bracket but you didn't open one!". But it's not helpful, it just seems not to understand the context: assignment to an associative array.
It also beeps/bells when I type $foo->bar
.
I have set ft=php
, which all seems to be working fine, other than this infuriating beep.
I know I can disable the beep altogether, but I'd rather keep the beep for things I really do need to be beeped at for. I know about visual bell, but I don't want a headache inducing flash every time I access a method, property or assign to a new array!
You probably have the set showmatch
line which, as you said, tries to be helpful and match open and closed brackets.
You can try to add the following line in your .vimrc:
au BufWinEnter *.php set mps-=<:>
or just
setlocal matchpairs-=<:>
in the PHP vim configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With