Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get matching brace highlighting without cursor jump in vim

Tags:

vim

editor

I am running vim 7.3 on several machines. By default MatchParen is enabled on all of my instances. Using gvim on my windows machine, it is doing exactly what I want - when my cursor is on a bracket, paren, etc. it visually highlights the match. It does not affect cursor navigation. However, on my Ubuntu boxes, when I move the cursor onto the character, it actually jumps to the match.

I'm sure that the behavior is caused by MatchParens because if I do a :NoMatchParen, it stops. Unfortunately, I also don't get the highlighting at that point. I can't figure out where my settings differ, though.

I'll like you even more if you can point me towards a plugin that will always highlight the closest enclosing pair of characters around my current position (like a code oriented version of MatchTagsAlways)

like image 986
rhuffstedtler Avatar asked Dec 07 '25 02:12

rhuffstedtler


1 Answers

When showmatch is set, the cursor is actually jumping, and the following line fixes the problem:

set matchtime=0

More details: http://vimdoc.sourceforge.net/htmldoc/options.html#'matchtime'

like image 98
wintermute Avatar answered Dec 08 '25 19:12

wintermute



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!