Refining just syntax a bit more
This commit is contained in:
parent
5bfc637a7e
commit
56321d17b6
@ -63,8 +63,8 @@ function! s:justSetShellName(shell_name)
|
||||
|
||||
syn include @setshellsyntax syntax/sh.vim
|
||||
finally
|
||||
syn region justSubshell matchgroup=justBacktick start=/\v\`/ skip=/\v\\\`/ end=/\v\`/ contains=@setshellsyntax
|
||||
syn region justSubshell matchgroup=justBacktick start=/\v\`\`\`/ skip=/\v\\\`/ end=/\v\`\`\`/ contains=@setshellsyntax
|
||||
syn region justSubshell matchgroup=justBacktick start="\v\`" skip="\v\\\`" end="\v\`" contains=@setshellsyntax
|
||||
syn region justSubshell matchgroup=justBacktick start="\v\`\`\`" skip="\v\\\`" end="\v\`\`\`" contains=@setshellsyntax
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
@ -81,38 +81,47 @@ syn keyword justFunction justfile justfile_directory just_executable
|
||||
|
||||
syn keyword justSetting shell export dotenv-load positional-arguments
|
||||
|
||||
syn match justOperator /\v:/
|
||||
syn match justOperator /\v\)/
|
||||
syn match justOperator /\v\(/
|
||||
syn match justOperator /\v\=/
|
||||
syn match justOperator /\v:\=/
|
||||
syn match justOperator "\v:"
|
||||
syn match justOperator "\v\)"
|
||||
syn match justOperator "\v\("
|
||||
syn match justOperator "\v\+"
|
||||
syn match justOperator "\v\@"
|
||||
syn match justOperator "\v\="
|
||||
syn match justOperator "\v:\="
|
||||
|
||||
syn match justQuote /\v"/
|
||||
syn match justQuote /\v'/
|
||||
syn match justQuote /\v"""/
|
||||
syn match justQuote /\v'''/
|
||||
syn match justQuote '\v"'
|
||||
syn match justQuote "\v'"
|
||||
syn match justQuote '\v"""'
|
||||
syn match justQuote "\v'''"
|
||||
|
||||
syn match justBacktick /\v\`/
|
||||
syn match justBacktick /\v\`\`\`/
|
||||
syn match justBacktick "\v\`"
|
||||
syn match justBacktick "\v\`\`\`"
|
||||
|
||||
syn match justCurlyBrace /\v\{\{/
|
||||
syn match justCurlyBrace /\v\}\}/
|
||||
syn match justCurlyBrace "\v\{\{"
|
||||
syn match justCurlyBrace "\v\}\}"
|
||||
|
||||
syn region justCurlyBraced matchgroup=justCurlyBrace start=/\v\{\{/ skip=/\v\\\{/ end=/\v\}\}/ contains=justKeyword,justFunction,justOperator,justQuote,justString,justRawString
|
||||
syn match justComment "\v#.*$"
|
||||
|
||||
syn region justString matchgroup=justQuote start=/\v"/ skip=/\v\\"/ end=/\v"/ contains=justCurlyBraced
|
||||
syn region justString matchgroup=justQuote start=/\v"""/ skip=/\v\\"/ end=/\v"""/ contains=justCurlyBraced
|
||||
syn match justShebang "\v^ *#!.*$"
|
||||
|
||||
syn region justRawString matchgroup=justQuote start=/\v'/ end=/\v'/
|
||||
syn region justRawString matchgroup=justQuote start=/\v'''/ end=/\v'''/
|
||||
syn match justPublicName "\v[a-zA-Z][_a-zA-Z0-9-]*[a-zA-Z0-9_]"
|
||||
syn match justPrivateName "\v_[a-zA-Z0-9][_a-zA-Z0-9-]*[a-zA-Z0-9_]"
|
||||
|
||||
syn region justSubshell matchgroup=justBacktick start=/\v\`/ skip=/\v\\\`/ end=/\v\`/ contains=@setshellsyntax
|
||||
syn region justSubshell matchgroup=justBacktick start=/\v\`\`\`/ skip=/\v\\\`/ end=/\v\`\`\`/ contains=@setshellsyntax
|
||||
syn region justCurlyBraced matchgroup=justCurlyBrace start="\v\{\{" skip="\v\\\{" end="\v\}\}" contains=justKeyword,justFunction,justOperator,justQuote,justString,justRawString
|
||||
|
||||
syn match justComment /\v#.*$/
|
||||
syn region justString matchgroup=justQuote start='\v"' skip='\v\\"' end='\v"' contains=justCurlyBraced
|
||||
syn region justString matchgroup=justQuote start='\v"""' skip='\v\\"' end='\v"""' contains=justCurlyBraced
|
||||
|
||||
syn match justShebang /\v^ *#!.*$/
|
||||
syn region justRawString matchgroup=justQuote start="\v'" end="\v'"
|
||||
syn region justRawString matchgroup=justQuote start="\v'''" end="\v'''"
|
||||
|
||||
syn region justSubshell matchgroup=justBacktick start="\v\`" skip="\v\\\`" end="\v\`" contains=@setshellsyntax
|
||||
syn region justSubshell matchgroup=justBacktick start="\v\`\`\`" skip="\v\\\`" end="\v\`\`\`" contains=@setshellsyntax
|
||||
syn region justRecipeBody start="\v^ *" end="$" keepend contains=@setshellsyntax
|
||||
syn region justRecipeNoechoBody start="\v^ *\@" end="$" keepend contains=justOperator,@setshellsyntax
|
||||
|
||||
hi def link justPublicName Identifier
|
||||
hi def link justPrivateName Identifier
|
||||
hi def link justKeyword Keyword
|
||||
hi def link justSetting Keyword
|
||||
hi def link justOperator Operator
|
||||
|
Loading…
Reference in New Issue
Block a user