I'm looking for a way to change the behaviour of the % key. I know by default it will move the cursor to the corresponding parenthesis or brace, but I'm wondering if I can have it jump to the nearest similar character in the event I use it while on a non-bracket char. i.e.

    Lam a -> k $ VClosure (\v k' -> eval (v:env) a k')

(where ^ is the cursor position) should move the cursor to the left parenthesis a couple chars to the right, after which the normal behaviour applies.


1 Answer 1


Make use of a standard "matchit" plugin which provides [% and ]% commands.

To enable "matchit" simply add packadd! matchit to your vimrc (or execute packadd matchit in your current Vim session).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.