Re: How to stop showing matching braces?



On 16/04/08 10:13, YANSWBVCG wrote:
Gary Johnson<garyjohn@xxxxxxxxxx> wrote:
Gary Johnson<garyjohn@xxxxxxxxxx> wrote:
YANSWBVCG<daf@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
This { is some text } to test bracket display with.

When I move the cursor starting from the 'T' in this,
upon encountering the left bracket, the cursor jumps
to the right bracket. There is no highlighting as
I have disabled it. Moving the cursor another position
to the right, the cursor jumps back to the space following
the left bracket. With the left bracket being highlighted,
entering append mode will cause the space to the right of
the right bracket to be highlighted. All this only in
xterm in kde.
Yes, I know it _appears_ that the cursor jumps in your test, but
actually it does not jump. You don't have to have syntax highlighting
enabled. I repeated your test by saving your message, deleting the
headers, then opening it in vim as

vim -X -N -u NORC -i NONE bracket_test

in an xterm with TERM set to a monochromatic xterm.

The cursor _appeared_ to move just as you described. However, you can
demonstrate that the cursor actually remains on that left bracket by
typing

rX

and observing that the left bracket changes to an X.
A better way to demonstrate that the cursor has not actually moved in
that scenario is to execute this command

hi MatchParen term=bold

then repeat your test. This also demonstrates that vim uses
highlighting even when syntax highlighting is not enabled.

Thanks for the tips.

I agree that the cursor does not actually move. Is there a way to
get the highlighting to move back to the cursor position after a
short pause?

The MatchParen highlight actually highlights _both_ paired brackets in the same colour. Whether both are noticeable may depend on whether it's gvim or Console Vim or on which colours are used.

Jumping to the matching bracket and back is another (older) option, see
:help 'showmatch'
and what it links to. It only works when _new_ brackets are inserted though.


Best regards,
Tony.
--
"One Saturday afternoon, during the campaign to decide whether or not
there should be a Coastal Commission, I took a helicopter ride from Los
Angeles to San Diego. We passed several state beaches, some crowded
and some virtually empty. They had the same facilities, and in some
cases the crowded and the empty beach were within a quarter mile of
each other. Obviously many beach-goers prefer to be crowded together.
Buying more beaches that people won't go to because they prefer to be
crowded together on one beach is a ridiculous waste of our natural
resources and our taxes."
-- Ronald Reagan
.



Relevant Pages

  • Re: Vim7: turn off skip to matching bracket?
    ... How do I turn off the vim7 feature where, when the cursor is moved onto ... a bracket, the cursor jumps to the matching bracket? ... is highlighting the corresponging column for chars like '(' and '{'. ...
    (comp.editors)
  • Re: How to stop showing matching braces?
    ... When I move the cursor starting from the 'T' in this, ... to the right bracket. ... the cursor jumps back to the space following ... You don't have to have syntax highlighting ...
    (comp.editors)
  • Re: How to stop showing matching braces?
    ... When I move the cursor starting from the 'T' in this, ... to the right bracket. ... the cursor jumps back to the space following ... You don't have to have syntax highlighting ...
    (comp.editors)
  • Re: Im a numpty!
    ... If people just rely on the Cursor being *Automatically* put right at ... Close Bracket") is s'posed to signify a "Smile"!!! ... Characters at the beginning of each Line, ... Newsreader) ...
    (uk.people.silversurfers)
  • Re: Vim7: turn off skip to matching bracket?
    ... How do I turn off the vim7 feature where, when the cursor is moved ... onto a bracket, the cursor jumps to the matching bracket? ... I tried:set noshowmatch. ...
    (comp.editors)