Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way that I can change my .vimrc file so that unclosed parenthesis/brackets/braces are highlighted? For instance the following would highlight the parenthesis after the word main:

public static void main(String[] args

Or perhaps, have VIM somehow tell me that I have an unclosed parenthesis. It appears that VIM currently shows when you have an unopened parenthesis but not when you have an unclosed one.

share|improve this question
This would be nice, though I doubt we will see a solution since the default would be the same next close peren, so the missing one after String[] would be assumed as the one after since VIM doesn't know that's not an argument. – nerdwaller Feb 2 '13 at 1:35
up vote 2 down vote accepted

There exists a plugin for vim to do just this. Given this your example code:

public static void main(String[] args

Wherever you place your cursor, the closest back mismatched parentheses will be highlighted. The only defect is that it doesn't look ahead, to see if it is matched later. So if you were within the pringln parentheses if would highlight the opening one. It is basically functional and should serve you fine.

It is called vim-matchopen and can be found at

If you havn't had expirence installing vim plugins, here is a quick intro for this one. (I am assuming that you are using Linux.)

Go to the download site. If you have git and know how to use it, go ahead. If not then use the download zip button, and extract the downloaded zip to some temporary destination.

Next you need to take the script plugin/matchopen.vim and place it in the directory ~/.vim/plugin. If that directory doesn't exist, create it.

That should be it. Then you will be up and running. Just restart vim.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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