Is it possible to have a syntax match (not keyword) match only inside a certain syntax region? I had this issue a while ago and came up with this:
" lua.vim
syntax include @loveconf <sfile>:p:h/love-conf.vim
" Some time later
syntax region loveconfregion start="\<love\.conf\>" end="\<end\>"me=e-3,he=e-3,re=e-3 skipwhite skipempty containedin=ALLBUT,luaString,luaComment contains=ALL
highlight loveconf ctermfg=206
Where love-conf.vim looked like this:
" Simple example; actual file contains a regex
syntax match loveconf "\.window\.width" containedin=loveconfregion
I would like, if possible, to move it all to one file. Is there any way to do this?
As a guideline, here is an example file:
-- test.lua
t.window.width = 20
-- ^ Not colored
function randomFunction()
t.window.width = 20
-- ^ Also not colored
end
function love.conf( t )
t.window.width = 20
-- ^ Colored
end