Tuesday, May 1, 2012

Re: Matchtime not working

Dotan Cohen wrote:
> On Tue, May 1, 2012 at 17:39, Taylor Hedberg<tmhedberg@gmail.com> wrote:
>
>> The highlighting you are used to is provided by the matchparen plugin.
>> 'showmatch' and 'matchtime' are, on the other hand, for Vim's built-in
>> (i.e. not implemented as a plugin) matching functionality, which, rather
>> than highlighting, jumps the cursor to the matching opening
>> brace/bracket/parenthesis for a brief time after the closing character
>> in the pair is typed. Try typing some opening and closing parentheses
>> after `:set showmatch` and you'll see what I mean. This feature is
>> turned off by default.
>>
>> As far as I know, the matchparen plugin does not refer to the
>> 'matchtime' option to determine how long to highlight; it is either on
>> indefinitely or it is off. Barring modification to the plugin itself, I
>> don't think there's any way to get precisely what you want.
>>
> Thanks Taylor, I see it now. I was testing with existing code,
> expecting to put the cursor on a brace and see the match. I now
> understand that it only works for typing out new code.
>
> Is there any way to change the behaviour of the matchparen plugin to
> underline the matching brace, instead of highlighting it? I often get
> confused which is the highlighted brace and which brace has the
> cursor.
>
In quickly diving into matchparen, I see that the matching brace is the
MatchParen highlighting group.

Consequently,

hi clear MatchParen
hi MatchParen gui=underline cterm=underline

should do the trick. When you're happy with it, put these two lines into

.vim/after/plugin/matchparen.vim

Regards,
Chip Campbell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment