Note that there are some explanatory texts on larger screens.

plurals
  1. POCustomizing Syntax Highlighting in Vim
    text
    copied!<p>How I can <strong>keep all the current formatting</strong> for a file type but <strong>add functionality</strong>. </p> <p>I would like to highlight colors in .vim files so that each color is highlighted how the terminal will resolve it. </p> <p>I created a vim.vim file containing:</p> <pre><code>syn keyword yellow yellow containedin=All highlight yellow ctermfg=yellow syn keyword red red containedin=all highlight red ctermfg=red </code></pre> <p>and put it into <code>~/.vim/after/syntax/vim.vim</code></p> <p>As suggested <a href="https://stackoverflow.com/questions/1211588/how-to-override-default-syntax-highlight-in-vim/1212024#1212024">here</a>.</p> <p>This has no effect. </p> <hr> <h1>Update</h1> <p>In fact I was mistaken when I said my changes had no effect. If you type <code>yellow</code> by itself on a line it will be highlighted yellow. Unfortunately this does not solve my problem. </p> <p>I added the F3 functionality described by <a href="https://stackoverflow.com/questions/2464593/custumizing-syntax-highlighting-in-vim/2473543#2473543">Al</a>. </p> <p>When I f3 over yellow (in the context <code>ctermfg=yellow</code>) it returns:</p> <pre><code>hi&lt;vimHiCtermColor&gt; trans&lt;vimHiCtermColor&gt; lo&lt;vimHiCtermColor&gt; FG:-1 BG:-1 </code></pre> <p>Then <code>:syn list vimHiCtermColor</code> returns:</p> <pre><code>--- Syntax items --- vimHiCtermColor xxx contained lightmagenta darkgray lightgrey darkgrey lightgreen lightgray darkmagenta gray white red grey darkred brown darkblue darkgreen lightblue yellow cyan contained lightcyan lightred black blue green magenta darkcyan darkyellow </code></pre> <p>I checked <code>:syn list darkgray</code> (something I have not defined) to see if it exists: </p> <pre><code>--- Syntax items --- E28: No such highlight group name: darkgray Hit ENTER or type command to continue </code></pre> <p>Where should I go from here? </p>
 

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