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

link|improve this question
feedback

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
link|improve this answer
feedback

Rainbow Parenthesis Highlight matching parens in a rainbow of colors

link|improve this answer
feedback

Your Answer

 
or
required, but never shown