Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe that there is no default highlighting for braces as standard in vim for C code or derivative languages (they're just highlighted as plain text). You could define your own, using something like:</p> <pre><code>:syn match Braces display '[{}()\[\]]' :hi Braces guifg=red </code></pre> <p>or you could download the <a href="http://www.vim.org/scripts/script.php?script_id=1561" rel="nofollow noreferrer">rainbow brace highlighting plugin</a>, which gives varying colours for different levels of indentation. See also my answer to <a href="https://stackoverflow.com/questions/542929/highlighting-unmatched-brackets-in-vim">this question</a>.</p> <pre><code>:help :syn-match :help hi </code></pre> <p>There is a screenshot of the rainbow brace highlighter in action (with my <a href="http://sites.google.com/site/abudden/contents/Vim-Scripts/bandit-colour-scheme" rel="nofollow noreferrer">Bandit</a> colour scheme) <a href="http://9079554918504034906-a-1802744773732722657-s-sites.googlegroups.com/site/abudden/contents/Vim-Scripts/ctags-highlighting/regexp_with.png?attredirects=0&amp;auth=ANoY7co6ULtxbrqK3w4exDXh1b7H9s6qtidYVNbCn3OABLTaA7tUh1_dUoiV1Hbj1zXXzWl4qDL2vr4k3x8y-GBb0xUUjPY0G33RdYW22O8-dNbyPo0yA8YGOr66L7zuEvyuzyNLVA1y4p-LRz7jUbfO9K_DJMM4Ur2T9VYrXRiwFIo-rtu7Rsenqo5n4SzA7DYBkYPpKfbIggyNdyE5gw634-KW2mJViT1ig1S2p78-sDUF3k8CksWcWpBmD6T18e5GGu_pmgKi" rel="nofollow noreferrer">here</a>.</p> <p><b>Edit:</b></p> <p>In order to find out the highlighting group of anything that interests you, create this mapping:</p> <pre><code>:map &lt;F3&gt; :echo "hi&lt;" . synIDattr(synID(line("."),col("."),1),"name") . '&gt; trans&lt;' . synIDattr(synID(line("."),col("."),0),"name") . "&gt; lo&lt;" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . "&gt;"&lt;CR&gt; </code></pre> <p>(taken from <a href="http://vim.wikia.com/wiki/Identify_the_syntax_highlighting_group_used_at_the_cursor" rel="nofollow noreferrer">here</a>). Then, move the cursor over whatever you're interested in and press F3. If it's not highlighted at all, Vim will print:</p> <pre><code>hi&lt;&gt; trans&lt;&gt; lo&lt;&gt; </code></pre> <p>If there's a particular highlight group, you'll get something like this (with the cursor over the <code>if</code> keyword):</p> <pre><code>hi&lt;cConditional&gt; trans&lt;cConditional&gt; lo&lt;Conditional&gt; </code></pre> <p>which tells you that the highlight group is called <code>cConditional</code> and that it is linked (with <code>:hi link</code>) to the group called <code>Conditional</code>. With rainbow brace highlighting, you may get something like <code>cCurly1</code>, which means it's inside a curly brace, but with no additional highlighting.</p> <p><b>Edit 2:</b></p> <p>A possible operator matcher (not very well tested):</p> <pre><code>let cOperatorList = '[-&amp;|+&lt;&gt;=*/!~]' " A list of symbols that we don't want to immediately precede the operator let cOperatorList .= '\@&lt;!' " Negative look-behind (check that the preceding symbols aren't there) let cOperatorList .= '\%(' " Beginning of a list of possible operators let cOperatorList .= '\(' " First option, the following symbols... let cOperatorList .= '[-&amp;|+&lt;&gt;=]' let cOperatorList .= '\)' let cOperatorList .= '\1\?' " Followed by (optionally) the exact same symbol, so -, --, =, ==, &amp;, &amp;&amp; etc let cOperatorList .= '\|' " Next option: let cOperatorList .= '-&gt;' " Pointer dereference operator let cOperatorList .= '\|' " Next option: let cOperatorList .= '[-+*/%&amp;^|!]=' " One of the listed symbols followed by an =, e.g. +=, -=, &amp;= etc let cOperatorList .= '\|' " Next option: let cOperatorList .= '[*?,!~%]' " Some simple single character operators let cOperatorList .= '\|' " Next option: let cOperatorList .= '\(' " One of the shift characters: let cOperatorList .= '[&lt;&gt;]' let cOperatorList .= '\)' let cOperatorList .= '\2' " Followed by another identical character, so &lt;&lt; or &gt;&gt;... let cOperatorList .= '=' " Followed by =, so &lt;&lt;= or &gt;&gt;=. let cOperatorList .= '\)' " End of the long list of options let cOperatorList .= '[-&amp;|+&lt;&gt;=*/!~]' " The list of symbols that we don't want to follow let cOperatorList .= '\@!' " Negative look-ahead (this and the \@&lt;! prevent === etc from matching) exe "syn match cOperator display '" . cOperatorList . "'" syn match cOperator display ';' hi link cOperator Operator </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload