On 24/03/2022 01:22, Eli the Bearded wrote:
> Adri Verhoef <
a...@a3.xs4all.nl> wrote:
>> Hi, I've been using Vi and Vim since the eighties. My current Vim
>> version is 8.2.4579, provided by Fedora Linux.
>>
>> I have this line in a file:
>> <a href="[^"]+_trk([^"]+)">
>>
>> When the cursor is on the first or second [, then the matching ] lights up.
>> When the cursor is on the first [ and I type %, the cursor jumps to the
>> second ].
>> When the cursor is on the (, the ) lights up.
>> When the cursor is on the ( and I type %, nothing happens.
> I suppose you know about the M and % compatibility options?
>
> :help cpo-M
> :help cpo-%
I did read that before posting, yes.
> It sounds like the matchparen plugin is showing you a "match" without
> properly taking the cpoptions setting into account or is being confused
> by the syntax highlighting guess of content type. Personally I find
> matchparen and showmatch highly distracting and don't use them. Maybe
> you'd enjoy that, too.
Actually, I've never found it too distracting, so never thought of
turning it off.
Still, Vim shows one thing and does the other. That is not logical.
Is that because the old Vi (behaviour) does the wrong thing?
Because if I do in Vim:
se cpoptions=aABceFs (this is my default, apparently)
se cpoptions+=%
... then it works as expected, i.e. logically. WYSIWYG. :-)
And when I do
vim -u NONE "+se cpo"
I get:
cpoptions=aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;
Adri