Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You were nearly there! This version (works and) doesn't highlight the quotation marks.</p> <pre><code>au BufRead,BufNewFile *.log hi sql guifg=white guibg=red ctermfg=white ctermbg=red au BufRead,BufNewFile *.log syn match sql /"\zssql_\w*\ze"/ </code></pre> <p><img src="https://i.stack.imgur.com/n58DJ.png" alt="screen-shot"></p> <p>See the following for more information:</p> <ul> <li><code>:help :syn-match</code> " for syntax matching, erm, syntax</li> <li><code>:help /\zs</code> " sets the start of the match there</li> <li><code>:help /\ze</code> " sets the end of the match there</li> <li><code>:help /\w</code> " word character</li> </ul> <hr> <p><strong>Debugging:</strong></p> <p>The command <code>:verbose :syn</code> should give you something like this:</p> <pre><code>--- Syntax items --- [...] sql xxx match /"\zssql_\w*\ze"/ </code></pre> <p>And <code>:verbose :hi</code>:</p> <pre><code> Last set from ~/.vimrc [...] sql xxx cterm=bold ctermfg=7 ctermbg=1 guifg=white guibg=red </code></pre> <p>The <code>xxx</code> should be in the same colours as you have specified (and look like the highlighting in my screen-shot). If you don't see those, check that your <code>.vimrc</code> (or <code>_vimrc</code> on Windows) is sourced:</p> <pre><code>:scriptnames 1: /home/javh/.vimrc [...] </code></pre> <p>Of course this only works when:</p> <pre><code>:echo has('syntax') </code></pre> <p>...returns <code>1</code> (or <code>:version</code> includes <code>+syntax</code>).</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