Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have tried to put the following in my .vimrc file:

syn match parens /[(){}]/
hi parens ctermfg=red

to permanently color brackets, parentheses, braces etc, however it doesnt work. If I do it inline inside vim it does work.

Any ideas why?

Thanks

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Because all syntax highlighting is local to the buffer that is active when the syntax items are defined. Try something like this:

autocmd BufRead,BufNewFile * syn match parens /[(){}]/ | hi parens ctermfg=red
share|improve this answer
add comment

Rainbow Parenthesis Highlight matching parens in a rainbow of colors

share|improve this answer
add comment

Your Answer

 
discard

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