Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
Understanding vim syntax offsets

I'm having a lot of trouble with syntax offsets, and I'm not understanding the explanation given in the Vim help docs.

I have the following in my PHP ftplugin:

syntax region mySQLRegion
  \ contains=@SQLSyntax
  \ containedin=phpRegion
  \ contained
  \ matchgroup=sqlDelim
  \ start=+\vSQL\("$+
  \ end=+^\s*"[,)]+
  \ keepend

I want to match code constructs like the following:

... SQL("
    ...my sql here...
", ...

Currently this works. But I want the highlighting to take place strictly between the two delimiting lines -- in other words, I want the leading SQL(" and the closing ", to be highlighted with standard PHP highlighting.

I've tried several different permutations of the offsets, but either the rest of the file gets colored with SQL highlighting or the SQL block gets colored as a PHP string. I'm looking for both an answer to this question in particular and for a more general explanation of how to think about when to use ms/me vs. rs/re vs. hs/he, when it would make sense to use either =s+/-{nr} or =e+/-{nr} in those contexts. I get that it's supposed to be match, region, and highlighting and that it's start and end of match offset by a number of characters in either direction, but I'm clearly not understanding it properly because none of my attempts were successful.

Reference

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda