Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Edit:</strong> You can query most of the values for a particular highlight group with the <code>synIDattr()</code> function. For example, this will print the foreground color assigned to <code>CursorLine</code> if one has been set:</p> <pre><code>:echo synIDattr(synIDtrans(hlID("CursorLine")), "fg") </code></pre> <p>You can also determine the state of <code>underline</code>, <code>undercurl</code>, etc., with similar calls.</p> <p>A couple of warnings: <code>synIDattr()</code> is buggy and incomplete. It sometimes returns -1 unexpectedly, and doesn't currently allow all attributes to be inspected. (A patch is supposedly in the works for an upcoming release of Vim.) See these threads for more information:</p> <p><a href="http://groups.google.com/group/vim_dev/browse_thread/thread/ad4cb2d528db91b5" rel="nofollow noreferrer">Problem with synIDattr()</a></p> <p><a href="http://groups.google.com/group/vim_use/browse_frm/thread/68373b7463ef2099#" rel="nofollow noreferrer">Programmatically detect a current "highlight" setting?</a></p> <p>If <code>synIDattr()</code> won't do what you want, it might be easier to redirect the output of the <code>highlight</code> command to a variable and parse it yourself:</p> <pre><code>:redir =&gt; cursorline_highlight | silent highlight CursorLine | redir END :echo "CursorLine highlight: " . cursorline_highlight </code></pre> <hr> <p>The color of the cursor line can be set with a <code>highlight</code> command like this one:</p> <pre><code>:highlight CursorLine term=underline guibg=#555555 cterm=underline </code></pre> <p>This is typically done within a Vim colorscheme file, which contains many such lines to define the colors for parts of the Vim user interface, as well as for common syntactic elements like strings, numbers, keywords, etc.</p> <p>You can tell Vim what colorscheme to use by issuing the <code>colorscheme</code> command followed by a scheme name. Here are a few to try:</p> <pre><code>:colorscheme desert :colorscheme evening :colorscheme koehler </code></pre> <p>However, most of the colorschemes included with Vim don't actually contain a highlight command for the <code>CursorLine</code> element, so Vim just uses its built-in default cursorline coloring.</p> <p>To change the colors Vim uses for the cursorline, you can include your own <code>highlight</code> command in your <code>.vimrc</code> file (<em>after</em> you've issued any <code>colorscheme</code> command; otherwise your highlight colors might get cleared). Better still, you can make your own colorscheme file and add the appropriate highlight statement there. (Make it easy on yourself by finding a tolerable colorscheme, then copying it and making whatever changes you like.)</p> <p>Vim includes several colorscheme files, and you can find many more online. Here's a site that previews a few hundred:</p> <p><a href="http://code.google.com/p/vimcolorschemetest/" rel="nofollow noreferrer">http://code.google.com/p/vimcolorschemetest/</a></p> <p>See the following help topics for more info:</p> <pre><code>:help :colorscheme :help :highlight :help hl-CursorLine </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. 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.
    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