aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/basic.vim482
-rw-r--r--runtime/syntax/checkhealth.vim4
-rw-r--r--runtime/syntax/git.vim93
-rw-r--r--runtime/syntax/gitcommit.vim86
-rw-r--r--runtime/syntax/gitrebase.vim15
-rw-r--r--runtime/syntax/i3config.vim7
-rw-r--r--runtime/syntax/qb64.vim409
-rw-r--r--runtime/syntax/rc.vim21
-rw-r--r--runtime/syntax/scala.vim110
-rw-r--r--runtime/syntax/strace.vim3
10 files changed, 949 insertions, 281 deletions
diff --git a/runtime/syntax/basic.vim b/runtime/syntax/basic.vim
index ad9450b3b8..7fe411a869 100644
--- a/runtime/syntax/basic.vim
+++ b/runtime/syntax/basic.vim
@@ -1,14 +1,15 @@
" Vim syntax file
-" Language: BASIC
+" Language: BASIC (QuickBASIC 4.5)
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Allan Kelly <allan@fruitloaf.co.uk>
" Contributors: Thilo Six
-" Last Change: 2015 Jan 10
+" Last Change: 2021 Aug 08
" First version based on Micro$soft QBASIC circa 1989, as documented in
" 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989.
-" This syntax file not a complete implementation yet. Send suggestions to the
-" maintainer.
+"
+" Second version attempts to match Microsoft QuickBASIC 4.5 while keeping FreeBASIC
+" (-lang qb) and QB64 (excluding extensions) in mind. -- DJK
" Prelude {{{1
if exists("b:current_syntax")
@@ -18,154 +19,357 @@ endif
let s:cpo_save = &cpo
set cpo&vim
+syn iskeyword @,48-57,.,!,#,%,&,$
+syn case ignore
+
+" Whitespace Errors {{{1
+if exists("basic_space_errors")
+ if !exists("basic_no_trail_space_error")
+ syn match basicSpaceError display excludenl "\s\+$"
+ endif
+ if !exists("basic_no_tab_space_error")
+ syn match basicSpaceError display " \+\t"me=e-1
+ endif
+endif
+
+" Comment Errors {{{1
+if !exists("basic_no_comment_errors")
+ syn match basicCommentError "\<REM\>.*"
+endif
+
+" Not Top Cluster {{{1
+syn cluster basicNotTop contains=@basicLineIdentifier,basicDataString,basicDataSeparator,basicTodo
+
+" Statements {{{1
+
+syn cluster basicStatements contains=basicStatement,basicDataStatement,basicMetaRemStatement,basicPutStatement,basicRemStatement
+
+let s:statements =<< trim EOL " {{{2
+ beep
+ bload
+ bsave
+ call
+ calls
+ case
+ chain
+ chdir
+ circle
+ clear
+ close
+ cls
+ color
+ com
+ common
+ const
+ declare
+ def
+ def\s\+seg
+ defdbl
+ defint
+ deflng
+ defsng
+ defstr
+ dim
+ do
+ draw
+ elseif
+ end
+ end\s\+\%(def\|function\|if\|select\|sub\|type\)
+ environ
+ erase
+ error
+ exit\s\+\%(def\|do\|for\|function\|sub\)
+ field
+ files
+ for
+ function
+ get
+ gosub
+ goto
+ if
+ input
+ ioctl
+ key
+ kill
+ let
+ line
+ line\s\+input
+ locate
+ lock
+ loop
+ lprint
+ lset
+ mkdir
+ name
+ next
+ on
+ on\s\+error
+ on\s\+uevent
+ open
+ open\s\+com
+ option
+ out
+ paint
+ palette
+ palette\s\+using
+ pcopy
+ pen
+ pmap
+ poke
+ preset
+ print
+ pset
+ randomize
+ read
+ redim
+ reset
+ restore
+ resume
+ return
+ rmdir
+ rset
+ run
+ select\s\+case
+ shared
+ shell
+ sleep
+ sound
+ static
+ stop
+ strig
+ sub
+ swap
+ system
+ troff
+ tron
+ type
+ uevent
+ unlock
+ using
+ view
+ view\s\+print
+ wait
+ wend
+ while
+ width
+ window
+ write
+EOL
+" }}}
+
+for s in s:statements
+ exe 'syn match basicStatement "\<' .. s .. '\>" contained'
+endfor
+
+syn match basicStatement "\<\%(then\|else\)\>" nextgroup=@basicStatements skipwhite
+
+" DATA Statement
+syn match basicDataSeparator "," contained
+syn region basicDataStatement matchgroup=basicStatement start="\<data\>" matchgroup=basicStatementSeparator end=":\|$" contained contains=basicDataSeparator,basicDataString,basicNumber,basicFloat,basicString
+
+if !exists("basic_no_data_fold")
+ syn region basicMultilineData start="^\s*\<data\>.*\n\%(^\s*\<data\>\)\@=" end="^\s*\<data\>.*\n\%(^\s*\<data\>\)\@!" contains=basicDataStatement transparent fold keepend
+endif
+
+" PUT File I/O and Graphics statements - needs special handling for graphics
+" action verbs
+syn match basicPutAction "\<\%(pset\|preset\|and\|or\|xor\)\>" contained
+syn region basicPutStatement matchgroup=basicStatement start="\<put\>" matchgroup=basicStatementSeparator end=":\|$" contained contains=basicKeyword,basicPutAction,basicFilenumber
+
" Keywords {{{1
-syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave
-syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute
-syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir
-syn keyword basicStatement CIRCLE circle Circle CLEAR clear Clear
-syn keyword basicStatement CLOSE close Close CLS cls Cls COLOR color Color
-syn keyword basicStatement COM com Com COMMON common Common
-syn keyword basicStatement CONST const Const DATA data Data
-syn keyword basicStatement DECLARE declare Declare DEF def Def
-syn keyword basicStatement DEFDBL defdbl Defdbl DEFINT defint Defint
-syn keyword basicStatement DEFLNG deflng Deflng DEFSNG defsng Defsng
-syn keyword basicStatement DEFSTR defstr Defstr DIM dim Dim
-syn keyword basicStatement DO do Do LOOP loop Loop
-syn keyword basicStatement DRAW draw Draw END end End
-syn keyword basicStatement ENVIRON environ Environ ERASE erase Erase
-syn keyword basicStatement ERROR error Error EXIT exit Exit
-syn keyword basicStatement FIELD field Field FILES files Files
-syn keyword basicStatement FOR for For NEXT next Next
-syn keyword basicStatement FUNCTION function Function GET get Get
-syn keyword basicStatement GOSUB gosub Gosub GOTO goto Goto
-syn keyword basicStatement IF if If THEN then Then ELSE else Else
-syn keyword basicStatement INPUT input Input INPUT# input# Input#
-syn keyword basicStatement IOCTL ioctl Ioctl KEY key Key
-syn keyword basicStatement KILL kill Kill LET let Let
-syn keyword basicStatement LINE line Line LOCATE locate Locate
-syn keyword basicStatement LOCK lock Lock UNLOCK unlock Unlock
-syn keyword basicStatement LPRINT lprint Lprint USING using Using
-syn keyword basicStatement LSET lset Lset MKDIR mkdir Mkdir
-syn keyword basicStatement NAME name Name ON on On
-syn keyword basicStatement ERROR error Error OPEN open Open
-syn keyword basicStatement OPTION option Option BASE base Base
-syn keyword basicStatement OUT out Out PAINT paint Paint
-syn keyword basicStatement PALETTE palette Palette PCOPY pcopy Pcopy
-syn keyword basicStatement PEN pen Pen PLAY play Play
-syn keyword basicStatement PMAP pmap Pmap POKE poke Poke
-syn keyword basicStatement PRESET preset Preset PRINT print Print
-syn keyword basicStatement PRINT# print# Print# USING using Using
-syn keyword basicStatement PSET pset Pset PUT put Put
-syn keyword basicStatement RANDOMIZE randomize Randomize READ read Read
-syn keyword basicStatement REDIM redim Redim RESET reset Reset
-syn keyword basicStatement RESTORE restore Restore RESUME resume Resume
-syn keyword basicStatement RETURN return Return RMDIR rmdir Rmdir
-syn keyword basicStatement RSET rset Rset RUN run Run
-syn keyword basicStatement SEEK seek Seek SELECT select Select
-syn keyword basicStatement CASE case Case SHARED shared Shared
-syn keyword basicStatement SHELL shell Shell SLEEP sleep Sleep
-syn keyword basicStatement SOUND sound Sound STATIC static Static
-syn keyword basicStatement STOP stop Stop STRIG strig Strig
-syn keyword basicStatement SUB sub Sub SWAP swap Swap
-syn keyword basicStatement SYSTEM system System TIMER timer Timer
-syn keyword basicStatement TROFF troff Troff TRON tron Tron
-syn keyword basicStatement TYPE type Type UNLOCK unlock Unlock
-syn keyword basicStatement VIEW view View WAIT wait Wait
-syn keyword basicStatement WHILE while While WEND wend Wend
-syn keyword basicStatement WIDTH width Width WINDOW window Window
-syn keyword basicStatement WRITE write Write DATE$ date$ Date$
-syn keyword basicStatement MID$ mid$ Mid$ TIME$ time$ Time$
-
-syn keyword basicFunction ABS abs Abs ASC asc Asc
-syn keyword basicFunction ATN atn Atn CDBL cdbl Cdbl
-syn keyword basicFunction CINT cint Cint CLNG clng Clng
-syn keyword basicFunction COS cos Cos CSNG csng Csng
-syn keyword basicFunction CSRLIN csrlin Csrlin CVD cvd Cvd
-syn keyword basicFunction CVDMBF cvdmbf Cvdmbf CVI cvi Cvi
-syn keyword basicFunction CVL cvl Cvl CVS cvs Cvs
-syn keyword basicFunction CVSMBF cvsmbf Cvsmbf EOF eof Eof
-syn keyword basicFunction ERDEV erdev Erdev ERL erl Erl
-syn keyword basicFunction ERR err Err EXP exp Exp
-syn keyword basicFunction FILEATTR fileattr Fileattr FIX fix Fix
-syn keyword basicFunction FRE fre Fre FREEFILE freefile Freefile
-syn keyword basicFunction INP inp Inp INSTR instr Instr
-syn keyword basicFunction INT int Int LBOUND lbound Lbound
-syn keyword basicFunction LEN len Len LOC loc Loc
-syn keyword basicFunction LOF lof Lof LOG log Log
-syn keyword basicFunction LPOS lpos Lpos PEEK peek Peek
-syn keyword basicFunction PEN pen Pen POINT point Point
-syn keyword basicFunction POS pos Pos RND rnd Rnd
-syn keyword basicFunction SADD sadd Sadd SCREEN screen Screen
-syn keyword basicFunction SEEK seek Seek SETMEM setmem Setmem
-syn keyword basicFunction SGN sgn Sgn SIN sin Sin
-syn keyword basicFunction SPC spc Spc SQR sqr Sqr
-syn keyword basicFunction STICK stick Stick STRIG strig Strig
-syn keyword basicFunction TAB tab Tab TAN tan Tan
-syn keyword basicFunction UBOUND ubound Ubound VAL val Val
-syn keyword basicFunction VALPTR valptr Valptr VALSEG valseg Valseg
-syn keyword basicFunction VARPTR varptr Varptr VARSEG varseg Varseg
-syn keyword basicFunction CHR$ Chr$ chr$ COMMAND$ command$ Command$
-syn keyword basicFunction DATE$ date$ Date$ ENVIRON$ environ$ Environ$
-syn keyword basicFunction ERDEV$ erdev$ Erdev$ HEX$ hex$ Hex$
-syn keyword basicFunction INKEY$ inkey$ Inkey$ INPUT$ input$ Input$
-syn keyword basicFunction IOCTL$ ioctl$ Ioctl$ LCASES$ lcases$ Lcases$
-syn keyword basicFunction LAFT$ laft$ Laft$ LTRIM$ ltrim$ Ltrim$
-syn keyword basicFunction MID$ mid$ Mid$ MKDMBF$ mkdmbf$ Mkdmbf$
-syn keyword basicFunction MKD$ mkd$ Mkd$ MKI$ mki$ Mki$
-syn keyword basicFunction MKL$ mkl$ Mkl$ MKSMBF$ mksmbf$ Mksmbf$
-syn keyword basicFunction MKS$ mks$ Mks$ OCT$ oct$ Oct$
-syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$
-syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$
-syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$
-syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$
+let s:keywords =<< trim EOL " {{{2
+ absolute
+ access
+ alias
+ append
+ as
+ base
+ binary
+ byval
+ cdecl
+ com
+ def
+ do
+ for
+ function
+ gosub
+ goto
+ input
+ int86old
+ int86xold
+ interrupt
+ interruptx
+ is
+ key
+ len
+ list
+ local
+ lock
+ lprint
+ next
+ off
+ on
+ output
+ pen
+ play
+ random
+ read
+ resume
+ screen
+ seg
+ shared
+ signal
+ static
+ step
+ stop
+ strig
+ sub
+ timer
+ to
+ until
+ using
+ while
+ write
+EOL
+" }}}
+
+for k in s:keywords
+ exe 'syn match basicKeyword "\<' .. k .. '\>"'
+endfor
+
+" Functions {{{1
+syn keyword basicFunction abs asc atn cdbl chr$ cint clng command$ cos csng
+syn keyword basicFunction csrlin cvd cvdmbf cvi cvl cvs cvsmbf environ$ eof
+syn keyword basicFunction erdev erdev$ erl err exp fileattr fix fre freefile
+syn keyword basicFunction hex$ inkey$ inp input$ instr int ioctl$ left$ lbound
+syn keyword basicFunction lcase$ len loc lof log lpos ltrim$ mkd$ mkdmbf$ mki$
+syn keyword basicFunction mkl$ mks$ mksmbf$ oct$ peek pen point pos right$ rnd
+syn keyword basicFunction rtrim$ sadd setmem sgn sin space$ spc sqr stick str$
+syn keyword basicFunction strig string$ tab tan ubound ucase$ val valptr
+syn keyword basicFunction valseg varptr varptr$ varseg
+
+" Functions and statements (same name) {{{1
+syn match basicStatement "\<\%(date\$\|mid\$\|play\|screen\|seek\|time\$\|timer\)\>" contained
+syn match basicFunction "\<\%(date\$\|mid\$\|play\|screen\|seek\|time\$\|timer\)\>"
+
+" Types {{{1
+syn keyword basicType integer long single double string any
+
+" Strings {{{1
+
+" Unquoted DATA strings - anything except [:,] and leading or trailing whitespace
+" Needs lower priority than numbers
+syn match basicDataString "[^[:space:],:]\+\%(\s\+[^[:space:],:]\+\)*" contained
+
+syn region basicString start=+"+ end=+"+ oneline
+
+" Booleans {{{1
+if exists("basic_booleans")
+ syn keyword basicBoolean true false
+endif
" Numbers {{{1
-" Integer number, or floating point number without a dot.
-syn match basicNumber "\<\d\+\>"
-" Floating point number, with dot
-syn match basicNumber "\<\d\+\.\d*\>"
-" Floating point number, starting with a dot
-syn match basicNumber "\.\d\+\>"
-" String and Character constants {{{1
-syn match basicSpecial "\\\d\d\d\|\\." contained
-syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial
+" Integers
+syn match basicNumber "-\=&o\=\o\+[%&]\=\>"
+syn match basicNumber "-\=&h\x\+[%&]\=\>"
+syn match basicNumber "-\=\<\d\+[%&]\=\>"
+
+" Floats
+syn match basicFloat "-\=\<\d\+\.\=\d*\%(\%([ed][+-]\=\d*\)\|[!#]\)\=\>"
+syn match basicFloat "-\=\<\.\d\+\%(\%([ed][+-]\=\d*\)\|[!#]\)\=\>"
-" Line numbers {{{1
-syn region basicLineNumber start="^\d" end="\s"
+" Statement anchors {{{1
+syn match basicLineStart "^" nextgroup=@basicStatements,@basicLineIdentifier skipwhite
+syn match basicStatementSeparator ":" nextgroup=@basicStatements skipwhite
-" Data-type suffixes {{{1
-syn match basicTypeSpecifier "[a-zA-Z0-9][$%&!#]"ms=s+1
-" Used with OPEN statement
-syn match basicFilenumber "#\d\+"
+" Line numbers and labels {{{1
+
+" QuickBASIC limits these to 65,529 and 40 chars respectively
+syn match basicLineNumber "\d\+" nextgroup=@basicStatements skipwhite contained
+syn match basicLineLabel "\a[[:alnum:]]*\ze\s*:" nextgroup=@basicStatements skipwhite contained
+
+syn cluster basicLineIdentifier contains=basicLineNumber,basicLineLabel
+
+" Line Continuation {{{1
+syn match basicLineContinuation "\s*\zs_\ze\s*$"
+
+" Type suffixes {{{1
+if exists("basic_type_suffixes")
+ syn match basicTypeSuffix "\a[[:alnum:].]*\zs[$%&!#]"
+endif
-" Mathematical operators {{{1
-" syn match basicMathsOperator "[<>+\*^/\\=-]"
-syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
+" File numbers {{{1
+syn match basicFilenumber "#\d\+"
+syn match basicFilenumber "#\a[[:alnum:].]*[%&!#]\="
+
+" Operators {{{1
+if exists("basic_operators")
+ syn match basicArithmeticOperator "[-+*/\\^]"
+ syn match basicRelationalOperator "<>\|<=\|>=\|[><=]"
+endif
+syn match basicLogicalOperator "\<\%(not\|and\|or\|xor\|eqv\|imp\)\>"
+syn match basicArithmeticOperator "\<mod\>"
+
+" Metacommands {{{1
+" Note: No trailing word boundaries. Text may be freely mixed however there
+" must be only leading whitespace prior to the first metacommand
+syn match basicMetacommand "$INCLUDE\s*:\s*'[^']\+'" contained containedin=@basicMetaComments
+syn match basicMetacommand "$\%(DYNAMIC\|STATIC\)" contained containedin=@basicMetaComments
" Comments {{{1
-syn keyword basicTodo TODO FIXME XXX NOTE contained
-syn region basicComment start="^\s*\zsREM\>" start="\%(:\s*\)\@<=REM\>" end="$" contains=basicTodo
-syn region basicComment start="'" end="$" contains=basicTodo
+syn keyword basicTodo TODO FIXME XXX NOTE contained
+
+syn region basicRemStatement matchgroup=basicStatement start="REM\>" end="$" contains=basicTodo,@Spell contained
+syn region basicComment start="'" end="$" contains=basicTodo,@Spell
+
+if !exists("basic_no_comment_fold")
+ syn region basicMultilineComment start="^\s*'.*\n\%(\s*'\)\@=" end="^\s*'.*\n\%(\s*'\)\@!" contains=@basicComments transparent fold keepend
+endif
+
+" Metacommands
+syn region basicMetaRemStatement matchgroup=basicStatement start="REM\>\s*\$\@=" end="$" contains=basicTodo contained
+syn region basicMetaComment start="'\s*\$\@=" end="$" contains=basicTodo
+
+syn cluster basicMetaComments contains=basicMetaComment,basicMetaRemStatement
+syn cluster basicComments contains=basicComment,basicMetaComment
"syn sync ccomment basicComment
" Default Highlighting {{{1
-hi def link basicLabel Label
-hi def link basicConditional Conditional
-hi def link basicRepeat Repeat
-hi def link basicLineNumber Comment
-hi def link basicNumber Number
-hi def link basicError Error
-hi def link basicStatement Statement
-hi def link basicString String
-hi def link basicComment Comment
-hi def link basicSpecial Special
-hi def link basicTodo Todo
-hi def link basicFunction Identifier
-hi def link basicTypeSpecifier Type
-hi def link basicFilenumber basicTypeSpecifier
-"hi basicMathsOperator term=bold cterm=bold gui=bold
+hi def link basicArithmeticOperator basicOperator
+hi def link basicBoolean Boolean
+hi def link basicComment Comment
+hi def link basicCommentError Error
+hi def link basicDataString basicString
+hi def link basicFilenumber basicTypeSuffix " TODO: better group
+hi def link basicFloat Float
+hi def link basicFunction Identifier
+hi def link basicKeyword Keyword
+hi def link basicLineIdentifier LineNr
+hi def link basicLineContinuation Special
+hi def link basicLineLabel basicLineIdentifier
+hi def link basicLineNumber basicLineIdentifier
+hi def link basicLogicalOperator basicOperator
+hi def link basicMetacommand SpecialComment
+hi def link basicMetaComment Comment
+hi def link basicMetaRemStatement Comment
+hi def link basicNumber Number
+hi def link basicOperator Operator
+hi def link basicPutAction Keyword
+hi def link basicRelationalOperator basicOperator
+hi def link basicRemStatement Comment
+hi def link basicSpaceError Error
+hi def link basicStatementSeparator Special
+hi def link basicStatement Statement
+hi def link basicString String
+hi def link basicTodo Todo
+hi def link basicType Type
+hi def link basicTypeSuffix Special
+if exists("basic_legacy_syntax_groups")
+ hi def link basicTypeSpecifier Type
+ hi def link basicTypeSuffix basicTypeSpecifier
+endif
" Postscript {{{1
let b:current_syntax = "basic"
diff --git a/runtime/syntax/checkhealth.vim b/runtime/syntax/checkhealth.vim
index dff880a0bc..37f1822740 100644
--- a/runtime/syntax/checkhealth.vim
+++ b/runtime/syntax/checkhealth.vim
@@ -12,7 +12,9 @@ unlet! b:current_syntax
syn case match
" We do not care about markdown syntax errors
-syn clear markdownError
+if hlexists('markdownError')
+ syn clear markdownError
+endif
syn keyword healthError ERROR[:] containedin=markdownCodeBlock,mkdListItemLine
syn keyword healthWarning WARNING[:] containedin=markdownCodeBlock,mkdListItemLine
diff --git a/runtime/syntax/git.vim b/runtime/syntax/git.vim
index a8467edd43..bf013ce195 100644
--- a/runtime/syntax/git.vim
+++ b/runtime/syntax/git.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: generic git output
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2019 Dec 05
+" Last Change: 2022 Jan 05
if exists("b:current_syntax")
finish
@@ -12,12 +12,28 @@ syn sync minlines=50
syn include @gitDiff syntax/diff.vim
-syn region gitHead start=/\%^/ end=/^$/
-syn region gitHead start=/\%(^commit\%( \x\{40\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
-
-" For git reflog and git show ...^{tree}, avoid sync issues
-syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/
-syn match gitHead /^\x\{40\} \x\{40}\t.*/
+syn region gitHead start=/\%^\%(tag \|tree \|object \)\@=/ end=/^$/ contains=@NoSpell
+syn region gitHead start=/\%(^commit\%( \x\{4,\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/ contains=@NoSpell
+" git log --oneline
+" minimize false positives by verifying contents of buffer
+if getline(1) =~# '^\x\{7,\} ' && getline('$') =~# '^\x\{7,\} '
+ syn match gitHashAbbrev /^\x\{7,\} \@=/ contains=@NoSpell
+elseif getline(1) =~# '^[|\/\\_ ]\{-\}\*[|\/\\_ ]\{-\} \x\{7,\} '
+ syn match gitHashAbbrev /^[|\/\\_ ]\{-\}\*[|\/\\_ ]\{-\} \zs\x\{7,\} \@=/ contains=@NoSpell
+endif
+" git log --graph
+syn region gitGraph start=/\%(^[|\/\\_ ]*\*[|\/\\_ ]\{-\} commit\%( \x\{4,\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^\%([|\/\\_ ]*$\)\@=/ contains=@NoSpell
+" git blame --porcelain
+syn region gitHead start=/\%(^\x\{40,\} \d\+ \d\+\%( \d\+\)\=$\)\@=/ end=/^\t\@=/ contains=@NoSpell
+" git ls-tree
+syn match gitMode /^\d\{6\}\%( \%(blob\|tree\) \x\{4,\}\t\)\@=/ nextgroup=gitType skipwhite contains=@NoSpell
+" git ls-files --stage
+syn match gitMode /^\d\{6\}\%( \x\{4,\} [0-3]\t\)\@=/ nextgroup=gitHashStage skipwhite contains=@NoSpell
+" .git/HEAD, .git/refs/
+syn match gitKeyword /\%^ref: \@=/ nextgroup=gitReference skipwhite contains=@NoSpell
+syn match gitHash /\%^\x\{40,}\%$/ skipwhite contains=@NoSpell
+" .git/logs/
+syn match gitReflog /^\x\{40,\} \x\{40,\} .\{-\}\d\+\s-\d\{4\}\t.*/ skipwhite contains=@NoSpell,gitReflogOld
syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff
@@ -25,35 +41,47 @@ syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\)
syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
-syn match gitDiffAdded "{+.*+}" contained containedin=gitDiff
+syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff
syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
-syn match gitDiffRemoved "\[-.*-\]" contained containedin=gitDiff
+syn match gitDiffRemoved "\[-[^]]*-\]" contained containedin=gitDiff
+
+syn match gitKeyword /^commit \@=/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitKeyword /^\%(object\|tree\|parent\|encoding\|gpgsig\%(-\w\+\)\=\|previous\) \@=/ contained containedin=gitHead nextgroup=gitHash skipwhite contains=@NoSpell
+syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitIdentityKeyword /^\%(author\|committer\|tagger\) \@=/ contained containedin=gitHead nextgroup=gitIdentity skipwhite contains=@NoSpell
+syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite contains=@NoSpell
+syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite contains=@NoSpell
-syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
-syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
-syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite
-syn match gitMode /^\d\{6\}\>/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
-syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
-syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
-syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite
+syn match gitKeyword /^[*|\/\\_ ]\+\zscommit \@=/ contained containedin=gitGraph nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitKeyword /^[|\/\\_ ]\+\zs\%(object\|tree\|parent\|encoding\|gpgsig\%(-\w\+\)\=\|previous\) \@=/ contained containedin=gitGraph nextgroup=gitHash skipwhite contains=@NoSpell
+syn match gitKeyword /^[|\/\\_ ]\+\zsMerge:/ contained containedin=gitGraph nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitIdentityKeyword /^[|\/\\_ ]\+\zs\%(author\|committer\|tagger\) \@=/ contained containedin=gitGraph nextgroup=gitIdentity skipwhite contains=@NoSpell
+syn match gitIdentityHeader /^[|\/\\_ ]\+\zs\%(Author\|Commit\|Tagger\):/ contained containedin=gitGraph nextgroup=gitIdentity skipwhite contains=@NoSpell
+syn match gitDateHeader /^[|\/\\_ ]\+\zs\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitGraph nextgroup=gitDate skipwhite contains=@NoSpell
-syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite
-syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite
-syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity
+syn match gitKeyword /^type \@=/ contained containedin=gitHead nextgroup=gitType skipwhite contains=@NoSpell
+syn match gitKeyword /^\%(summary\|boundary\|filename\|\%(author\|committer\)-\%(time\|tz\)\) \@=/ contained containedin=gitHead skipwhite contains=@NoSpell
+syn match gitKeyword /^tag \@=/ contained containedin=gitHead nextgroup=gitReference skipwhite contains=@NoSpell
+syn match gitIdentityKeyword /^\%(author\|committer\)-mail \@=/ contained containedin=gitHead nextgroup=gitEmail skipwhite contains=@NoSpell
+syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite contains=@NoSpell
+syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite contains=@NoSpell
+syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity contains=@NoSpell
-syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained
-syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained
-syn match gitDate /\<\d\+ \l\+ ago\>/ contained
-syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHash skipwhite
-syn match gitStage /\<\d\t\@=/ contained
-syn match gitReference /\S\+\S\@!/ contained
-syn match gitHash /\<\x\{40\}\>/ contained nextgroup=gitIdentity,gitStage,gitHash skipwhite
-syn match gitHash /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite
-syn match gitHashAbbrev /\<\x\{4,40\}\>/ contained nextgroup=gitHashAbbrev skipwhite
-syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite
+syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite contains=@NoSpell
+syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity contains=@NoSpell
+syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained contains=@NoSpell
+syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained contains=@NoSpell
+syn match gitDate /\<\d\+ \l\+ ago\>/ contained contains=@NoSpell
+syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitReference /\S\+\S\@!/ contained contains=@NoSpell
+syn match gitHash /\<\x\{40,\}\>/ contained nextgroup=gitIdentity,gitHash skipwhite contains=@NoSpell
+syn match gitReflogOld /^\x\{40,\} \@=/ contained nextgroup=gitReflogNew skipwhite contains=@NoSpell
+syn match gitReflogNew /\<\x\{40,\} \@=/ contained nextgroup=gitIdentity skipwhite contains=@NoSpell
+syn match gitHashAbbrev /\<\x\{4,\}\>/ contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
+syn match gitHashStage /\<\x\{4,\}\>/ contained nextgroup=gitStage skipwhite contains=@NoSpell
+syn match gitStage /\<\d\t\@=/ contained contains=@NoSpell
-syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite
-syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity
syn match gitNotesHeader /^Notes:\ze\n /
@@ -68,7 +96,10 @@ hi def link gitEmailDelimiter Delimiter
hi def link gitEmail Special
hi def link gitDate Number
hi def link gitMode Number
+hi def link gitHashStage gitHash
hi def link gitHashAbbrev gitHash
+hi def link gitReflogOld gitHash
+hi def link gitReflogNew gitHash
hi def link gitHash Identifier
hi def link gitReflogMiddle gitReference
hi def link gitReference Function
diff --git a/runtime/syntax/gitcommit.vim b/runtime/syntax/gitcommit.vim
index 63b1ce920f..42c8d4414f 100644
--- a/runtime/syntax/gitcommit.vim
+++ b/runtime/syntax/gitcommit.vim
@@ -2,71 +2,87 @@
" Language: git commit file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: *.git/COMMIT_EDITMSG
-" Last Change: 2019 Dec 05
+" Last Change: 2022 Jan 05
if exists("b:current_syntax")
finish
endif
+scriptencoding utf-8
+
syn case match
syn sync minlines=50
+syn sync linebreaks=1
if has("spell")
syn spell toplevel
endif
syn include @gitcommitDiff syntax/diff.vim
-syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff
+syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@gitcommitDiff
syn match gitcommitSummary "^.*\%<51v." contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
syn match gitcommitOverflow ".*" contained contains=@Spell
-syn match gitcommitBlank "^[^#].*" contained contains=@Spell
+syn match gitcommitBlank "^.\+" contained contains=@Spell
+syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank,gitcommitComment skipnl
+
+let s:scissors = 0
+let s:l = search('^[#;@!$%^&|:] -\{24,\} >8 -\{24,\}$', 'cnW', '', 100)
+if s:l == 0
+ let s:l = line('$')
+elseif getline(s:l)[0] !=# getline(s:l - 1)[0]
+ let s:scissors = 1
+endif
+let s:comment = escape((matchstr(getline(s:l), '^[#;@!$%^&|:]\S\@!') . '#')[0], '^$.*[]~\"/')
-if get(g:, "gitcommit_cleanup") is# "scissors"
- syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank skipnl
- syn region gitcommitComment start=/^# -\+ >8 -\+$/ end=/\%$/ contains=gitcommitDiff
+if s:scissors
+ let s:comment .= ' -\{24,\} >8 -\{24,\}$'
+ exe 'syn region gitcommitComment start="^' . s:comment . '" end="\%$" contains=gitcommitDiff'
else
- syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl
- syn match gitcommitComment "^#.*"
+ exe 'syn match gitcommitComment "^' . s:comment . '.*"'
endif
+exe 'syn match gitcommitTrailers "\n\@<=\n\%([[:alnum:]-]\+\s*:.*\|(cherry picked from commit .*\)\%(\n\s.*\|\n[[:alnum:]-]\+\s*:.*\|\n(cherry picked from commit .*\)*\%(\n\n*\%(' . s:comment . '\)\|\n*\%$\)\@="'
-syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
-syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
-syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
+unlet s:l s:comment s:scissors
+
+syn match gitcommitTrailerToken "^[[:alnum:]-]\+\s*:" contained containedin=gitcommitTrailers
+
+syn match gitcommitHash "\<\x\{40,}\>" contains=@NoSpell display
+syn match gitcommitOnBranch "\%(^. \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
+syn match gitcommitOnBranch "\%(^. \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
syn match gitcommitBranch "[^ ']\+" contained
-syn match gitcommitNoBranch "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment
-syn match gitcommitHeader "\%(^# \)\@<=.*:$" contained containedin=gitcommitComment
-syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^# \)\@<=\%(Author\|Committer\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent
-syn match gitcommitNoChanges "\%(^# \)\@<=No changes$" contained containedin=gitcommitComment
+syn match gitcommitNoBranch "\%(^. \)\@<=Not currently on any branch." contained containedin=gitcommitComment
+syn match gitcommitHeader "\%(^. \)\@<=\S.*[::]\%(\n^$\)\@!$" contained containedin=gitcommitComment
+syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^. \)\@<=\%(Author\|Committer\|Date\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent
+syn match gitcommitHeader "\%(^. \)\@<=commit\%( \x\{40,\}$\)\@=" contained containedin=gitcommitComment nextgroup=gitcommitHash skipwhite
+syn match gitcommitNoChanges "\%(^. \)\@<=No changes$" contained containedin=gitcommitComment
-syn region gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold
-syn match gitcommitUntrackedFile "\t\@<=.*" contained
+syn match gitcommitType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained containedin=gitcommitComment nextgroup=gitcommitFile skipwhite
+syn match gitcommitFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitArrow
+syn match gitcommitArrow " -> " contained nextgroup=gitcommitFile
+syn match gitcommitUntrackedFile "\%(^.\t\)\@<=[^::/]*\%(/.*\)\=$" contained containedin=gitcommitComment
-syn region gitcommitDiscarded start=/^# Change\%(s not staged for commit\|d but not updated\):/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold
-syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold
-syn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold
+syn region gitcommitUntracked start=/^\z(.\) Untracked files:$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader containedin=gitcommitComment containedin=gitcommitComment contained transparent fold
+syn region gitcommitDiscarded start=/^\z(.\) Change\%(s not staged for commit\|d but not updated\):$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader,gitcommitDiscardedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold
+syn region gitcommitSelected start=/^\z(.\) Changes to be committed:$/ end=/^\z1$\|^\z1\@!/ contains=gitcommitHeader,gitcommitSelectedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold
+syn region gitcommitUnmerged start=/^\z(.\) Unmerged paths:$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader,gitcommitUnmergedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold
+syn match gitcommitUntrackedFile "\%(^.\t\)\@<=.*" contained containedin=gitcommitUntracked
-syn match gitcommitDiscardedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite
-syn match gitcommitSelectedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite
-syn match gitcommitUnmergedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite
-syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow
-syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
-syn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
+syn match gitcommitDiscardedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained nextgroup=gitcommitDiscardedFile skipwhite
+syn match gitcommitSelectedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained nextgroup=gitcommitSelectedFile skipwhite
+syn match gitcommitUnmergedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained nextgroup=gitcommitUnmergedFile skipwhite
+syn match gitcommitDiscardedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow
+syn match gitcommitSelectedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
+syn match gitcommitUnmergedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitUnmergedArrow
syn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile
syn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile
-syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitSelectedFile
-
-syn match gitcommitWarning "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl
-syn match gitcommitWarning "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained
-syn match gitcommitWarning "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$"
+syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitUnmergedFile
hi def link gitcommitSummary Keyword
+hi def link gitcommitTrailerToken Label
hi def link gitcommitComment Comment
-hi def link gitcommitUntracked gitcommitComment
-hi def link gitcommitDiscarded gitcommitComment
-hi def link gitcommitSelected gitcommitComment
-hi def link gitcommitUnmerged gitcommitComment
+hi def link gitcommitHash Identifier
hi def link gitcommitOnBranch Comment
hi def link gitcommitBranch Special
hi def link gitcommitNoBranch gitCommitBranch
diff --git a/runtime/syntax/gitrebase.vim b/runtime/syntax/gitrebase.vim
index bc6f34d1a7..13f157b005 100644
--- a/runtime/syntax/gitrebase.vim
+++ b/runtime/syntax/gitrebase.vim
@@ -2,7 +2,7 @@
" Language: git rebase --interactive
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: git-rebase-todo
-" Last Change: 2019 Dec 06
+" Last Change: 2022 Jan 05
if exists("b:current_syntax")
finish
@@ -10,8 +10,10 @@ endif
syn case match
-syn match gitrebaseHash "\v<\x{7,}>" contained
-syn match gitrebaseCommit "\v<\x{7,}>" nextgroup=gitrebaseSummary skipwhite
+let s:c = escape((matchstr(getline('$'), '^[#;@!$%^&|:]\S\@!') . '#')[0], '^$.*[]~\"/')
+
+syn match gitrebaseHash "\v<\x{7,}>" contained contains=@NoSpell
+syn match gitrebaseCommit "\v<\x{7,}>" nextgroup=gitrebaseSummary skipwhite contains=@NoSpell
syn match gitrebasePick "\v^p%(ick)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite
@@ -26,12 +28,15 @@ syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite
syn match gitrebaseReset "\v^(t|reset)=>" nextgroup=gitrebaseName skipwhite
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
syn match gitrebaseCommand ".*" contained
-syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
+exe 'syn match gitrebaseComment " \@<=' . s:c . ' empty$" containedin=gitrebaseSummary contained'
+exe 'syn match gitrebaseComment "^\s*' . s:c . '.*" contains=gitrebaseHash'
syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseMergeOption "\v-[Cc]>" nextgroup=gitrebaseMergeCommit skipwhite contained
syn match gitrebaseMergeCommit "\v<\x{7,}>" nextgroup=gitrebaseName skipwhite contained
syn match gitrebaseName "\v[^[:space:].*?i:^~/-]\S+" nextgroup=gitrebaseMergeComment skipwhite contained
-syn match gitrebaseMergeComment "#" nextgroup=gitrebaseSummary skipwhite contained
+exe 'syn match gitrebaseMergeComment "' . s:c . '" nextgroup=gitrebaseSummary skipwhite contained'
+
+unlet s:c
hi def link gitrebaseCommit gitrebaseHash
hi def link gitrebaseHash Identifier
diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim
index a8b6637140..a2f50e50b8 100644
--- a/runtime/syntax/i3config.vim
+++ b/runtime/syntax/i3config.vim
@@ -1,8 +1,9 @@
" Vim syntax file
" Language: i3 config file
-" Maintainer: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
+" Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
+" Maintainer: Quentin Hibon (github user hiqua)
" Version: 0.4
-" Last Change: 2021 Dec 14
+" Last Change: 2022 Jan 15
" References:
" http://i3wm.org/docs/userguide.html#configuring
@@ -174,7 +175,7 @@ syn keyword i3ConfigDrawingMarksKeyword show_marks contained
syn match i3ConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDrawingMarksKeyword
" Group mode/bar
-syn keyword i3ConfigBlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
+syn keyword i3ConfigBlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_min_width workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
syn region i3ConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
" Line continuation
diff --git a/runtime/syntax/qb64.vim b/runtime/syntax/qb64.vim
new file mode 100644
index 0000000000..a777e14481
--- /dev/null
+++ b/runtime/syntax/qb64.vim
@@ -0,0 +1,409 @@
+" Vim syntax file
+" Language: QB64
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2022 Jan 21
+
+" Prelude {{{1
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" syn iskeyword set after sourcing of basic.vim
+
+syn case ignore
+
+let s:prefix = search('\c^\s*$NOPREFIX\>', 'n') ? '_\=' : '_'
+
+" Statements {{{1
+
+let s:statements =<< trim EOL " {{{2
+ acceptfiledrop
+ allowfullscreen
+ assert
+ console
+ consolecursor
+ consolefont
+ consoletitle
+ continue
+ copypalette
+ define
+ delay
+ depthbuffer
+ displayorder
+ dontblend
+ echo
+ exit\s\+\%(select\|case\)
+ finishdrop
+ freefont
+ freeimage
+ icon
+ keyclear
+ limit
+ maptriangle
+ memcopy
+ memfill
+ memfree
+ memput
+ mousehide
+ mousemove
+ mouseshow
+ printimage
+ printstring
+ putimage
+ screenclick
+ screenhide
+ screenmove
+ screenprint
+ screenshow
+ setalpha
+ sndbal
+ sndclose
+ sndlimit
+ sndloop
+ sndpause
+ sndplay
+ sndplaycopy
+ sndplayfile
+ sndraw
+ sndrawdone
+ sndsetpos
+ sndstop
+ sndvol
+ title
+EOL
+" }}}
+
+for s in s:statements
+ exe 'syn match qb64Statement "\<' .. s:prefix .. s .. '\>" contained contains=qb64Underscore'
+endfor
+
+" Functions {{{1
+
+let s:functions =<< trim EOL " {{{2
+ acos
+ acosh
+ alpha
+ alpha32
+ arccot
+ arccsc
+ arcsec
+ asin
+ asinh
+ atan2
+ atanh
+ axis
+ backgroundcolor
+ blue
+ blue32
+ button
+ buttonchange
+ ceil
+ cinp
+ commandcount
+ connected
+ connectionaddress
+ connectionaddress$
+ consoleinput
+ copyimage
+ cot
+ coth
+ cosh
+ csc
+ csch
+ cv
+ cwd$
+ d2g
+ d2r
+ defaultcolor
+ deflate$
+ desktopheight
+ desktopwidth
+ device$
+ deviceinput
+ devices
+ dir$
+ direxists
+ droppedfile
+ droppedfile$
+ errorline
+ errormessage$
+ exit
+ fileexists
+ fontheight
+ fontwidth
+ freetimer
+ g2d
+ g2r
+ green
+ green32
+ height
+ hypot
+ inclerrorfile$
+ inclerrorline
+ inflate$
+ instrrev
+ keyhit
+ keydown
+ lastaxis
+ lastbutton
+ lastwheel
+ loadfont
+ loadimage
+ mem
+ memelement
+ memexists
+ memimage
+ memnew
+ memsound
+ mk$
+ mousebutton
+ mouseinput
+ mousemovementx
+ mousemovementy
+ mousepipeopen
+ mousewheel
+ mousex
+ mousey
+ newimage
+ offset
+ openclient
+ os$
+ pi
+ pixelsize
+ printwidth
+ r2d
+ r2g
+ red
+ red32
+ readbit
+ resetbit
+ resizeheight
+ resizewidth
+ rgb
+ rgb32
+ rgba
+ rgba32
+ round
+ sec
+ sech
+ screenexists
+ screenimage
+ screenx
+ screeny
+ setbit
+ shellhide
+ shl
+ shr
+ sinh
+ sndcopy
+ sndgetpos
+ sndlen
+ sndopen
+ sndopenraw
+ sndpaused
+ sndplaying
+ sndrate
+ sndrawlen
+ startdir$
+ strcmp
+ stricmp
+ tanh
+ title$
+ togglebit
+ totaldroppedfiles
+ trim$
+ wheel
+ width
+ windowhandle
+ windowhasfocus
+EOL
+" }}}
+
+for f in s:functions
+ exe 'syn match qb64Function "\<' .. s:prefix .. f .. '\>" contains=qb64Underscore'
+endfor
+
+" Functions and statements (same name) {{{1
+
+let s:common =<< trim EOL " {{{2
+ autodisplay
+ blend
+ blink
+ capslock
+ clearcolor
+ clipboard$
+ clipboardimage
+ controlchr
+ dest
+ display
+ font
+ fullscreen
+ mapunicode
+ memget
+ numlock
+ palettecolor
+ printmode
+ resize
+ screenicon
+ scrolllock
+ source
+EOL
+" }}}
+
+for c in s:common
+ exe 'syn match qb64Statement "\<' .. s:prefix .. c .. '\>" contains=qb64Underscore contained'
+ exe 'syn match qb64Function "\<' .. s:prefix .. c .. '\>" contains=qb64Underscore'
+endfor
+
+" Keywords {{{1
+
+" Non-prefixed keywords {{{2
+" TIMER FREE
+" _DEPTH_BUFFER LOCK
+syn keyword qb64Keyword free lock
+
+let s:keywords =<< trim EOL " {{{2
+ all
+ anticlockwise
+ behind
+ clear
+ clip
+ console
+ dontwait
+ explicit
+ explicitarray
+ fillbackground
+ hardware
+ hardware1
+ hide
+ keepbackground
+ middle
+ none
+ off
+ only
+ onlybackground
+ ontop
+ openconnection
+ openhost
+ preserve
+ seamless
+ smooth
+ smoothshrunk
+ smoothstretched
+ software
+ squarepixels
+ stretch
+ toggle
+EOL
+" }}}
+
+for k in s:keywords
+ exe 'syn match qb64Keyword "\<' .. s:prefix .. k .. '\>" contains=qb64Underscore'
+endfor
+
+syn match qb64Underscore "\<_" contained conceal transparent
+
+" Source QuickBASIC syntax {{{1
+runtime! syntax/basic.vim
+
+" add after the BASIC syntax file is sourced so cluster already exists
+syn cluster basicStatements add=qb64Statement,qb64Metacommand,qb64IfMetacommand
+syn cluster basicLineIdentifier add=qb64LineLabel
+syn cluster qb64NotTop contains=@basicNotTop,qb64Metavariable
+
+syn iskeyword @,48-57,.,_,!,#,$,%,&,`
+
+" Unsupported QuickBASIC features {{{1
+" TODO: add linux only missing features
+syn keyword qb64Unsupported alias any byval calls cdecl erdev erdev$ fileattr
+syn keyword qb64Unsupported fre ioctl ioctl$ pen play setmem signal uevent
+syn keyword qb64Unsupported tron troff
+syn match qb64Unsupported "\<declare\%(\s\+\%(sub\|function\)\>\)\@="
+syn match qb64Unsupported "\<\%(date\|time\)$\ze\s*=" " statements only
+syn match qb64Unsupported "\<def\zs\s\+FN"
+syn match qb64Unsupported "\<\%(exit\|end\)\s\+def\>"
+syn match qb64Unsupported "\<width\s\+lprint\>"
+
+" Types {{{1
+syn keyword qb64Type _BIT _BYTE _FLOAT _INTEGER64 _MEM _OFFSET _UNSIGNED
+
+" Type suffixes {{{1
+if exists("basic_type_suffixes")
+ " TODO: handle leading word boundary and __+ prefix
+ syn match qb64TypeSuffix "\%(\a[[:alnum:]._]*\)\@<=\~\=`\%(\d\+\)\="
+ syn match qb64TypeSuffix "\%(\a[[:alnum:]._]*\)\@<=\~\=\%(%\|%%\|&\|&&\|%&\)"
+ syn match qb64TypeSuffix "\%(\a[[:alnum:]._]*\)\@<=\%(!\|##\|#\)"
+ syn match qb64TypeSuffix "\%(\a[[:alnum:]._]*\)\@<=$\%(\d\+\)\="
+endif
+
+" Numbers {{{1
+
+" Integers
+syn match qb64Number "-\=&b[01]\+&\>\="
+
+syn match qb64Number "-\=\<[01]\~\=`\>"
+syn match qb64Number "-\=\<\d\+`\d\+\>"
+
+syn match qb64Number "-\=\<\d\+\%(%%\|&&\|%&\)\>"
+syn match qb64Number "\<\d\+\~\%(%%\|&&\|%&\)\>"
+
+syn match qb64Number "-\=\<&b[01]\+\%(%%\|&&\|%&\)\>"
+syn match qb64Number "\<&b[01]\+\~\%(%%\|&&\|%&\)\>"
+
+syn match qb64Number "-\=\<&o\=\o\+\%(%%\|&&\|%&\)\>"
+syn match qb64Number "\<&o\=\o\+\~\%(%%\|&&\|%&\)\>"
+
+syn match qb64Number "-\=\<&h\x\+\%(%%\|&&\|%&\)\>"
+syn match qb64Number "\<&h\x\+\~\%(%%\|&&\|%&\)\>"
+
+" Floats
+syn match qb64Float "-\=\<\d\+\.\=\d*##\>"
+syn match qb64Float "-\=\<\.\d\+##\>"
+
+" Line numbers and labels {{{1
+syn match qb64LineLabel "\%(_\{2,}\)\=\a[[:alnum:]._]*[[:alnum:]]\ze\s*:" nextgroup=@basicStatements skipwhite contained
+
+" Metacommands {{{1
+syn match qb64Metacommand contained "$NOPREFIX\>"
+syn match qb64Metacommand contained "$ASSERTS\%(:CONSOLE\)\=\>"
+syn match qb64Metacommand contained "$CHECKING:\%(ON\|OFF\)\>"
+syn match qb64Metacommand contained "$COLOR:\%(0\|32\)\>"
+syn match qb64Metacommand contained "$CONSOLE\%(:ONLY\)\=\>"
+syn match qb64Metacommand contained "$EXEICON\s*:\s*'[^']\+'"
+syn match qb64Metacommand contained "$ERROR\>"
+syn match qb64Metacommand contained "$LET\>"
+syn match qb64Metacommand contained "$RESIZE:\%(ON\|OFF\|STRETCH\|SMOOTH\)\>"
+syn match qb64Metacommand contained "$SCREEN\%(HIDE\|SHOW\)\>"
+syn match qb64Metacommand contained "$VERSIONINFO\s*:.*"
+syn match qb64Metacommand contained "$VIRTUALKEYBOARD:\%(ON\|OFF\)\>"
+
+syn region qb64IfMetacommand contained matchgroup=qb64Metacommand start="$\%(IF\|ELSEIF\)\>" end="\<THEN\>" oneline transparent contains=qb64Metavariable
+syn match qb64Metacommand contained "$\%(ELSE\|END\s*IF\)\>"
+
+syn keyword qb64Metavariable contained defined undefined
+syn keyword qb64Metavariable contained windows win linux mac maxosx
+syn keyword qb64Metavariable contained 32bit 64bit version
+
+" Default Highlighting {{{1
+hi def link qb64Float basicFloat
+hi def link qb64Function Function
+hi def link qb64Keyword Keyword
+hi def link qb64LineLabel basicLineLabel
+hi def link qb64Metacommand PreProc
+hi def link qb64Metavariable Identifier
+hi def link qb64Number basicNumber
+hi def link qb64Statement Statement
+hi def link qb64TypeSuffix basicTypeSuffix
+hi def link qb64Type Type
+hi def link qb64Unsupported Error
+
+" Postscript {{{1
+let b:current_syntax = "qb64"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
diff --git a/runtime/syntax/rc.vim b/runtime/syntax/rc.vim
index 4c6856bc83..d69edd00fd 100644
--- a/runtime/syntax/rc.vim
+++ b/runtime/syntax/rc.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: M$ Resource files (*.rc)
" Maintainer: Christian Brabandt
-" Last Change: 2015-05-29
+" Last Change: 20220116
" Repository: https://github.com/chrisbra/vim-rc-syntax
" License: Vim (see :h license)
" Previous Maintainer: Heiko Erhardt <Heiko.Erhardt@munich.netsurf.de>
@@ -173,16 +173,17 @@ hi def link rcAttribute rcCommonAttribute
hi def link rcStdId rcStatement
hi def link rcStatement Statement
-" Default color overrides
-hi def rcLanguage term=reverse ctermbg=Red ctermfg=Yellow guibg=Red guifg=Yellow
-hi def rcMainObject term=underline ctermfg=Blue guifg=Blue
-hi def rcSubObject ctermfg=Green guifg=Green
-hi def rcCaptionParam term=underline ctermfg=DarkGreen guifg=Green
-hi def rcParam ctermfg=DarkGreen guifg=DarkGreen
-hi def rcStatement ctermfg=DarkGreen guifg=DarkGreen
-hi def rcCommonAttribute ctermfg=Brown guifg=Brown
+hi def link rcLanguage Constant
+hi def link rcCaptionParam Constant
+hi def link rcCommonAttribute Constant
+
+hi def link rcMainObject Identifier
+hi def link rcSubObject Define
+hi def link rcParam Constant
+hi def link rcStatement Statement
+"
+"hi def link rcIdentifier Identifier
-"hi def link rcIdentifier Identifier
let b:current_syntax = "rc"
diff --git a/runtime/syntax/scala.vim b/runtime/syntax/scala.vim
index 16e114778d..c08e60e55a 100644
--- a/runtime/syntax/scala.vim
+++ b/runtime/syntax/scala.vim
@@ -3,7 +3,7 @@
" Maintainer: Derek Wyatt
" URL: https://github.com/derekwyatt/vim-scala
" License: Same as Vim
-" Last Change: 23 August 2021
+" Last Change: 23 January 2022
" ----------------------------------------------------------------------------
if !exists('main_syntax')
@@ -43,55 +43,55 @@ syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstance
syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite
syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
-hi link scalaKeyword Keyword
+hi def link scalaKeyword Keyword
exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold'
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
-hi link scalaAkkaSpecialWord PreProc
+hi def link scalaAkkaSpecialWord PreProc
syn keyword scalatestSpecialWord shouldBe
syn match scalatestShouldDSLA /^\s\+\zsit should/
syn match scalatestShouldDSLB /\<should\>/
-hi link scalatestSpecialWord PreProc
-hi link scalatestShouldDSLA PreProc
-hi link scalatestShouldDSLB PreProc
+hi def link scalatestSpecialWord PreProc
+hi def link scalatestShouldDSLA PreProc
+hi def link scalatestShouldDSLB PreProc
syn match scalaSymbol /'[_A-Za-z0-9$]\+/
-hi link scalaSymbol Number
+hi def link scalaSymbol Number
syn match scalaChar /'.'/
syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar
syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar
syn match scalaEscapedChar /\\[\\"'ntbrf]/
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
-hi link scalaChar Character
-hi link scalaEscapedChar Special
-hi link scalaUnicodeChar Special
+hi def link scalaChar Character
+hi def link scalaEscapedChar Special
+hi def link scalaUnicodeChar Special
syn match scalaOperator "||"
syn match scalaOperator "&&"
syn match scalaOperator "|"
syn match scalaOperator "&"
-hi link scalaOperator Special
+hi def link scalaOperator Special
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList
syn match scalaNameDefinition /`[^`]\+`/ contained nextgroup=scalaPostNameDefinition
syn match scalaVariableDeclarationList /\s*,\s*/ contained nextgroup=scalaNameDefinition
syn match scalaPostNameDefinition /\_s*:\_s*/ contained nextgroup=scalaTypeDeclaration
-hi link scalaNameDefinition Function
+hi def link scalaNameDefinition Function
syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaInstanceHash
syn match scalaInstanceDeclaration /`[^`]\+`/ contained
syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration
-hi link scalaInstanceDeclaration Special
-hi link scalaInstanceHash Type
+hi def link scalaInstanceDeclaration Special
+hi def link scalaInstanceHash Type
syn match scalaUnimplemented /???/
-hi link scalaUnimplemented ERROR
+hi def link scalaUnimplemented ERROR
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
-hi link scalaCapitalWord Special
+hi def link scalaCapitalWord Special
" Handle type declarations specially
syn region scalaTypeStatement matchgroup=Keyword start=/\<type\_s\+\ze/ end=/$/ contains=scalaTypeTypeDeclaration,scalaSquareBrackets,scalaTypeTypeEquals,scalaTypeStatement
@@ -105,18 +105,18 @@ syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDe
syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypePostDeclaration skipwhite
-hi link scalaTypeTypeDeclaration Type
-hi link scalaTypeTypeExtension Keyword
-hi link scalaTypeTypePostDeclaration Special
-hi link scalaTypeTypePostExtension Keyword
+hi def link scalaTypeTypeDeclaration Type
+hi def link scalaTypeTypeExtension Keyword
+hi def link scalaTypeTypePostDeclaration Special
+hi def link scalaTypeTypePostExtension Keyword
syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeDeclaration skipwhite
-hi link scalaTypeDeclaration Type
-hi link scalaTypeExtension Keyword
-hi link scalaTypePostExtension Keyword
+hi def link scalaTypeDeclaration Type
+hi def link scalaTypeExtension Keyword
+hi def link scalaTypePostExtension Keyword
syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration contains=scalaRoundBrackets
syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
@@ -124,51 +124,51 @@ hi clear scalaTypeAnnotation
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained contains=scalaCapitalWord
syn match scalaCaseFollowing /`[^`]\+`/ contained contains=scalaCapitalWord
-hi link scalaCaseFollowing Special
+hi def link scalaCaseFollowing Special
syn keyword scalaKeywordModifier abstract override final lazy implicit private protected sealed null super
syn keyword scalaSpecialFunction implicitly require
-hi link scalaKeywordModifier Function
-hi link scalaSpecialFunction Function
+hi def link scalaKeywordModifier Function
+hi def link scalaSpecialFunction Function
syn keyword scalaSpecial this true false ne eq
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
syn match scalaSpecial /`[^`]\+`/ " Backtick literals
-hi link scalaSpecial PreProc
+hi def link scalaSpecial PreProc
syn keyword scalaExternal package import
-hi link scalaExternal Include
+hi def link scalaExternal Include
syn match scalaStringEmbeddedQuote /\\"/ contained
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
-hi link scalaString String
-hi link scalaStringEmbeddedQuote String
+hi def link scalaString String
+hi def link scalaStringEmbeddedQuote String
syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\ze\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
-hi link scalaIString String
-hi link scalaTripleIString String
+hi def link scalaIString String
+hi def link scalaTripleIString String
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
-hi link scalaInterpolation Function
+hi def link scalaInterpolation Function
hi clear scalaInterpolationB
syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
-hi link scalaFString String
-hi link scalaFInterpolation Function
+hi def link scalaFString String
+hi def link scalaFInterpolation Function
hi clear scalaFInterpolationB
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
-hi link scalaTripleString String
-hi link scalaTripleFString String
+hi def link scalaTripleString String
+hi def link scalaTripleFString String
-hi link scalaInterpolationBrackets Special
-hi link scalaInterpolationBoundary Function
+hi def link scalaInterpolationBrackets Special
+hi def link scalaInterpolationBoundary Function
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
@@ -176,16 +176,16 @@ syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
syn match scalaNumber /\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\=/ " exponential notation 1
syn match scalaNumber /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/ " exponential notation 2
syn match scalaNumber /\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>/ " exponential notation 3
-hi link scalaNumber Number
+hi def link scalaNumber Number
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
syn match scalaTypeOperator /[-+=:<>]\+/ contained
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
-hi link scalaSquareBracketsBrackets Type
-hi link scalaTypeOperator Keyword
-hi link scalaTypeAnnotationParameter Function
+hi def link scalaSquareBracketsBrackets Type
+hi def link scalaTypeOperator Keyword
+hi def link scalaTypeAnnotationParameter Function
syn match scalaShebang "\%^#!.*" display
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold
@@ -195,20 +195,20 @@ syn match scalaParamAnnotationValue /[.`_A-Za-z0-9$]\+/ contained
syn region scalaDocLinks start="\[\[" end="\]\]" contained
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
syn match scalaTodo "\vTODO|FIXME|XXX" contained
-hi link scalaShebang Comment
-hi link scalaMultilineComment Comment
-hi link scalaDocLinks Function
-hi link scalaParameterAnnotation Function
-hi link scalaParamAnnotationValue Keyword
-hi link scalaCommentAnnotation Function
-hi link scalaCommentCodeBlock String
-hi link scalaTodo Todo
+hi def link scalaShebang Comment
+hi def link scalaMultilineComment Comment
+hi def link scalaDocLinks Function
+hi def link scalaParameterAnnotation Function
+hi def link scalaParamAnnotationValue Keyword
+hi def link scalaCommentAnnotation Function
+hi def link scalaCommentCodeBlock String
+hi def link scalaTodo Todo
syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
-hi link scalaAnnotation PreProc
+hi def link scalaAnnotation PreProc
syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell
-hi link scalaTrailingComment Comment
+hi def link scalaTrailingComment Comment
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
syn match scalaAkkaFSM /stay\_s\+using/
@@ -221,8 +221,8 @@ syn match scalaAkkaFSM /onTermination/
syn match scalaAkkaFSM /whenUnhandled/
syn match scalaAkkaFSMGotoUsing /\<using\>/
syn match scalaAkkaFSMGotoUsing /\<goto\>/
-hi link scalaAkkaFSM PreProc
-hi link scalaAkkaFSMGotoUsing PreProc
+hi def link scalaAkkaFSM PreProc
+hi def link scalaAkkaFSMGotoUsing PreProc
let b:current_syntax = 'scala'
diff --git a/runtime/syntax/strace.vim b/runtime/syntax/strace.vim
index 206c58919e..20516a1853 100644
--- a/runtime/syntax/strace.vim
+++ b/runtime/syntax/strace.vim
@@ -1,8 +1,7 @@
" Vim syntax file
-" This is a GENERATED FILE. Please always refer to source file at the URI below.
" Language: strace output
" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
-" Last Change: 2015-01-16
+" Last Change: 2022 Jan 29
" Setup
" quit when a syntax file was already loaded