Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to have a Vim syntax file command span multiple lines?
    primarykey
    data
    text
    <p>I'm trying to create a syntax file and I want to create some keyword groups for different colour highlighting (e.g. reserved words, operators etc. would be different colours). I can get this to work by doing one of the following two options:</p> <p><em>Option 1</em></p> <pre><code>syn keyword MyLangOperators operator1 operator2 operator3 syn keyword MyLangOperators operator4 operator5 operator6 syn keyword MyLangReserved reserved1 reserved2 reserved3 syn keyword MyLangReserved reserved4 reserved5 reserved6 </code></pre> <p>This isn't too bad, but if I'm trying to keep them in alphabetical order, it gets really messy once the number of reserved/operators etc. gets up there. Especially if you need to add new ones in the middle somewhere.</p> <p><em>Option 2</em></p> <pre><code>syn keyword MyLangOperators operator1 syn keyword MyLangOperators operator2 syn keyword MyLangOperators operator3 syn keyword MyLangOperators operator4 syn keyword MyLangOperators operator5 syn keyword MyLangOperators operator6 syn keyword MyLangReserved reserved1 syn keyword MyLangReserved reserved2 syn keyword MyLangReserved reserved3 syn keyword MyLangReserved reserved4 syn keyword MyLangReserved reserved5 syn keyword MyLangReserved reserved6 </code></pre> <p>This options is much easier to add reserved/operators later on because it is easy to keep them in alphabetical order. However, there is a lot of repeated text for every line (i.e. syn keyword [groupname]).</p> <p>Is there any possible way to be able to span the command over multiple lines? Something like this maybe:</p> <pre><code>syn keyword MyLangOperators ~ operator1 ~ operator2 ~ operator3 ~ operator4 ~ operator5 ~ operator6 syn keyword MyLangReserved ~ reserved1 ~ reserved2 ~ reserved3 ~ reserved4 ~ reserved5 ~ reserved6 </code></pre> <p>In this case the tilde (~) would be a signal to the Vim editor that the command continues onto the next line.</p> <p>Is there anything like this or am I stuck with option 1 or 2 (most likely I'd go with 2)?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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