diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
commit | d5f194ce780c95821a855aca3c19426576d28ae0 (patch) | |
tree | d45f461b19f9118ad2bb1f440a7a08973ad18832 /runtime/syntax | |
parent | c5d770d311841ea5230426cc4c868e8db27300a8 (diff) | |
parent | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff) | |
download | rneovim-rahm.tar.gz rneovim-rahm.tar.bz2 rneovim-rahm.zip |
Diffstat (limited to 'runtime/syntax')
33 files changed, 2461 insertions, 978 deletions
diff --git a/runtime/syntax/apache.vim b/runtime/syntax/apache.vim index e73045e4c8..65317fd36a 100644 --- a/runtime/syntax/apache.vim +++ b/runtime/syntax/apache.vim @@ -3,8 +3,8 @@ " Maintainer: David Necas (Yeti) <yeti@physics.muni.cz> " License: This file can be redistribued and/or modified under the same terms " as Vim itself. -" Last Change: 2022 Apr 25 -" Notes: Last synced with apache-2.2.3, version 1.x is no longer supported +" Last Change: 2024 Nov 24 +" Notes: Last synced with apache-2.4.62, version 1.x is no longer supported " TODO: see particular FIXME's scattered through the file " make it really linewise? " + add `display' where appropriate @@ -14,6 +14,7 @@ if exists("b:current_syntax") finish endif +syn iskeyword @,48-57,_,192-255,- syn case ignore " Base constructs @@ -45,9 +46,9 @@ syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH P " Added as suggested by Mikko Koivunalho syn keyword apacheMethodOption BASELINE-CONTROL CHECKIN CHECKOUT LABEL MERGE MKACTIVITY MKWORKSPACE REPORT UNCHECKOUT UPDATE VERSION-CONTROL contained syn case ignore -syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)[^>]*>" contains=apacheAnything +syn match apacheSection "<\/\=\(Directory\|Files\|If\|Else\|Location\|VirtualHost\)[^>]*>" contains=apacheAnything syn match apacheSection "<\/\=\(RequireAll\|RequireAny\|RequireNone\)>" contains=apacheAnything -syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError +syn match apacheLimitSection "<\/\=Limit[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError syn keyword apacheLimitSectionKeyword Limit LimitExcept contained syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue syn keyword apacheAuthTypeValue Basic Digest @@ -68,7 +69,7 @@ syn keyword apacheDeclaration AuthAuthoritative AuthGroupFile AuthUserFile syn keyword apacheDeclaration AuthBasicAuthoritative AuthBasicProvider syn keyword apacheDeclaration AuthDigestAlgorithm AuthDigestDomain AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestProvider AuthDigestQop AuthDigestShmemSize syn keyword apacheOption none auth auth-int MD5 MD5-sess -syn match apacheSection "<\/\=\(<AuthnProviderAlias\)[^>]*>" contains=apacheAnything +syn match apacheSection "<\/\=Auth[ntz]ProviderAlias[^>]*>" contains=apacheAnything syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail syn keyword apacheDeclaration AuthDBDUserPWQuery AuthDBDUserRealmQuery syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMAuthoritative @@ -155,7 +156,7 @@ syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler PerlChildE syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader syn keyword apacheDeclaration php_value php_flag php_admin_value php_admin_flag -syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)[^>]*>" contains=apacheAnything +syn match apacheSection "<\/\=\(Macro\|MDomain\|Proxy\)[^>]*>" contains=apacheAnything syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBadHeader ProxyBlock ProxyDomain ProxyErrorOverride ProxyIOBufferSize ProxyMaxForwards ProxyPass ProxyPassMatch ProxyPassReverse ProxyPassReverseCookieDomain ProxyPassReverseCookiePath ProxyPreserveHost ProxyReceiveBufferSize ProxyRemote ProxyRemoteMatch ProxyRequests ProxyTimeout ProxyVia syn keyword apacheDeclaration RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule syn keyword apacheOption inherit @@ -173,8 +174,8 @@ syn keyword apacheDeclaration SuexecUserGroup syn keyword apacheDeclaration UserDir syn keyword apacheDeclaration CookieDomain CookieExpires CookieName CookieStyle CookieTracking syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965 -syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP +syn keyword apacheDeclaration AcceptErrorsNonFatal AsyncFilter AsyncRequestWorkerFactor AuthBasicFake AuthBasicUseDigestAlgorithm AuthBearerAuthoritative AuthBearerProvider AuthBearerProxy AuthDBMType AuthDBMUserFile AuthFormAuthoritative AuthFormBody AuthFormDisableNoStore AuthFormFakeBasicAuth AuthFormLocation AuthFormLoginRequiredLocation AuthFormLoginSuccessLocation AuthFormLogoutLocation AuthFormMethod AuthFormMimetype AuthFormPassword AuthFormProvider AuthFormSitePassphrase AuthFormSize AuthFormUsername AuthLDAPAuthorizePrefix AuthLDAPBindAuthoritative AuthLDAPCompareAsUser AuthLDAPInitialBindAsUser AuthLDAPInitialBindPattern AuthLDAPMaxSubGroupDepth AuthLDAPRemoteUserAttribute AuthLDAPSearchAsUser AuthLDAPSubGroupAttribute AuthLDAPSubGroupClass AuthLDAPURL AuthMerging AuthnCacheContext AuthnCacheEnable AuthnCacheProvideFor AuthnCacheSOCache AuthnCacheTimeout AuthnzFcgiCheckAuthnProvider AuthnzFcgiDefineProvider AuthtJwtClaim AuthtJwtDriver AuthtJwtSign AuthtJwtVerify AuthzDBDLoginToReferer AuthzDBDQuery AuthzDBDRedirectQuery AuthzSendForbiddenOnFailure BalancerGrowth BalancerInherit BalancerMember BalancerPersist BrotliAlterETag BrotliCompressionMaxInputBlock BrotliCompressionQuality BrotliCompressionWindow BrotliFilterNote BufferSize CacheDetailHeader CacheHeader CacheIgnoreQueryString CacheIgnoreURLSessionIdentifiers CacheKeyBaseURL CacheLock CacheLockMaxAge CacheLockPath CacheMinExpire CacheQuickHandler CacheReadSize CacheReadTime CacheSocache CacheSocacheMaxSize CacheSocacheMaxTime CacheSocacheMinTime CacheSocacheReadSize CacheSocacheReadTime CacheStaleOnError CacheStoreExpired CGIDScriptTimeout CGIPassAuth CGIScriptTimeout CGIVar CheckBasenameMatch ChrootDir CookieHTTPOnly CookieSameSite CookieSecure CryptoCipher CryptoDriver CryptoIV CryptoKey CryptoSize CTAuditStorage CTLogClient CTLogConfigDB CTMaxSCTAge CTProxyAwareness CTSCTStorage CTServerHelloSCTLimit CTStaticLogConfig CTStaticSCTs DBDInitSQL DefaultRuntimeDir DefaultStateDir DeflateAlterETag DeflateInflateLimitRequestBody DeflateInflateRatioBurst DeflateInflateRatioLimit DirectoryCheckHandler DTracePrivileges FallbackResource Files FilesMatch FirehoseConnectionInput FirehoseConnectionOutput FirehoseProxyConnectionInput FirehoseProxyConnectionOutput FirehoseRequestInput FirehoseRequestOutput FlushMaxPipelined FlushMaxThreshold GlobalLog GprofDir H2CopyFiles H2Direct H2EarlyHint H2EarlyHints H2MaxDataFrameLen H2MaxSessionStreams H2MaxWorkerIdleSeconds H2MaxWorkers H2MinWorkers H2ModernTLSOnly H2OutputBuffering H2Padding H2ProxyRequests H2Push H2PushDiarySize H2PushPriority H2PushResource H2SerializeHeaders H2StreamMaxMemSize H2StreamTimeout H2TLSCoolDownSecs H2TLSWarmUpSize H2Upgrade H2WebSockets H2WindowSize HeartbeatAddress HeartbeatListen HeartbeatMaxServers HeartbeatStorage HeartbeatStorage HostnameLookups HttpProtocolOptions IndexForbiddenReturn404 IndexHeadInsert InputSed ISAPIFakeAsync KeptBodySize LDAPConnectionPoolTTL LDAPLibraryDebug LDAPReferralHopLimit LDAPReferrals LDAPRetries LDAPRetryDelay LDAPTimeout Location LocationMatch LogIOTrackTTFB LogIOTrackTTFU LogMessage LuaAuthzProvider LuaCodeCache LuaHookAccessChecker LuaHookAuthChecker LuaHookCheckUserID LuaHookFixups LuaHookInsertFilter LuaHookLog LuaHookMapToStorage LuaHookPreTranslate LuaHookTranslateName LuaHookTypeChecker LuaInherit LuaInputFilter LuaMapHandler LuaOutputFilter LuaPackageCPath LuaPackagePath LuaQuickHandler LuaRoot LuaScope MacroIgnoreBadNesting MacroIgnoreEmptyArgs MaxConnectionsPerChild MaxRangeOverlaps MaxRangeReversals MaxRanges MaxRequestWorkers MDActivationDelay MDBaseServer MDCAChallenges MDCertificateAgreement MDCertificateAuthority MDCertificateCheck MDCertificateFile MDCertificateKeyFile MDCertificateMonitor MDCertificateProtocol MDCertificateStatus MDChallengeDns01 MDChallengeDns01Version MDCheckInterval MDContactEmail MDDriveMode MDExternalAccountBinding MDHttpProxy MDMatchNames MDMember MDMembers MDMessageCmd MDMustStaple MDNotifyCmd MDomain MDPortMap MDPrivateKeys MDRenewMode MDRenewWindow MDRequireHttps MDRetryDelay MDRetryFailover MDServerStatus MDStapleOthers MDStapling MDStaplingKeepResponse MDStaplingRenewWindow MDStoreDir MDStoreLocks MDWarnWindow MemcacheConnTTL MergeSlashes MergeTrailers MimeOptions ModemStandard Mutex Order OutputSed PolicyConditional PolicyConditionalURL PolicyEnvironment PolicyFilter PolicyKeepalive PolicyKeepaliveURL PolicyLength PolicyLengthURL PolicyMaxage PolicyMaxageURL PolicyNocache PolicyNocacheURL PolicyType PolicyTypeURL PolicyValidation PolicyValidationURL PolicyVary PolicyVaryURL PolicyVersion PolicyVersionURL PrivilegesMode Protocol Protocols ProtocolsHonorOrder Proxy100Continue ProxyAddHeaders ProxyExpressDBMFile ProxyExpressDBMType ProxyExpressEnable ProxyFCGIBackendType ProxyFCGISetEnvIf ProxyFtpDirCharset ProxyFtpEscapeWildcards ProxyFtpListOnWildcard ProxyHCExpr ProxyHCTemplate ProxyHCTPsize ProxyHTMLBufSize ProxyHTMLCharsetOut ProxyHTMLDocType ProxyHTMLEnable ProxyHTMLEvents ProxyHTMLExtended ProxyHTMLFixups ProxyHTMLInterp ProxyHTMLLinks ProxyHTMLMeta ProxyHTMLStripComments ProxyHTMLURLMap ProxySCGIInternalRedirect ProxySCGISendfile ProxySet ProxySourceAddress ProxyStatus ProxyWebsocketAsync ProxyWebsocketAsyncDelay ProxyWebsocketFallbackToProxyHttp ProxyWebsocketIdleTimeout QualifyRedirectURL ReadBufferSize ReceiveBufferSize RedisConnPoolTTL RedisTimeout ReflectorHeader RegexDefaultOptions RegisterHttpMethod RemoteIPHeader RemoteIPInternalProxy RemoteIPInternalProxyList RemoteIPProxiesHeader RemoteIPProxyProtocol RemoteIPProxyProtocolExceptions RemoteIPTrustedProxy RemoteIPTrustedProxyList RemoveLanguage RequestReadTimeout SeeRequestTail Session SessionCookieMaxAge SessionCookieName SessionCookieName2 SessionCookieRemove SessionCryptoCipher SessionCryptoDriver SessionCryptoPassphrase SessionCryptoPassphraseFile SessionDBDCookieName SessionDBDCookieName2 SessionDBDCookieRemove SessionDBDDeleteLabel SessionDBDInsertLabel SessionDBDPerUser SessionDBDSelectLabel SessionDBDUpdateLabel SessionEnv SessionExclude SessionExpiryUpdateInterval SessionHeader SessionInclude SessionMaxAge SSIETag SSILastModified SSILegacyExprParser SSLCARevocationCheck SSLClientHelloVars SSLOCSPDefaultResponder SSLOCSPEnable SSLOCSPNoverify SSLOCSPOverrideResponder SSLOCSPProxyURL SSLOCSPResponderCertificateFile SSLOCSPResponderTimeout SSLOCSPResponseMaxAge SSLOCSPResponseTimeSkew SSLOCSPUseRequestNonce SSLOpenSSLConfCmd SSLPolicy SSLProxyCARevocationCheck SSLProxyCheckPeerName SSLSRPUnknownUserSeed SSLSRPVerifierFile SSLStaplingCache SSLStaplingErrorCacheTimeout SSLStaplingFakeTryLater SSLStaplingForceURL SSLStaplingResponderTimeout SSLStaplingResponseMaxAge SSLStaplingResponseTimeSkew SSLStaplingReturnResponderErrors SSLStaplingStandardCacheTimeout SSLUseStapling StrictHostCheck Substitute SubstituteInheritBefore SubstituteMaxLineLength Suexec UNCList UnDefine UndefMacro Use UseCanonicalPhysicalPort VHostCGIMode VHostCGIPrivs VHostGroup VHostPrivs VHostSecure VHostUser Warning WatchdogInterval xml2EncAlias xml2EncDefault xml2StartParse " Define the default highlighting diff --git a/runtime/syntax/apkbuild.vim b/runtime/syntax/apkbuild.vim new file mode 100644 index 0000000000..f969ff0e2e --- /dev/null +++ b/runtime/syntax/apkbuild.vim @@ -0,0 +1,17 @@ +" Vim syntax file +" Language: apkbuild +" Maintainer: The Vim Project <https://github.com/vim/vim> +" Last Change: 2024 Dec 22 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" The actual syntax is in sh.vim and controlled by buffer-local variables. +unlet! b:is_bash b:is_kornshell +let b:is_sh = 1 + +runtime! syntax/sh.vim + +let b:current_syntax = 'apkbuild' diff --git a/runtime/syntax/asm.vim b/runtime/syntax/asm.vim index 73f283a4a7..18f3de1c63 100644 --- a/runtime/syntax/asm.vim +++ b/runtime/syntax/asm.vim @@ -3,8 +3,8 @@ " Maintainer: Doug Kearns dougkearns@gmail.com " Previous Maintainers: Erik Wognsen <erik.wognsen@gmail.com> " Kevin Dahlhausen <kdahlhaus@yahoo.com> -" Contributors: Ori Avtalion, Lakshay Garg -" Last Change: 2020 Oct 31 +" Contributors: Ori Avtalion, Lakshay Garg, Nir Lichtman +" Last Change: 2025 Jan 26 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -32,6 +32,9 @@ syn match asmType "\.single" syn match asmType "\.space" syn match asmType "\.string" syn match asmType "\.word" +syn match asmType "\.2byte" +syn match asmType "\.4byte" +syn match asmType "\.8byte" syn match asmIdentifier "[a-z_][a-z0-9_]*" syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1 diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index 30db9438d0..68b6778c73 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: C -" Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2023 Aug 10 +" Language: C +" Maintainer: The Vim Project <https://github.com/vim/vim> +" Last Change: 2025 Jan 18 " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Quit when a (custom) syntax file was already loaded @@ -111,6 +111,20 @@ if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_ syn match cSpecialCharacter display "[Uu]'\\x\x\+'" endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp17")) + syn match cCharacter "u8'[^\\]'" + syn match cCharacter "u8'[^']*'" contains=cSpecial + if exists("c_gnu") + syn match cSpecialError "u8'\\[^'\"?\\abefnrtv]'" + syn match cSpecialCharacter "u8'\\['\"?\\abefnrtv]'" + else + syn match cSpecialError "u8'\\[^'\"?\\abfnrtv]'" + syn match cSpecialCharacter "u8'\\['\"?\\abfnrtv]'" + endif + syn match cSpecialCharacter display "u8'\\\o\{1,3}'" + syn match cSpecialCharacter display "u8'\\x\x\+'" +endif + "when wanted, highlight trailing white space if exists("c_space_errors") if !exists("c_no_trail_space_error") @@ -191,12 +205,25 @@ syn case ignore syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal " Same, but without octal error (for comments) syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal -syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" -"hex number -syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" -" Flag the first zero of an octal number as something special -syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero -syn match cOctalZero display contained "\<0" + +" cpp.vim handles these +if !exists("c_no_c23") && !s:in_cpp_family + syn match cNumber display contained "\d\%('\=\d\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" + "hex number + syn match cNumber display contained "0x\x\%('\=\x\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" + " Flag the first zero of an octal number as something special + syn match cOctal display contained "0\o\%('\=\o\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" contains=cOctalZero + "binary number + syn match cNumber display contained "0b[01]\%('\=[01]\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" +else + syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" + "hex number + syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" + " Flag the first zero of an octal number as something special + syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero + syn match cOctalZero display contained "\<0" +endif + "floating point number, with dot, optional exponent syn match cFloat display contained "\d\+\.\d*\%(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent @@ -277,6 +304,13 @@ if !exists("c_no_c99") " ISO C99 syn keyword cType intptr_t uintptr_t syn keyword cType intmax_t uintmax_t endif +if !exists("c_no_c23") && !s:in_cpp_family + syn keyword cOperator typeof typeof_unqual + syn keyword cType _BitInt _Decimal32 _Decimal64 _Decimal128 +endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cType nullptr_t +endif syn keyword cTypedef typedef syn keyword cStructure struct union enum @@ -284,6 +318,9 @@ syn keyword cStorageClass static register auto volatile extern const if !exists("c_no_c99") && !s:in_cpp_family syn keyword cStorageClass inline restrict endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cStorageClass constexpr +endif if !exists("c_no_c11") syn keyword cStorageClass _Alignas alignas syn keyword cOperator _Alignof alignof @@ -312,10 +349,15 @@ if !exists("c_no_c11") syn keyword cType atomic_intmax_t atomic_uintmax_t endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp20")) + syn keyword cType char8_t +endif + if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") if exists("c_gnu") syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__ endif + " TODO: __STDC_HOSTED__ is C99 and C++11 syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __STDC_VERSION__ __STDC_HOSTED__ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX @@ -324,6 +366,8 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX if !exists("c_no_c99") + syn keyword cConstant __STDC_ISO_10646__ __STDC_IEC_559_COMPLEX__ + syn keyword cConstant __STDC_MB_MIGHT_NEQ_WC__ syn keyword cConstant __func__ __VA_ARGS__ syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN @@ -340,6 +384,26 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX endif + if !exists("c_no_c11") + syn keyword cConstant __STDC_UTF_16__ __STDC_UTF_32__ __STDC_ANALYZABLE__ + syn keyword cConstant __STDC_LIB_EXT1__ __STDC_NO_ATOMICS__ + syn keyword cConstant __STDC_NO_COMPLEX__ __STDC_NO_THREADS__ + syn keyword cConstant __STDC_NO_VLA__ + endif + if !exists("c_no_c23") + syn keyword cConstant __STDC_UTF_16__ __STDC_UTF_32__ + syn keyword cConstant __STDC_EMBED_NOT_FOUND__ __STDC_EMBED_FOUND__ + syn keyword cConstant __STDC_EMBED_EMPTY__ __STDC_IEC_60559_BFP__ + syn keyword cConstant __STDC_IEC_60559_DFP__ __STDC_IEC_60559_COMPLEX__ + syn keyword cConstant __STDC_IEC_60559_TYPES__ + syn keyword cConstant BITINT_MAXWIDTH + endif + if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp20")) + syn keyword cConstant __VA_OPT__ + endif + if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cConstant nullptr + endif syn keyword cConstant FLT_RADIX FLT_ROUNDS FLT_DIG FLT_MANT_DIG FLT_EPSILON DBL_DIG DBL_MANT_DIG DBL_EPSILON syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MAX_10_EXP syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MAX_10_EXP LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP @@ -377,37 +441,77 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") endif if !exists("c_no_c99") " ISO C99 syn keyword cConstant true false + syn keyword cConstant INFINITY NAN + " math.h + syn keyword cConstant HUGE_VAL HUGE_VALF HUGE_VALL + syn keyword cConstant FP_FAST_FMAF FP_FAST_FMA FP_FAST_FMAL + syn keyword cConstant FP_ILOGB0 FP_ILOGBNAN + syn keyword cConstant math_errhandling MATH_ERRNO MATH_ERREXCEPT + syn keyword cConstant FP_NORMAL FP_SUBNORMAL FP_ZERO FP_INFINITE FP_NAN endif " Accept %: for # (C99) -syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock +if !exists("c_no_c23") + syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(el\)\=\%(if\|ifdef\|ifndef\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +else + syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +endif syn match cPreConditMatch display "^\s*\zs\%(%:\|#\)\s*\%(else\|endif\)\>" if !exists("c_no_if0") syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip syn region cCppOutWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0\+\s*\%($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\%(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse if !exists("c_no_if0_fold") - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + if !exists("c_no_c23") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + endif + else + if !exists("c_no_c23") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + endif + endif + if !exists("c_no_c23") + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|el\%(if\|ifdef\|ifndef\)\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit else - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit endif - syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppInWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\%($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\%(%:\|#\)\s*endif\>" contains=TOP,cPreCondit if !exists("c_no_if0_fold") - syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + if !exists("c_no_c23") + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + else + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + endif else - syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + if !exists("c_no_c23") + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + else + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + endif + endif + if !exists("c_no_c23") + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|el\%(if\|ifdef\|ifndef\)\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + else + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif - syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell syn region cCppOutSkip contained start="^\s*\%(%:\|#\)\s*\%(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(if\s\+\%(\d\+\s*\%($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc endif syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match cIncluded display contained "<[^>]*>" syn match cInclude display "^\s*\zs\%(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +if !exists("c_no_c23") && !s:in_cpp_family + syn region cInclude start="^\s*\zs\%(%:\|#\)\s*embed\>" skip="\\$" end="$" keepend contains=cEmbed,cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError + syn match cEmbed contained "\%(%:\|#\)\s*embed\>" nextgroup=cIncluded skipwhite transparent + syn cluster cPreProcGroup add=cEmbed +endif "syn match cLineSkip "\\$" -syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock syn region cDefine start="^\s*\zs\%(%:\|#\)\s*\%(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell syn region cPreProc start="^\s*\zs\%(%:\|#\)\s*\%(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell diff --git a/runtime/syntax/checkhealth.vim b/runtime/syntax/checkhealth.vim index a4f6e016cb..14c80640ba 100644 --- a/runtime/syntax/checkhealth.vim +++ b/runtime/syntax/checkhealth.vim @@ -1,6 +1,5 @@ " Vim syntax file " Language: Nvim :checkhealth buffer -" Last Change: 2022 Nov 10 if exists("b:current_syntax") finish diff --git a/runtime/syntax/chordpro.vim b/runtime/syntax/chordpro.vim index 41a0a1e9d1..02c34b8466 100644 --- a/runtime/syntax/chordpro.vim +++ b/runtime/syntax/chordpro.vim @@ -2,6 +2,7 @@ " Language: ChordPro 6 (https://www.chordpro.org) " Maintainer: Niels Bo Andersen <niels@niboan.dk> " Last Change: 2022-04-15 +" 2024 Dec 31: add "keys" as syntax keyword (via: https://groups.google.com/g/vim_dev/c/vP4epus0euM/m/mNoDY6hsCQAJ) " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -104,7 +105,7 @@ syn match chordproStandardMetadata /instrument\.description/ contained syn match chordproStandardMetadata /user\.name/ contained syn match chordproStandardMetadata /user\.fullname/ contained -syn keyword chordproDefineKeyword contained frets fingers +syn keyword chordproDefineKeyword contained frets fingers keys syn match chordproDefineKeyword /base-fret/ contained syn match chordproArgumentsNumber /\d\+/ contained diff --git a/runtime/syntax/cmacro.vim b/runtime/syntax/cmacro.vim new file mode 100644 index 0000000000..1d448f0d1b --- /dev/null +++ b/runtime/syntax/cmacro.vim @@ -0,0 +1,77 @@ +" Vim syntax file +" Language: C macro for C preprocessor +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Last Change: 2024 Dec 31 +" modified from syntax/c.vim + +" C compiler has a preprocessor: `cpp -P test.txt` +" test.txt doesn't need to be a C file +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" Accept %: for # (C99) +syn region cmacroPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cmacroCppParen,cmacroNumbers +syn match cmacroPreConditMatch display "^\s*\zs\%(%:\|#\)\s*\%(else\|endif\)\>" +if !exists("c_no_if0") + syn cluster cmacroCppOutInGroup contains=cmacroCppInIf,cmacroCppInElse,cmacroCppInElse2,cmacroCppOutIf,cmacroCppOutIf2,cmacroCppOutElse,cmacroCppInSkip,cmacroCppOutSkip + syn region cmacroCppOutWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0\+\s*\%($\|//\|/\*\|&\)" end=".\@=\|$" contains=cmacroCppOutIf,cmacroCppOutElse,@NoSpell fold + syn region cmacroCppOutIf contained start="0\+" matchgroup=cmacroCppOutWrapper end="^\s*\%(%:\|#\)\s*endif\>" contains=cmacroCppOutIf2,cmacroCppOutElse + if !exists("c_no_if0_fold") + syn region cmacroCppOutIf2 contained matchgroup=cmacroCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cmacroCppOutSkip,@Spell fold + else + syn region cmacroCppOutIf2 contained matchgroup=cmacroCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cmacroCppOutSkip,@Spell + endif + syn region cmacroCppOutElse contained matchgroup=cmacroCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cmacroPreCondit + syn region cmacroCppInWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\%($\|//\|/\*\||\)" end=".\@=\|$" contains=cmacroCppInIf,cmacroCppInElse fold + syn region cmacroCppInIf contained matchgroup=cmacroCppInWrapper start="\d\+" end="^\s*\%(%:\|#\)\s*endif\>" contains=TOP,cmacroPreCondit + if !exists("c_no_if0_fold") + syn region cmacroCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cmacroCppInIf contains=cmacroCppInElse2 fold + else + syn region cmacroCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cmacroCppInIf contains=cmacroCppInElse2 + endif + syn region cmacroCppInElse2 contained matchgroup=cmacroCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cmacroCppOutSkip,@Spell + syn region cmacroCppOutSkip contained start="^\s*\%(%:\|#\)\s*\%(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" contains=cmacroCppOutSkip + syn region cmacroCppInSkip contained matchgroup=cmacroCppInWrapper start="^\s*\%(%:\|#\)\s*\%(if\s\+\%(\d\+\s*\%($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" containedin=cmacroCppOutElse,cmacroCppInIf,cmacroCppInSkip contains=TOP,cmacroPreProc +endif +syn region cmacroIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match cmacroIncluded display contained "<[^>]*>" +syn match cmacroInclude display "^\s*\zs\%(%:\|#\)\s*include\>\s*["<]" contains=cmacroIncluded +"syn match cmacroLineSkip "\\$" +syn cluster cmacroPreProcmacroGroup contains=cmacroPreCondit,cmacroIncluded,cmacroInclude,cmacroDefine,cmacroCppOutWrapper,cmacroCppInWrapper,@cmacroCppOutInGroup,cmacroNumbersCom,@cmacroCommentGroup,cmacroParen,cmacroBracket,cmacroMulti,cmacroBadBlock +syn region cmacroDefine start="^\s*\zs\%(%:\|#\)\s*\%(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cmacroPreProcmacroGroup,@Spell +syn region cmacroPreProc start="^\s*\zs\%(%:\|#\)\s*\%(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cmacroPreProcmacroGroup,@Spell + +" be able to fold #pragma regions +syn region cmacroPragma start="^\s*#pragma\s\+region\>" end="^\s*#pragma\s\+endregion\>" transparent keepend extend fold + +syn keyword cmacroTodo contained TODO FIXME XXX NOTE +syn region cmacroComment start='/\*' end='\*/' contains=cmacroTodo,@Spell +syn match cmacroCommentError "\*/" +syn region cmacroComment start='//' end='$' contains=cmacroTodo,@Spell + +" Define the default highlighting. +" Only used when an item doesn't have highlighting yet +hi def link cmacroInclude Include +hi def link cmacroPreProc PreProc +hi def link cmacroDefine Macro +hi def link cmacroIncluded cmacroString +hi def link cmacroCppInWrapper cmacroCppOutWrapper +hi def link cmacroCppOutWrapper cmacroPreCondit +hi def link cmacroPreConditMatch cmacroPreCondit +hi def link cmacroPreCondit PreCondit +hi def link cmacroCppOutSkip cmacroCppOutIf2 +hi def link cmacroCppInElse2 cmacroCppOutIf2 +hi def link cmacroCppOutIf2 cmacroCppOut +hi def link cmacroCppOut Comment +hi def link cmacroTodo Todo +hi def link cmacroComment Comment +hi def link cmacroCommentError Error + +let b:current_syntax = "cmacro" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/dircolors.vim b/runtime/syntax/dircolors.vim index 74a7068488..d968ed8fdd 100644 --- a/runtime/syntax/dircolors.vim +++ b/runtime/syntax/dircolors.vim @@ -85,6 +85,9 @@ endfunction function! s:get_hi_str(color, place) abort if a:color >= 0 && a:color <= 255 if has('gui_running') || &termguicolors + if ! exists("s:termguicolors") + call s:set_guicolors() + endif return ' gui' . a:place . '=' . s:termguicolors[a:color] elseif a:color <= 7 || &t_Co == 256 || &t_Co == 88 return ' cterm' . a:place . '=' . a:color diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim index 6ec71fcdb6..f1d612f4ad 100644 --- a/runtime/syntax/dockerfile.vim +++ b/runtime/syntax/dockerfile.vim @@ -1,6 +1,6 @@ " dockerfile.vim - Syntax highlighting for Dockerfiles " Maintainer: Honza Pokorny <https://honza.ca> -" Last Change: 2024 Jul 03 +" Last Change: 2024 Dec 20 " License: BSD " https://docs.docker.com/engine/reference/builder/ @@ -35,7 +35,6 @@ syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_./ end=/ syntax region dockerfileValue contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=dockerfileString syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/ contains=@Spell -set commentstring=#\ %s hi def link dockerfileString String hi def link dockerfileKeyword Keyword diff --git a/runtime/syntax/gel.vim b/runtime/syntax/gel.vim new file mode 100644 index 0000000000..5f3800273c --- /dev/null +++ b/runtime/syntax/gel.vim @@ -0,0 +1,19 @@ +" Vim syntax file +" Language: TI Code Composer Studio General Extension Language +" Document: https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Last Change: 2024 Dec 25 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/cpp.vim + +syn keyword gelStatement StartUp GEL_AddInputFile GEL_AddOutputFile GEL_AdvancedReset GEL_AsmStepInto GEL_AsmStepOver GEL_BreakPtAdd GEL_BreakPtDel GEL_BreakPtDisable GEL_BreakPtReset GEL_CancelTimer GEL_Connect GEL_Dialog GEL_DisableFileOutput GEL_DisableRealtime GEL_Disconnect GEL_EnableClock GEL_EnableFileOutput GEL_EnableRealtime GEL_EnableZeroFill GEL_EvalOnTarget GEL_GetBoolDebugProperty GEL_GetBoolDriverProperty GEL_GetBoolTargetDbProperty GEL_GetNumericDebugProperty GEL_GetNumericDriverProperty GEL_GetNumericTargetDbProperty GEL_GetStringDebugProperty GEL_GetStringDriverProperty GEL_GetStringTargetDbProperty GEL_Go GEL_Halt GEL_HandleTargetError GEL_HWBreakPtAdd GEL_HWBreakPtDel GEL_HWBreakPtDisable GEL_HWBreakPtReset GEL_IsConnected GEL_IsHalted GEL_IsInRealtimeMode GEL_IsResetSupported GEL_IsTimerSet GEL_Load GEL_LoadBin GEL_LoadGel GEL_LoadProgramOnly GEL_MapAdd GEL_MapAddStr GEL_MapDelete GEL_MapOff GEL_MapOn GEL_MapReset GEL_MatchesConnection GEL_MemoryFill GEL_MemoryListSupportedTypes GEL_MemoryLoad GEL_MemoryLoadData GEL_MemorySave GEL_MemorySaveBin GEL_MemorySaveCoff GEL_MemorySaveData GEL_MemorySaveHex GEL_PatchAssembly GEL_ProbePtAdd GEL_ProbePtDel GEL_ProbePtDisable GEL_ProbePtReset GEL_ReConnect GEL_RefreshWindows GEL_Reload GEL_RemoveDebugState GEL_RemoveInputFile GEL_RemoveOutputFile GEL_Reset GEL_Restart GEL_RestoreDebugState GEL_Run GEL_RunF GEL_SetBlockResetMode GEL_SetBoolDebugProperty GEL_SetClockEvent GEL_SetNumericDebugProperty GEL_SetSemihostingMainArgs GEL_SetStringDebugProperty GEL_SetTimer GEL_SetWaitInResetMode GEL_SrcStepInto GEL_SrcStepOver GEL_StepInto GEL_StepOut GEL_StepOver GEL_StrCat GEL_StrLen GEL_SubStr GEL_SymbolAdd GEL_SymbolAddOffset GEL_SymbolAddRel GEL_SymbolDisable GEL_SymbolEnable GEL_SymbolHideSection GEL_SymbolLoad GEL_SymbolLoadOffset GEL_SymbolLoadRel GEL_SymbolRemove GEL_SymbolShowSection GEL_SyncHalt GEL_SyncRun GEL_SyncStepInto GEL_SyncStepOut GEL_SyncStepOver GEL_System GEL_TargetTextOut GEL_TextOut GEL_Trace GEL_UnloadAllGels GEL_UnloadAllSymbols GEL_UnloadGel GEL_VerifyBinProgram GEL_VerifyProgram OnChildRunning OnFileLoaded OnHalt OnPreFileLoaded OnPreReset OnPreTargetConnect OnReset OnResetDetected OnRestart OnTargetConnect +syn keyword gelModifier hotmenu menuitem + +hi def link gelStatement Statement +hi def link gelModifier Type + +let b:current_syntax = "gel" diff --git a/runtime/syntax/graphql.vim b/runtime/syntax/graphql.vim new file mode 100644 index 0000000000..01d5ca25ff --- /dev/null +++ b/runtime/syntax/graphql.vim @@ -0,0 +1,90 @@ +" Vim syntax file +" Language: graphql +" Maintainer: Jon Parise <jon@indelible.org> +" Filenames: *.graphql *.graphqls *.gql +" URL: https://github.com/jparise/vim-graphql +" License: MIT <https://opensource.org/license/mit> +" Last Change: 2024 Dec 21 + +if !exists('main_syntax') + if exists('b:current_syntax') + finish + endif + let main_syntax = 'graphql' +endif + +syn case match + +syn match graphqlComment "#.*$" contains=@Spell + +syn match graphqlOperator "=" display +syn match graphqlOperator "!" display +syn match graphqlOperator "|" display +syn match graphqlOperator "&" display +syn match graphqlOperator "\M..." display + +syn keyword graphqlBoolean true false +syn keyword graphqlNull null +syn match graphqlNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>" display +syn region graphqlString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ +syn region graphqlString start=+"""+ skip=+\\"""+ end=+"""+ + +syn keyword graphqlKeyword repeatable nextgroup=graphqlKeyword skipwhite +syn keyword graphqlKeyword on nextgroup=graphqlType,graphqlDirectiveLocation skipwhite + +syn keyword graphqlStructure enum scalar type union nextgroup=graphqlType skipwhite +syn keyword graphqlStructure input interface subscription nextgroup=graphqlType skipwhite +syn keyword graphqlStructure implements nextgroup=graphqlType skipwhite +syn keyword graphqlStructure query mutation fragment nextgroup=graphqlName skipwhite +syn keyword graphqlStructure directive nextgroup=graphqlDirective skipwhite +syn keyword graphqlStructure extend nextgroup=graphqlStructure skipwhite +syn keyword graphqlStructure schema nextgroup=graphqlFold skipwhite + +syn match graphqlDirective "\<@\h\w*\>" display +syn match graphqlVariable "\<\$\h\w*\>" display +syn match graphqlName "\<\h\w*\>" display +syn match graphqlType "\<_*\u\w*\>" display + +" https://spec.graphql.org/October2021/#ExecutableDirectiveLocation +syn keyword graphqlDirectiveLocation QUERY MUTATION SUBSCRIPTION FIELD +syn keyword graphqlDirectiveLocation FRAGMENT_DEFINITION FRAGMENT_SPREAD +syn keyword graphqlDirectiveLocation INLINE_FRAGMENT VARIABLE_DEFINITION +" https://spec.graphql.org/October2021/#TypeSystemDirectiveLocation +syn keyword graphqlDirectiveLocation SCHEMA SCALAR OBJECT FIELD_DEFINITION +syn keyword graphqlDirectiveLocation ARGUMENT_DEFINITION INTERFACE UNION +syn keyword graphqlDirectiveLocation ENUM ENUM_VALUE INPUT_OBJECT +syn keyword graphqlDirectiveLocation INPUT_FIELD_DEFINITION + +syn keyword graphqlMetaFields __schema __type __typename + +syn region graphqlFold matchgroup=graphqlBraces start="{" end="}" transparent fold contains=ALLBUT,graphqlStructure +syn region graphqlList matchgroup=graphqlBraces start="\[" end="]" transparent contains=ALLBUT,graphqlDirective,graphqlStructure + +if main_syntax ==# 'graphql' + syn sync minlines=500 +endif + +hi def link graphqlComment Comment +hi def link graphqlOperator Operator + +hi def link graphqlBraces Delimiter + +hi def link graphqlBoolean Boolean +hi def link graphqlNull Keyword +hi def link graphqlNumber Number +hi def link graphqlString String + +hi def link graphqlDirective PreProc +hi def link graphqlDirectiveLocation Special +hi def link graphqlName Identifier +hi def link graphqlMetaFields Special +hi def link graphqlKeyword Keyword +hi def link graphqlStructure Structure +hi def link graphqlType Type +hi def link graphqlVariable Identifier + +let b:current_syntax = 'graphql' + +if main_syntax ==# 'graphql' + unlet main_syntax +endif diff --git a/runtime/syntax/hyprlang.vim b/runtime/syntax/hyprlang.vim new file mode 100644 index 0000000000..cde504d9ca --- /dev/null +++ b/runtime/syntax/hyprlang.vim @@ -0,0 +1,59 @@ +" Vim syntax file +" Language: hyprlang +" Maintainer: Luca Saccarola <github.e41mv@aleeas.com> +" Last Change: 2025 Jan 29 + +if exists("b:current_syntax") + finish +endif +let b:current_syntax = "hyprlang" + +syn case ignore + +syn match hyprCommand '^\s*\zs\S\+\ze\s*=' contains=hyprVariable +syn match hyprValue '=\s*\zs.\+\ze$' contains=hyprNumber,hyprFloat,hyprBoolean,hyprString,hyprColor,hyprModifier,hyprVariable,hyprComment + +syn match hyprVariable '\$\w\+' contained + +" Category +syn region hyprCategory matchgroup=hyprCategoryD start='^\s*\k\+\s*{' end='^\s*}' contains=hyprCommand,hyprValue,hyprComment,hyprCategory,hyprCategoryD + +" Variables Types +syn match hyprNumber '\%[-+]\<\d\+\>\%[%]' contained +syn match hyprFloat '\%[-+]\<\d\+\.\d\+\>\%[%]' contained +syn match hyprString "'[^']*'" contained +syn match hyprString '"[^"]*"' contained +syn match hyprColor 'rgb(\(\w\|\d\)\{6})' contained +syn match hyprColor 'rgba(\(\w\|\d\)\{8})' contained +syn match hyprColor '0x\(\w\|\d\)\{8}' contained +syn keyword hyprBoolean true false yes no on off contained + +" Super Shift Alt Ctrl Control +syn keyword hyprModifier contained + \ super supershift superalt superctrl supercontrol + \ super_shift super_alt super_ctrl super_control + \ shift shiftsuper shiftalt shiftctrl shiftcontrol + \ shift_super shift_alt shift_ctrl shift_control + \ alt altsuper altshift altctrl altcontrol + \ alt_super alt_shift alt_ctrl alt_control + \ ctrl ctrlsuper ctrlshift ctrlalt ctrlcontrol + \ ctrl_super ctrl_shift ctrl_alt ctrl_control + \ control controlsuper controlshift controlalt controlctrl + \ control_super control_shift control_alt control_ctrl + +" Comments +syn match hyprComment '#.*$' + +" Link to default groups +hi def link hyprVariable Identifier +hi def link hyprCategoryD Special +hi def link hyprComment Comment +hi def link hyprNumber Constant +hi def link hyprModifier Constant +hi def link hyprFloat hyprNumber +hi def link hyprBoolean Boolean +hi def link hyprString String +hi def link hyprColor Structure +hi def link hyprCommand Keyword + +" vim: ts=8 sts=2 sw=2 et diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index b3e17b55f6..9b38ccd4dc 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -3,7 +3,7 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Claudio Fleiner <claudio@fleiner.com> " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Oct 10 +" Last Change: 2025 Jan 02 " Please check ":help java.vim" for comments on some of the options " available. @@ -391,18 +391,32 @@ if !exists("g:java_ignore_javadoc") && (s:with_html || s:with_markdown) && g:mai if s:with_markdown try syntax include @javaMarkdown syntax/markdown.vim - let s:ff.WithMarkdown = s:ff.LeftConstant + + try + syn clear markdownId markdownLineStart markdownH1 markdownH2 markdownHeadingRule markdownRule markdownCode markdownCodeBlock markdownIdDeclaration + let s:ff.WithMarkdown = s:ff.LeftConstant + catch /\<E28:/ + call s:ReportOnce(v:exception) + let s:no_support = 1 + unlet! g:java_ignore_markdown + let g:java_ignore_markdown = 28 + endtry catch /\<E48[45]:/ call s:ReportOnce(v:exception) - unlockvar s:with_markdown - let s:with_markdown = 0 - lockvar s:with_markdown - hi clear markdownCode - hi clear markdownCodeBlock - hi clear markdownCodeDelimiter - hi clear markdownLinkDelimiter + let s:no_support = 1 finally unlet! b:current_syntax + + if exists("s:no_support") + unlet s:no_support + unlockvar s:with_markdown + let s:with_markdown = 0 + lockvar s:with_markdown + hi clear markdownCode + hi clear markdownCodeBlock + hi clear markdownCodeDelimiter + hi clear markdownLinkDelimiter + endif endtry endif @@ -422,7 +436,6 @@ if !exists("g:java_ignore_javadoc") && (s:with_html || s:with_markdown) && g:mai exec 'syn region javaMarkdownCommentTitle contained matchgroup=javaMarkdownComment start="\%(///.*\r\=\n\s*\)\@' . s:ff.Peek('80', '') . '<!///\s*\%({@return\>\)\@=" matchgroup=javaMarkdownCommentTitle end="}\%(\s*\.*\)*" contains=javaMarkdownShortcutLink,@javaMarkdown,javaMarkdownCommentMask,javaTodo,@Spell,@javaDocTags,javaTitleSkipBlock' exec 'syn region javaMarkdownCommentTitle contained matchgroup=javaMarkdownComment start="\%(///.*\r\=\n\s*\)\@' . s:ff.Peek('80', '') . '<!///\s*\%({@summary\>\)\@=" matchgroup=javaMarkdownCommentTitle end="}" contains=javaMarkdownShortcutLink,@javaMarkdown,javaMarkdownCommentMask,javaTodo,@Spell,@javaDocTags,javaTitleSkipBlock' - syn clear markdownId markdownLineStart markdownH1 markdownH2 markdownHeadingRule markdownRule markdownCode markdownCodeBlock markdownIdDeclaration " REDEFINE THE MARKDOWN ITEMS ANCHORED WITH "^", OBSERVING THE " DEFINITION ORDER. syn match markdownLineStart contained "^\s*///\s*[<@]\@!" contains=@markdownBlock,javaMarkdownCommentTitle,javaMarkdownCommentMask nextgroup=@markdownBlock,htmlSpecialChar diff --git a/runtime/syntax/jj.vim b/runtime/syntax/jjdescription.vim index a2911a0268..04848bcb3b 100644 --- a/runtime/syntax/jj.vim +++ b/runtime/syntax/jjdescription.vim @@ -6,7 +6,6 @@ if exists('b:current_syntax') finish endif -let b:current_syntax = 'jj' syn match jjAdded "A .*" contained syn match jjRemoved "D .*" contained @@ -14,7 +13,12 @@ syn match jjChanged "M .*" contained syn region jjComment start="^JJ: " end="$" contains=jjAdded,jjRemoved,jjChanged +syn include @jjCommitDiff syntax/diff.vim +syn region jjCommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@jjCommitDiff + hi def link jjComment Comment hi def link jjAdded Added hi def link jjRemoved Removed hi def link jjChanged Changed + +let b:current_syntax = 'jjdescription' diff --git a/runtime/syntax/just.vim b/runtime/syntax/just.vim new file mode 100644 index 0000000000..79c81d0f9c --- /dev/null +++ b/runtime/syntax/just.vim @@ -0,0 +1,406 @@ +" Vim syntax file +" Language: Justfile +" Maintainer: Peter Benjamin <@pbnj> +" Last Change: 2025 Jan 25 +" Credits: The original author, Noah Bogart <https://github.com/NoahTheDuke/vim-just/> + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +let b:current_syntax = 'just' + +" syncing fromstart prevents mismatched highlighting when jumping around in a justfile +" linebreaks= keeps multi-line constructs highlighted correctly while typing +syn sync fromstart linebreaks=10 + +" a-zA-Z0-9_- +syn iskeyword @,48-57,_,- + +syn match justComment "#.*$" contains=@Spell,justCommentTodo +syn match justCommentInBody '#.*$' contained contains=justCommentTodo,justInterpolation,@justOtherCurlyBraces +syn keyword justCommentTodo TODO FIXME XXX contained +syn match justShebang "^\s*#!.*$" contains=justInterpolation,@justOtherCurlyBraces +syn match justName "\h\k*" contained +syn match justFunction "\h\k*" contained + +syn match justPreBodyComment "\v%(\s|\\\n)*%([^\\]\n)@3<!#%([^!].*)?\n%(\t+| +)@=" transparent contained contains=justComment + \ nextgroup=@justBodies skipnl + +syn region justBacktick start=/`/ end=/`/ +syn region justBacktick start=/```/ end=/```/ +syn region justRawString start=/'/ end=/'/ +syn region justRawString start=/'''/ end=/'''/ +syn region justString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError +syn region justString start=/"""/ skip=/\\\\\|\\"/ end=/"""/ contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError + +syn region justShellExpandRawString start=/\v\k@1<!x'/ end=/'/ + \ contains=justShellExpandVarRaw,justDollarEscape +syn region justShellExpandRawString start=/\v\k@1<!x'''/ end=/'''/ + \ contains=justShellExpandVarRaw,justDollarEscape +syn region justShellExpandString + \ start=/\v\k@1<!x"/ skip=/\\\\\|\\"/ end=/"/ + \ contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError,justShellExpandVar,justDollarEscape,justDollarEscapeSplit +syn region justShellExpandString + \ start=/\v\k@1<!x"""/ skip=/\\\\\|\\"/ end=/"""/ + \ contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError,justShellExpandVar,justDollarEscape,justDollarEscapeSplit + +syn cluster justStringLiterals + \ contains=justRawString,justString,justShellExpandRawString,justShellExpandString +syn cluster justAllStrings contains=justBacktick,@justStringLiterals + +syn match justRegexReplacement + \ /\v,%(\_s|\\\n)*%('\_[^']*'|'''%(\_.%(''')@!)*\_.?''')%(\_s|\\\n)*%(,%(\_s|\\\n)*)?\)/me=e-1 + \ transparent contained contains=@justExpr,@justStringsWithRegexCapture +syn match justRegexReplacement + \ /\v,%(\_s|\\\n)*%("%(\_[^"]|\\")*"|"""%(\_.%(""")@!)*\_.?""")%(\_s|\\\n)*%(,%(\_s|\\\n)*)?\)/me=e-1 + \ transparent contained contains=@justExpr,@justStringsWithRegexCapture + +syn region justRawStrRegexRepl start=/\v'/ end=/'/ contained contains=justRegexCapture,justDollarEscape +syn region justRawStrRegexRepl start=/\v'''/ end=/'''/ contained contains=justRegexCapture,justDollarEscape +syn region justStringRegexRepl start=/\v"/ skip=/\\\\\|\\"/ end=/"/ contained contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError,justRegexCapture,justDollarEscape,justDollarEscapeSplit +syn region justStringRegexRepl start=/\v"""/ skip=/\\\\\|\\"/ end=/"""/ contained contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError,justRegexCapture,justDollarEscape,justDollarEscapeSplit +syn match justRegexCapture '\v\$%(\w+|\{\w+\})' contained +syn cluster justStringsWithRegexCapture contains=justRawStrRegexRepl,justStringRegexRepl + +syn cluster justRawStrings contains=justRawString,justRawStrRegexRepl + +syn region justStringInsideBody start=/\v\\@1<!'/ end=/'/ contained contains=justInterpolation,@justOtherCurlyBraces,justIndentError +syn region justStringInsideBody start=/\v\\@1<!"/ skip=/\v\\@1<!\\"/ end=/"/ contained contains=justInterpolation,@justOtherCurlyBraces,justIndentError +syn region justStringInShebangBody start=/\v\\@1<!'/ end=/'/ contained contains=justInterpolation,@justOtherCurlyBraces,justShebangIndentError +syn region justStringInShebangBody start=/\v\\@1<!"/ skip=/\v\\@1<!\\"/ end=/"/ contained contains=justInterpolation,@justOtherCurlyBraces,justShebangIndentError + +syn match justStringEscapeError '\\.' contained +syn match justStringEscapeSequence '\v\\[tnr"\\]' contained +syn match justStringUEscapeSequence '\v\\u\{[0-9A-Fa-f]{1,6}\}' contained + +syn match justAssignmentOperator "\V:=" contained + +syn region justExprParen start='\V(' end='\V)' transparent contains=@justExpr +syn region justExprParenInInterp start='\V(' end='\V)' transparent contained contains=@justExprInInterp + +syn match justRecipeAt "^@" contained +syn match justRecipeColon ":" contained + +syn region justRecipeAttributes + \ matchgroup=justRecipeAttr start='\v^%(\\\n)@3<!\[' end='\V]' + \ contains=justRecipeAttr,justRecipeAttrSep,justRecipeAttrArgs,justRecipeAttrArgError,justRecipeAttrValueShort + +syn keyword justRecipeAttr + \ confirm doc extension group linux macos no-cd no-exit-message no-quiet openbsd positional-arguments private script unix windows working-directory + \ contained +syn match justRecipeAttrSep ',' contained +syn match justRecipeAttrValueShort '\v:%(\_s|\\\n)*' transparent contained + \ contains=justRecipeAttrValueColon nextgroup=@justStringLiterals,justInvalidAttrValue +syn match justRecipeAttrValueColon '\V:' contained +syn region justRecipeAttrArgs matchgroup=justRecipeAttr start='\V(' end='\V)' contained + \ contains=@justStringLiterals +syn match justRecipeAttrArgError '\v\(%(\s|\\?\n)*\)' contained + +syn match justInvalidAttrValue '\v[^"',]["']@![^,\]]*' contained + +syn match justRecipeDeclSimple "\v^\@?\h\k*%(%(\s|\\\n)*:\=@!)@=" + \ transparent contains=justRecipeName + \ nextgroup=justRecipeNoDeps,justRecipeDeps + +syn region justRecipeDeclComplex start="\v^\@?\h\k*%(\s|\\\n)+%([+*$]+%(\s|\\\n)*)*\h" end="\v%(:\=@!)@=|$" + \ transparent + \ contains=justRecipeName,justParameter + \ nextgroup=justRecipeNoDeps,justRecipeDeps + +syn match justRecipeName "\v^\@?\h\k*" transparent contained contains=justRecipeAt,justFunction + +syn match justParameter "\v%(\s|\\\n)@3<=%(%([*+]%(\s|\\\n)*)?%(\$%(\s|\\\n)*)?|\$%(\s|\\\n)*[*+]%(\s|\\\n)*)\h\k*" + \ transparent contained + \ contains=justName,justVariadicPrefix,justParamExport,justVariadicPrefixError + \ nextgroup=justPreParamValue + +syn match justPreParamValue '\v%(\s|\\\n)*\=%(\s|\\\n)*' + \ contained transparent + \ contains=justParameterOperator + \ nextgroup=justParamValue + +syn region justParamValue contained transparent + \ start="\v\S" + \ skip="\\\n" + \ end="\v%(\s|^)%([*+$:]|\h)@=|:@=|$" + \ contains=@justAllStrings,justRecipeParenDefault,@justExprFunc + \ nextgroup=justParameterError +syn match justParameterOperator "\V=" contained + +syn match justVariadicPrefix "\v%(\s|\\\n)@3<=[*+]%(%(\s|\\\n)*\$?%(\s|\\\n)*\h)@=" contained +syn match justParamExport '\V$' contained +syn match justVariadicPrefixError "\v\$%(\s|\\\n)*[*+]" contained + +syn match justParameterError "\v%(%([+*$]+%(\s|\\\n)*)*\h\k*)@>%(%(\s|\\\n)*\=)@!" contained + +syn region justRecipeParenDefault + \ matchgroup=justRecipeDepParamsParen start='\v%(\=%(\s|\\\n)*)@<=\(' end='\V)' + \ contained + \ contains=@justExpr +syn match justRecipeSubsequentDeps '\V&&' contained + +syn match justRecipeNoDeps '\v:%(\s|\\\n)*\n|:#@=|:%(\s|\\\n)+#@=' + \ transparent contained + \ contains=justRecipeColon + \ nextgroup=justPreBodyComment,@justBodies +syn region justRecipeDeps start="\v:%(\s|\\\n)*%([a-zA-Z_(]|\&\&)" skip='\\\n' end="\v#@=|\\@1<!\n" + \ transparent contained + \ contains=justFunction,justRecipeColon,justRecipeSubsequentDeps,justRecipeParamDep + \ nextgroup=justPreBodyComment,@justBodies + +syn region justRecipeParamDep contained transparent + \ matchgroup=justRecipeDepParamsParen + \ start="\V(" + \ end="\V)" + \ contains=justRecipeDepParenName,@justExpr + +syn keyword justBoolean true false contained + +syn match justAssignment "\v^\h\k*%(\s|\\\n)*:\=" transparent contains=justAssignmentOperator + +syn match justSet '\v^set' contained +syn keyword justSetKeywords + \ allow-duplicate-recipes allow-duplicate-variables dotenv-load dotenv-filename dotenv-path dotenv-required export fallback ignore-comments positional-arguments quiet script-interpreter shell tempdir unstable windows-shell working-directory + \ contained +syn keyword justSetDeprecatedKeywords windows-powershell contained +syn match justBooleanSet "\v^set%(\s|\\\n)+%(allow-duplicate-%(recip|variabl)es|dotenv-%(loa|require)d|export|fallback|ignore-comments|positional-arguments|quiet|unstable|windows-powershell)%(%(\s|\\\n)*:\=%(\s|\\\n)*%(true|false))?%(\s|\\\n)*%($|#@=)" + \ contains=justSet,justSetKeywords,justSetDeprecatedKeywords,justAssignmentOperator,justBoolean + \ transparent + +syn match justStringSet '\v^set%(\s|\\\n)+\k+%(\s|\\\n)*:\=%(\s|\\\n)*%(x?['"])@=' transparent contains=justSet,justSetKeywords,justAssignmentOperator + +syn match justShellSet + \ "\v^set%(\s|\\\n)+%(s%(hell|cript-interpreter)|windows-shell)%(\s|\\\n)*:\=%(\s|\\\n)*\[@=" + \ contains=justSet,justSetKeywords,justAssignmentOperator + \ transparent skipwhite + \ nextgroup=justShellSetValue +syn region justShellSetValue + \ start='\V[' end='\V]' + \ contained + \ contains=@justStringLiterals,justShellSetError + +syn match justShellSetError '\v\k+['"]@!' contained + +syn match justAlias '\v^alias' contained +syn match justAliasDecl "\v^alias%(\s|\\\n)+\h\k*%(\s|\\\n)*:\=%(\s|\\\n)*" + \ transparent + \ contains=justAlias,justFunction,justAssignmentOperator + \ nextgroup=justAliasRes +syn match justAliasRes '\v\h\k*%(\s|\\\n)*%(#@=|$)' contained transparent contains=justFunction + +syn match justExportedAssignment "\v^export%(\s|\\\n)+\h\k*%(\s|\\\n)*:\=" transparent + \ contains=justExport,justAssignmentOperator + +syn match justExport '\v^export' contained + +syn match justUnexportStatement '\v^unexport%(\s|\\\n)+\w+\s*$' contains=justUnexport +syn match justUnexport '\v^unexport' contained + +syn keyword justConditional if else +syn region justConditionalBraces start="\v\{\{@!" end="\v\}@=" transparent contains=@justExpr +syn region justConditionalBracesInInterp start="\v\{\{@!" end="\v\}@=" transparent contained contains=@justExprInInterp + +syn match justLineLeadingSymbol "\v^%(\\\n)@3<!\s+\zs%(\@-|-\@|\@|-)" + +syn match justLineContinuation "\\$" + \ containedin=ALLBUT,justComment,justCommentInBody,justShebang,@justRawStrings,justRecipeAttrArgError,justShellExpandRawDefaultValue + +syn region justBody + \ start=/\v^\z( +|\t+)%(#!)@!\S/ + \ skip='\v\\\n|\n\s*$' + \ end="\v\n\z1@!|%(^\S)@2<=\_.@=" + \ contains=justInterpolation,@justOtherCurlyBraces,justLineLeadingSymbol,justCommentInBody,justStringInsideBody,justIndentError + \ contained + +syn region justShebangBody + \ start="\v^\z( +|\t+)#!" + \ skip='\v\\\n|\n\s*$' + \ end="\v\n\z1@!|%(^\S)@2<=\_.@=" + \ contains=justInterpolation,@justOtherCurlyBraces,justCommentInBody,justShebang,justStringInShebangBody,justShebangIndentError + \ contained + +syn cluster justBodies contains=justBody,justShebangBody + +syn match justIndentError '\v^%(\\\n)@3<!%( +\zs\t|\t+\zs )\s*\S@=' +syn match justShebangIndentError '\v^ +\zs\t\s*\S@=' + +syn region justInterpolation + \ matchgroup=justInterpolationDelim + \ start="\v\{\{\{@!" end="\v%(%(\\\n\s|\S)\s*)@<=\}\}|$" + \ matchgroup=justInterpError end='^\S' + \ contained + \ contains=@justExprInInterp + +syn match justBadCurlyBraces '\v\{{3}\ze[^{]' contained +syn match justCurlyBraces '\v\{{4}' contained +syn match justBadCurlyBraces '\v\{{5}\ze[^{]' contained +syn cluster justOtherCurlyBraces contains=justCurlyBraces,justBadCurlyBraces + +syn match justFunctionCall "\v\w+%(\s|\\\n)*\(@=" transparent contains=justBuiltInFunction + +" error() is intentionally not included in this list +syn keyword justBuiltInFunction + \ absolute_path append arch blake3 blake3_file cache_dir cache_directory canonicalize capitalize choose clean config_dir config_directory config_local_dir config_local_directory data_dir data_directory data_local_dir data_local_directory datetime datetime_utc encode_uri_component env env_var env_var_or_default executable_dir executable_directory extension file_name file_stem home_dir home_directory invocation_dir invocation_dir_native invocation_directory invocation_directory_native is_dependency join just_executable just_pid justfile justfile_dir justfile_directory kebabcase lowercamelcase lowercase module_dir module_directory module_file num_cpus os os_family parent_dir parent_directory path_exists prepend quote replace replace_regex semver_matches sha256 sha256_file shell shoutykebabcase shoutysnakecase snakecase source_dir source_directory source_file style titlecase trim trim_end trim_end_match trim_end_matches trim_start trim_start_match trim_start_matches uppercamelcase uppercase uuid without_extension + \ contained + +syn match justUserDefinedError "\v%(assert|error)%(%(\s|\\\n)*\()@=" + +syn match justReplaceRegex '\vreplace_regex%(\s|\\\n)*\(@=' transparent contains=justBuiltInFunction nextgroup=justReplaceRegexCall +syn match justReplaceRegexInInterp '\vreplace_regex%(\s|\\\n)*\(@=' transparent contained contains=justBuiltInFunction nextgroup=justReplaceRegexCallInInterp + +syn region justReplaceRegexCall + \ matchgroup=justReplaceRegexCall + \ start='\V(' end='\V)' + \ transparent contained + \ contains=@justExpr,justRegexReplacement +syn region justReplaceRegexCallInInterp + \ matchgroup=justReplaceRegexCall + \ start='\V(' end='\V)' + \ transparent contained + \ contains=@justExprInInterp,justRegexReplacement + +syn match justParameterLineContinuation '\v%(\s|\\\n)*' contained nextgroup=justParameterError + +syn match justRecipeDepParenName '\v%(\(\n?)@3<=%(\_s|\\\n)*\h\k*' + \ transparent contained + \ contains=justFunction + +syn cluster justBuiltInFunctions contains=justFunctionCall,justUserDefinedError + +syn match justConditionalOperator "\V==" +syn match justConditionalOperator "\V!=" +syn match justConditionalOperator "\V=~" + +syn match justOperator "\V+" +syn match justOperator "\V/" +syn match justOperator "\V&&" +syn match justOperator "\V||" + +syn keyword justConstant + \ HEX HEXLOWER HEXUPPER + \ CLEAR NORMAL BOLD ITALIC UNDERLINE INVERT HIDE STRIKETHROUGH + \ BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE + \ BG_BLACK BG_RED BG_GREEN BG_YELLOW BG_BLUE BG_MAGENTA BG_CYAN BG_WHITE + +syn match justShellExpandVarRaw '\v\$%(\{\_[^}]*\}|\w+)' contained contains=justShellExpandRawDefaultDelimiter +syn match justShellExpandRawDefaultDelimiter '\V:-' contained nextgroup=justShellExpandRawDefaultValue +syn match justShellExpandRawDefaultValue '\v\_[^}]*' contained +syn match justShellExpandVar '\v\$%(\w|\\\n\s*)+' contained +syn region justShellExpandVar start='\v\$%(\\\n\s*)*\{' end='\V}' contains=justShellExpandDefaultDelimiter,justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError +syn match justShellExpandDefaultDelimiter '\v:%(\\\n\s*)*-@=' contained nextgroup=justShellExpandDefault +syn region justShellExpandDefault + \ matchgroup=justShellExpandDefaultDelimiter start='\V-' end='\v\}@=' + \ contained + \ contains=justStringEscapeSequence,justStringUEscapeSequence,justStringEscapeError + +syn match justDollarEscape '\V$$' contained +syn match justDollarEscapeSplit '\v\$%(\\\n\s*)*\$' contained + +syn cluster justExprBase contains=@justAllStrings,@justBuiltInFunctions,justConditional,justConditionalOperator,justOperator,justConstant +syn cluster justExpr contains=@justExprBase,justExprParen,justConditionalBraces,justReplaceRegex +syn cluster justExprInInterp contains=@justExprBase,justName,justExprParenInInterp,justConditionalBracesInInterp,justReplaceRegexInInterp + +syn cluster justExprFunc contains=@justBuiltInFunctions,justReplaceRegex,justExprParen + +syn match justImport /\v^import%(%(\s|\\\n)*\?|%(\s|\\\n)+%(x?['"])@=)/ transparent + \ contains=justImportStatement,justOptionalFile +syn match justImportStatement '^import' contained + +syn match justOldInclude "^!include" + +syn match justModule /\v^mod%(%(\s|\\\n)*\?)?%(\s|\\\n)+\h\k*\s*%($|%(\s|\\\n)*%(x?['"]|#)@=)/ + \ transparent contains=justModStatement,justName,justOptionalFile +syn match justModStatement '^mod' contained + +syn match justOptionalFile '\V?' contained + +" Most linked colorscheme colors are chosen based on semantics of the color name. +" Some are for parity with other syntax files (for example, Number for recipe body highlighting +" is to align with the make.vim distributed with Vim). +" Deprecated `just` syntaxes are highlighted as Underlined. +" +" Colors are linked 'def'(ault) so that users who prefer other colors +" can override them, e.g. in ~/.vim/after/syntax/just.vim +" +" Note that vim-just's highlight groups are an implementation detail and may be subject to change. + +" The list of highlight links is sorted alphabetically. + +hi def link justAlias Statement +hi def link justAssignmentOperator Operator +hi def link justBacktick Special +hi def link justBadCurlyBraces Error +hi def link justBody Number +hi def link justBoolean Boolean +hi def link justBuiltInFunction Function +hi def link justComment Comment +hi def link justCommentInBody Comment +hi def link justCommentTodo Todo +hi def link justConditional Conditional +hi def link justConditionalOperator Conditional +hi def link justConstant Constant +hi def link justCurlyBraces Special +hi def link justDollarEscape Special +hi def link justDollarEscapeSplit Special +hi def link justExport Statement +hi def link justFunction Function +hi def link justImportStatement Include +hi def link justIndentError Error +hi def link justInterpError Error +hi def link justInterpolation Normal +hi def link justInterpolationDelim Delimiter +hi def link justInvalidAttrValue Error +hi def link justLineContinuation Special +hi def link justLineLeadingSymbol Special +hi def link justModStatement Keyword +hi def link justName Identifier +hi def link justOldInclude Error +hi def link justOperator Operator +hi def link justOptionalFile Conditional +hi def link justParameterError Error +hi def link justParameterOperator Operator +hi def link justParamExport Statement +hi def link justRawString String +hi def link justRawStrRegexRepl String +hi def link justRecipeAt Special +hi def link justRecipeAttr Type +hi def link justRecipeAttrArgError Error +hi def link justRecipeAttrSep Operator +hi def link justRecipeAttrValueColon Operator +hi def link justRecipeColon Operator +hi def link justRecipeDepParamsParen Delimiter +hi def link justRecipeSubsequentDeps Delimiter +hi def link justRegexCapture Identifier +hi def link justSet Statement +hi def link justSetDeprecatedKeywords Underlined +hi def link justSetKeywords Keyword +hi def link justShebang SpecialComment +hi def link justShebangBody Number +hi def link justShebangIndentError Error +hi def link justShellExpandDefault Character +hi def link justShellExpandDefaultDelimiter Operator +hi def link justShellExpandRawDefaultDelimiter Operator +hi def link justShellExpandRawDefaultValue Character +hi def link justShellExpandRawString String +hi def link justShellExpandString String +hi def link justShellExpandVar PreProc +hi def link justShellExpandVarRaw PreProc +hi def link justShellSetError Error +hi def link justString String +hi def link justStringEscapeError Error +hi def link justStringEscapeSequence Special +hi def link justStringInShebangBody String +hi def link justStringInsideBody String +hi def link justStringRegexRepl String +hi def link justStringUEscapeSequence Special +hi def link justUnexport Statement +hi def link justUserDefinedError Exception +hi def link justVariadicPrefix Statement +hi def link justVariadicPrefixError Error + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/karel.vim b/runtime/syntax/karel.vim new file mode 100644 index 0000000000..85c78529e6 --- /dev/null +++ b/runtime/syntax/karel.vim @@ -0,0 +1,112 @@ +" Vim syntax file +" Language: KAREL +" Last Change: 2024-11-17 +" Maintainer: Kirill Morozov <kirill@robotix.pro> +" Credits: Jay Strybis for the initial implementation and Patrick Knosowski +" for a couple of fixes. + +if exists("b:current_syntax") + finish +endif + +" KAREL is case-insensitive +syntax case ignore + +" Identifiers +syn match karelIdentifier /[a-zA-Z0-9_]\+/ +hi def link karelIdentifier Identifier + +" Constants +syn keyword karelConstant CR +syn region karelString start="'" end="'" +syn match karelReal /\d\+\.\d\+/ +syn match karelInteger /\d\+/ +syn keyword karelBoolean true false +hi def link karelConstant Constant +hi def link karelString String +hi def link karelInteger Number +hi def link karelReal Float +hi def link karelBoolean Boolean + +" Directives +syn match karelDirective /%[a-zA-Z]\+/ +hi def link karelDirective PreProc + +" Operators +syn keyword karelOperator AND OR NOT DIV MOD +syn match karelOperator /[\+\-\*\/\<\=\>\:\#\@]/ +syn match karelOperator /<=/ +syn match karelOperator />=/ +syn match karelOperator /<>/ +syn match karelOperator />=</ +hi def link karelOperator Operator + +" Types +syn keyword karelType ARRAY BOOLEAN BYTE CONFIG DISP_DAT_T FILE INTEGER JOINTPOS PATH POSITION QUEUE_TYPE REAL SHORT STD_PTH_NODE STRING VECTOR XYZWPR XYZWPREXT +syn keyword karelStructure STRUCTURE ENDSTRUCTURE +hi def link karelType Type +hi def link karelStructure Typedef + +syn keyword karelAction NOABORT NOMESSAGE NOPAUSE PAUSE PULSE RESUME STOP UNHOLD UNPAUSE +syn match karelAction /SIGNAL EVENT/ +syn match karelAction /SIGNAL SEMAPHORE/ +hi def link karelAction Keyword + +syn keyword karelFunction ABS ACOS APPROACH ARRAY_LEN ASIN ATAN2 ATTACH BYNAME BYTES_LEFT CHR COS CURJPOS CURPOS CURR_PROG EXP +syn keyword karelFunction FRAME GET_FILE_POS GET_JPOS_REG GET_JPOS_TPE GET_PORT_ATR GET_POS_REG GET_POS_TPE GET_USEC_TIM INDEX +syn keyword karelFunction IN_RANGE INV IO_STATUS J_IN_RANGE JOINT2POS LN MIRROR MOTION_CTL NODE_SIZE ORD ORIENT PATH_LEN POS POS2JOINT +syn keyword karelFunction ROUND SEMA_COUNT SIN SQRT STR_LEN SUB_STR TAN TRUNC UNINIT +hi def link karelFunction Function + +syn keyword karelClause EVAL FROM IN WHEN WITH +hi def link karelClause Keyword + +syn keyword karelConditional IF THEN ELSE ENDIF SELECT ENDSELECT CASE +hi def link karelConditional Conditional + +syn keyword karelRepeat WHILE DO ENDWHILE FOR +hi def link karelRepeat Repeat + +syn keyword karelProcedure ABORT_TASK ACT_SCREEN ACT_TBL ADD_BYNAMEPC ADD_DICT ADD_INTPC ADD_REALPC ADD_STRINGPC APPEND_NODE APPEND_QUEUE +syn keyword karelProcedure ATT_WINDOW_D ATT_WINDOW_S AVL_POS_NUM +syn keyword karelProcedure BYTES_AHEAD +syn keyword karelProcedure CALL_PROG CALL_PROGLIN CHECK_DICT CHECK_EPOS CHECK_NAME CLEAR CLEAR_SEMA CLOSE_TEP CLR_IO_STAT CLR_PORT_SIM CLR_POS_REG +syn keyword karelProcedure CNC_DYN_DISB CNC_DYN_DISE CNC_DYN_DISI CNC_DYN_DISP CNC_DYN_DISR CNC_DYN_DISS CNCL_STP_MTN CNV_CNF_STRG CNV_CONF_STR CNV_INT_STR CNV_JPOS_REL CNV_REAL_STR CNV_REL_JPOS CNV_STR_CONF CNV_STR_INT CNV_STR_REAL CNV_STR_TIME CNV_TIME_STR +syn keyword karelProcedure COMPARE_FILE CONT_TASK COPY_FILE COPY_PATH COPY_QUEUE COPY_TPE CREATE_TPE CREATE_VAR +syn keyword karelProcedure DAQ_CHECKP DAQ_REGPIPE DAQ_START DAQ_STOP DAQ_UNREG DAQ_WRITE DEF_SCREEN DEF_WINDOW +syn keyword karelProcedure DELETE_FILE DELETE_NODE DELETE_QUEUE DEL_INST_TPE DET_WINDOW DISCTRL_ALPH DISCTRL_FORM DISCTRL_LIST DISCTRL_PLMN DISCTRL_SBMN DISCTRL_TBL DISMOUNT_DEV DOSFILE_INF +syn keyword karelProcedure ERR_DATA FILE_LIST FORCE_SPMENU FORMAT_DEV GET_ATTR_PRG GET_PORT_ASG GET_PORT_CMT GET_PORT_MOD GET_PORT_SIM GET_PORT_VAL GET_POS_FRM GET_POS_TYP GET_PREG_CMT GET_QUEUE +syn keyword karelProcedure GET_REG GET_REG_CMT GET_SREG_CMT GET_STR_REG GET_TIME GET_TPE_CMT GET_TPE_PRM GET_TSK_INFO GET_USEC_SUB GET_VAR +syn keyword karelProcedure INI_DYN_DISB INI_DYN_DISE INI_DYN_DISI INI_DYN_DISP INI_DYN_DISR INI_DYN_DISS INIT_QUEUE INIT_TBL INSERT_NODE INSERT_QUEUE IO_MOD_TYPE +syn keyword karelProcedure KCL KCL_NO_WAIT KCL_STATUS LOAD LOAD_STATUS LOCK_GROUP MODIFY_QUEUE MOUNT_DEV MOVE_FILE MSG_CONNECT MSG_DISO MSG_PING +syn keyword karelProcedure OPEN_TPE PAUSE_TASK PEND_SEMA PIPE_CONFIG POP_KEY_RD POS_REG_TYPE POST_ERR POST_ERR_L POST_SEMA PRINT_FILE PROG_BACKUP PROG_CLEAR PROG_RESTORE PROG_LIST +syn keyword karelProcedure PURGE_DEV PUSH_KEY_RD READ_DICT READ_DICT_V READ_KB REMOVE_DICT RENAME_FILE RENAME_VAR RENAME_VARS RESET RUN_TASK SAVE SAVE_DRAM SELECT_TPE SEND_DATAPC SEND_EVENTPC SET_ATTR_PRG SET_CURSOR SET_EPOS_REG SET_EPOS_TPE +syn keyword karelProcedure SET_FILE_ATR SET_FILE_POS SET_INT_REG SET_JPOS_REG SET_JPOS_TPE SET_LANG SET_PERCH SET_PORT_ASG SET_PORT_ATR SET_PORT_CMT SET_PORT_MOD SET_PORT_SIM SET_PORT_VAL SET_POS_REG SET_POS_TPE SET_PREG_CMT SET_REAL_REG SET_REG CMT SET_SREG_CMT SET_STR_REG SET_TIME SET_TPE_CMT SET_TRNS_TPE SET_TSK_ATTR SET_TSK_NAME SET_VAR +syn keyword karelProcedure TRANSLATE UNLOCK_GROUP UNPOS V_CAM_CALIB V_GET_OFFSET V_GET_PASSFL V_GET_QUEUE V_INIT_QUEUE V_RALC_QUEUE V_RUN_FIND V_SET_REF V_START_VTRK V_STOP_VTRK VAR_INFO VAR_LIST VOL_SPACE VREG_FND_POS VREG_OFFSET +syn keyword karelProcedure WRITE_DICT WRITE_DICT_V XML_ADDTAG XML_GETDATA XML_REMTAG XML_SCAN XML_SETVAR +hi def link karelProcedure Function + +syn keyword karelStatement ABORT CONDITION ENDCONDITION CONTINUE DELAY ERROR EVENT FOR ENDFOR HOLD READ RELEASE REPEAT RETURN SEMAPHORE UNTIL USING ENDUSING WRITE +syn match karelStatement /CANCEL FILE/ +syn match karelStatement /CLOSE FILE/ +syn match karelStatement /CLOSE HAND/ +syn match karelStatement /CONNECT TIMER/ +syn match karelStatement /DISABLE CONDITION/ +syn match karelStatement /DISCONNECT TIMER/ +syn match karelStatement /ENABLE CONDITION/ +syn match karelStatement /GO TO/ +syn match karelStatement /OPEN FILE/ +syn match karelStatement /OPEN HAND/ +syn match karelStatement /PURGE CONDITION/ +syn match karelStatement /RELAX HAND/ +syn match karelStatement /WAIT FOR/ +hi def link karelStatement Statement + +syn keyword karelKeyword BEGIN CONST END PROGRAM ROUTINE STRUCT TYPE VAR +hi def link karelKeyword Keyword + +" Comments +syn region karelComment start="--" end="$" +hi def link karelComment Comment + +let b:current_syntax = "karel" diff --git a/runtime/syntax/kconfig.vim b/runtime/syntax/kconfig.vim index 0aecc00060..64a47a5995 100644 --- a/runtime/syntax/kconfig.vim +++ b/runtime/syntax/kconfig.vim @@ -1,7 +1,7 @@ " Vim syntax file " Maintainer: Christian Brabandt <cb@256bit.org> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2024-07-19 +" Latest Revision: 2025 Jan 20 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig @@ -12,722 +12,722 @@ endif let s:cpo_save = &cpo set cpo&vim +exe "syn sync minlines=" . get(g:, 'kconfig_minlines', 50) + if exists("g:kconfig_syntax_heavy") -syn match kconfigBegin '^' nextgroup=kconfigKeyword - \ skipwhite - -syn keyword kconfigTodo contained TODO FIXME XXX NOTE - -syn match kconfigComment display '#.*$' contains=kconfigTodo - -syn keyword kconfigKeyword config nextgroup=kconfigSymbol - \ skipwhite - -syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol - \ skipwhite - -syn keyword kconfigKeyword comment menu mainmenu - \ nextgroup=kconfigKeywordPrompt - \ skipwhite - -syn keyword kconfigKeyword choice - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigKeyword endmenu endchoice - -syn keyword kconfigPreProc source - \ nextgroup=kconfigPath - \ skipwhite - -" TODO: This is a hack. The who .*Expr stuff should really be generated so -" that we can reuse it for various nextgroups. -syn keyword kconfigConditional if endif - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' - \ contained - -syn match kconfigSymbol '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -" FIXME: There is – probably – no reason to cluster these instead of just -" defining them in the same group. -syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, - \ kconfigInputPrompt, - \ kconfigDefaultValue, - \ kconfigDependencies, - \ kconfigReverseDependencies, - \ kconfigNumericalRanges, - \ kconfigHelpText, - \ kconfigDefBool, - \ kconfigOptional - -syn keyword kconfigTypeDefinition bool boolean tristate string hex int - \ contained - \ nextgroup=kconfigTypeDefPrompt, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigInputPrompt prompt - \ contained - \ nextgroup=kconfigPromptPrompt - \ skipwhite - -syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigDefaultValue default - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigDependencies 'depends on\|requires' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn keyword kconfigReverseDependencies select - \ contained - \ nextgroup=@kconfigRevDepSymbol - \ skipwhite - -syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, - \ kconfigRevDepNCSymbol - -syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRevDepNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigNumericalRanges range - \ contained - \ nextgroup=@kconfigRangeSymbol - \ skipwhite - -syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, - \ kconfigRangeNCSymbol - -syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn match kconfigRangeNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, - \ kconfigRangeNCSymbol2 - -syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRangeNCSymbol2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn region kconfigHelpText contained - \ matchgroup=kconfigConfigOption - \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' - \ skip='^$' - \ end='^\z1\@!' - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -" XXX: Undocumented -syn keyword kconfigDefBool def_bool - \ contained - \ nextgroup=@kconfigDefBoolSymbol - \ skipwhite - -syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, - \ kconfigDefBoolNCSymbol - -syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigDefBoolNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -" XXX: This is actually only a valid option for “choice”, but treating it -" specially would require a lot of extra groups. -syn keyword kconfigOptional optional - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigConfigOptionIf if - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, - \ kconfigConfOptIfExprNeg, - \ kconfigConfOptIfExprGroup - -syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, - \ kconfigConfOptIfExprNCSym - -syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNCSym '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, - \ kconfigConfOptIfExprNCSym2 - -syn match kconfigConfOptIfExprEq '=' - \ contained - \ nextgroup=@kconfigConfOptIfExprSym2 - \ skipwhite - -syn match kconfigConfOptIfExprNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptIfExprSym2 - \ skipwhite - -syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprGroup '(' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -" TODO: hm, this kind of recursion doesn't work right. We need another set of -" expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher -" for '(' that sets it all off. -syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, - \ kconfigConfOptIfGExpNeg, - \ kconfigConfOptIfExprGroup - -syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, - \ kconfigConfOptIfGExpNCSym - -syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigIf, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigIf, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, - \ kconfigConfOptIfGExpNCSym2 - -syn match kconfigConfOptIfGExpEq '=' - \ contained - \ nextgroup=@kconfigConfOptIfGExpSym2 - \ skipwhite - -syn match kconfigConfOptIfGExpNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptIfGExpSym2 - \ skipwhite - -syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfGExpAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfGExpOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfExprGrpE ')' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - - -syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, - \ kconfigConfOptExprNeg, - \ kconfigConfOptExprGroup - -syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, - \ kconfigConfOptExprNCSym - -syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, - \ kconfigConfOptExprNCSym2 - -syn match kconfigConfOptExprEq '=' - \ contained - \ nextgroup=@kconfigConfOptExprSym2 - \ skipwhite - -syn match kconfigConfOptExprNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptExprSym2 - \ skipwhite - -syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprGroup '(' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, - \ kconfigConfOptGExpNeg, - \ kconfigConfOptGExpGroup - -syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, - \ kconfigConfOptGExpNCSym - -syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptGExpNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, - \ kconfigConfOptGExpNCSym2 - -syn match kconfigConfOptGExpEq '=' - \ contained - \ nextgroup=@kconfigConfOptGExpSym2 - \ skipwhite - -syn match kconfigConfOptGExpNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptGExpSym2 - \ skipwhite - -syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptGExpAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptGExpOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptExprGrpE ')' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr - \ skipwhite skipnl - -syn sync minlines=50 - -hi def link kconfigTodo Todo -hi def link kconfigComment Comment -hi def link kconfigKeyword Keyword -hi def link kconfigPreProc PreProc -hi def link kconfigConditional Conditional -hi def link kconfigPrompt String -hi def link kconfigKeywordPrompt kconfigPrompt -hi def link kconfigPath String -hi def link kconfigSymbol String -hi def link kconfigConstantSymbol Constant -hi def link kconfigConfigOption Type -hi def link kconfigTypeDefinition kconfigConfigOption -hi def link kconfigTypeDefPrompt kconfigPrompt -hi def link kconfigInputPrompt kconfigConfigOption -hi def link kconfigPromptPrompt kconfigPrompt -hi def link kconfigDefaultValue kconfigConfigOption -hi def link kconfigDependencies kconfigConfigOption -hi def link kconfigReverseDependencies kconfigConfigOption -hi def link kconfigRevDepCSymbol kconfigConstantSymbol -hi def link kconfigRevDepNCSymbol kconfigSymbol -hi def link kconfigNumericalRanges kconfigConfigOption -hi def link kconfigRangeCSymbol kconfigConstantSymbol -hi def link kconfigRangeNCSymbol kconfigSymbol -hi def link kconfigRangeCSymbol2 kconfigConstantSymbol -hi def link kconfigRangeNCSymbol2 kconfigSymbol -hi def link kconfigHelpText Normal -hi def link kconfigDefBool kconfigConfigOption -hi def link kconfigDefBoolCSymbol kconfigConstantSymbol -hi def link kconfigDefBoolNCSymbol kconfigSymbol -hi def link kconfigOptional kconfigConfigOption -hi def link kconfigConfigOptionIf Conditional -hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol -hi def link kconfigConfOptIfExprNCSym kconfigSymbol -hi def link kconfigOperator Operator -hi def link kconfigConfOptIfExprEq kconfigOperator -hi def link kconfigConfOptIfExprNEq kconfigOperator -hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol -hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol -hi def link kconfigConfOptIfExprNeg kconfigOperator -hi def link kconfigConfOptIfExprAnd kconfigOperator -hi def link kconfigConfOptIfExprOr kconfigOperator -hi def link kconfigDelimiter Delimiter -hi def link kconfigConfOptIfExprGroup kconfigDelimiter -hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol -hi def link kconfigConfOptIfGExpNCSym kconfigSymbol -hi def link kconfigConfOptIfGExpEq kconfigOperator -hi def link kconfigConfOptIfGExpNEq kconfigOperator -hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol -hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol -hi def link kconfigConfOptIfGExpNeg kconfigOperator -hi def link kconfigConfOptIfGExpAnd kconfigOperator -hi def link kconfigConfOptIfGExpOr kconfigOperator -hi def link kconfigConfOptIfExprGrpE kconfigDelimiter -hi def link kconfigConfOptExprCSym kconfigConstantSymbol -hi def link kconfigConfOptExprNCSym kconfigSymbol -hi def link kconfigConfOptExprEq kconfigOperator -hi def link kconfigConfOptExprNEq kconfigOperator -hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol -hi def link kconfigConfOptExprNCSym2 kconfigSymbol -hi def link kconfigConfOptExprNeg kconfigOperator -hi def link kconfigConfOptExprAnd kconfigOperator -hi def link kconfigConfOptExprOr kconfigOperator -hi def link kconfigConfOptExprGroup kconfigDelimiter -hi def link kconfigConfOptGExpCSym kconfigConstantSymbol -hi def link kconfigConfOptGExpNCSym kconfigSymbol -hi def link kconfigConfOptGExpEq kconfigOperator -hi def link kconfigConfOptGExpNEq kconfigOperator -hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol -hi def link kconfigConfOptGExpNCSym2 kconfigSymbol -hi def link kconfigConfOptGExpNeg kconfigOperator -hi def link kconfigConfOptGExpAnd kconfigOperator -hi def link kconfigConfOptGExpOr kconfigOperator -hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup + syn match kconfigBegin '^' nextgroup=kconfigKeyword + \ skipwhite + + syn keyword kconfigTodo contained TODO FIXME XXX NOTE + + syn match kconfigComment display '#.*$' contains=kconfigTodo + + syn keyword kconfigKeyword config nextgroup=kconfigSymbol + \ skipwhite + + syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol + \ skipwhite + + syn keyword kconfigKeyword comment menu mainmenu + \ nextgroup=kconfigKeywordPrompt + \ skipwhite + + syn keyword kconfigKeyword choice + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigKeyword endmenu endchoice + + syn keyword kconfigPreProc source + \ nextgroup=kconfigPath + \ skipwhite + + " TODO: This is a hack. The who .*Expr stuff should really be generated so + " that we can reuse it for various nextgroups. + syn keyword kconfigConditional if endif + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' + \ contained + + syn match kconfigSymbol '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + " FIXME: There is – probably – no reason to cluster these instead of just + " defining them in the same group. + syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, + \ kconfigInputPrompt, + \ kconfigDefaultValue, + \ kconfigDependencies, + \ kconfigReverseDependencies, + \ kconfigNumericalRanges, + \ kconfigHelpText, + \ kconfigDefBool, + \ kconfigOptional + + syn keyword kconfigTypeDefinition bool boolean tristate string hex int + \ contained + \ nextgroup=kconfigTypeDefPrompt, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigInputPrompt prompt + \ contained + \ nextgroup=kconfigPromptPrompt + \ skipwhite + + syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigDefaultValue default + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigDependencies 'depends on\|requires' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn keyword kconfigReverseDependencies select + \ contained + \ nextgroup=@kconfigRevDepSymbol + \ skipwhite + + syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, + \ kconfigRevDepNCSymbol + + syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRevDepNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigNumericalRanges range + \ contained + \ nextgroup=@kconfigRangeSymbol + \ skipwhite + + syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, + \ kconfigRangeNCSymbol + + syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn match kconfigRangeNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, + \ kconfigRangeNCSymbol2 + + syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRangeNCSymbol2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn region kconfigHelpText contained + \ matchgroup=kconfigConfigOption + \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' + \ skip='^$' + \ end='^\z1\@!' + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + " XXX: Undocumented + syn keyword kconfigDefBool def_bool + \ contained + \ nextgroup=@kconfigDefBoolSymbol + \ skipwhite + + syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, + \ kconfigDefBoolNCSymbol + + syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigDefBoolNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + " XXX: This is actually only a valid option for “choice”, but treating it + " specially would require a lot of extra groups. + syn keyword kconfigOptional optional + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigConfigOptionIf if + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, + \ kconfigConfOptIfExprNeg, + \ kconfigConfOptIfExprGroup + + syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, + \ kconfigConfOptIfExprNCSym + + syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNCSym '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, + \ kconfigConfOptIfExprNCSym2 + + syn match kconfigConfOptIfExprEq '=' + \ contained + \ nextgroup=@kconfigConfOptIfExprSym2 + \ skipwhite + + syn match kconfigConfOptIfExprNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptIfExprSym2 + \ skipwhite + + syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprGroup '(' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + " TODO: hm, this kind of recursion doesn't work right. We need another set of + " expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher + " for '(' that sets it all off. + syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, + \ kconfigConfOptIfGExpNeg, + \ kconfigConfOptIfExprGroup + + syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, + \ kconfigConfOptIfGExpNCSym + + syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigIf, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigIf, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, + \ kconfigConfOptIfGExpNCSym2 + + syn match kconfigConfOptIfGExpEq '=' + \ contained + \ nextgroup=@kconfigConfOptIfGExpSym2 + \ skipwhite + + syn match kconfigConfOptIfGExpNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptIfGExpSym2 + \ skipwhite + + syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfGExpAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfGExpOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfExprGrpE ')' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + + syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, + \ kconfigConfOptExprNeg, + \ kconfigConfOptExprGroup + + syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, + \ kconfigConfOptExprNCSym + + syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, + \ kconfigConfOptExprNCSym2 + + syn match kconfigConfOptExprEq '=' + \ contained + \ nextgroup=@kconfigConfOptExprSym2 + \ skipwhite + + syn match kconfigConfOptExprNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptExprSym2 + \ skipwhite + + syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprGroup '(' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, + \ kconfigConfOptGExpNeg, + \ kconfigConfOptGExpGroup + + syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, + \ kconfigConfOptGExpNCSym + + syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptGExpNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, + \ kconfigConfOptGExpNCSym2 + + syn match kconfigConfOptGExpEq '=' + \ contained + \ nextgroup=@kconfigConfOptGExpSym2 + \ skipwhite + + syn match kconfigConfOptGExpNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptGExpSym2 + \ skipwhite + + syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptGExpAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptGExpOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptExprGrpE ')' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr + \ skipwhite skipnl + + hi def link kconfigTodo Todo + hi def link kconfigComment Comment + hi def link kconfigKeyword Keyword + hi def link kconfigPreProc PreProc + hi def link kconfigConditional Conditional + hi def link kconfigPrompt String + hi def link kconfigKeywordPrompt kconfigPrompt + hi def link kconfigPath String + hi def link kconfigSymbol String + hi def link kconfigConstantSymbol Constant + hi def link kconfigConfigOption Type + hi def link kconfigTypeDefinition kconfigConfigOption + hi def link kconfigTypeDefPrompt kconfigPrompt + hi def link kconfigInputPrompt kconfigConfigOption + hi def link kconfigPromptPrompt kconfigPrompt + hi def link kconfigDefaultValue kconfigConfigOption + hi def link kconfigDependencies kconfigConfigOption + hi def link kconfigReverseDependencies kconfigConfigOption + hi def link kconfigRevDepCSymbol kconfigConstantSymbol + hi def link kconfigRevDepNCSymbol kconfigSymbol + hi def link kconfigNumericalRanges kconfigConfigOption + hi def link kconfigRangeCSymbol kconfigConstantSymbol + hi def link kconfigRangeNCSymbol kconfigSymbol + hi def link kconfigRangeCSymbol2 kconfigConstantSymbol + hi def link kconfigRangeNCSymbol2 kconfigSymbol + hi def link kconfigHelpText Normal + hi def link kconfigDefBool kconfigConfigOption + hi def link kconfigDefBoolCSymbol kconfigConstantSymbol + hi def link kconfigDefBoolNCSymbol kconfigSymbol + hi def link kconfigOptional kconfigConfigOption + hi def link kconfigConfigOptionIf Conditional + hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol + hi def link kconfigConfOptIfExprNCSym kconfigSymbol + hi def link kconfigOperator Operator + hi def link kconfigConfOptIfExprEq kconfigOperator + hi def link kconfigConfOptIfExprNEq kconfigOperator + hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol + hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol + hi def link kconfigConfOptIfExprNeg kconfigOperator + hi def link kconfigConfOptIfExprAnd kconfigOperator + hi def link kconfigConfOptIfExprOr kconfigOperator + hi def link kconfigDelimiter Delimiter + hi def link kconfigConfOptIfExprGroup kconfigDelimiter + hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol + hi def link kconfigConfOptIfGExpNCSym kconfigSymbol + hi def link kconfigConfOptIfGExpEq kconfigOperator + hi def link kconfigConfOptIfGExpNEq kconfigOperator + hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol + hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol + hi def link kconfigConfOptIfGExpNeg kconfigOperator + hi def link kconfigConfOptIfGExpAnd kconfigOperator + hi def link kconfigConfOptIfGExpOr kconfigOperator + hi def link kconfigConfOptIfExprGrpE kconfigDelimiter + hi def link kconfigConfOptExprCSym kconfigConstantSymbol + hi def link kconfigConfOptExprNCSym kconfigSymbol + hi def link kconfigConfOptExprEq kconfigOperator + hi def link kconfigConfOptExprNEq kconfigOperator + hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol + hi def link kconfigConfOptExprNCSym2 kconfigSymbol + hi def link kconfigConfOptExprNeg kconfigOperator + hi def link kconfigConfOptExprAnd kconfigOperator + hi def link kconfigConfOptExprOr kconfigOperator + hi def link kconfigConfOptExprGroup kconfigDelimiter + hi def link kconfigConfOptGExpCSym kconfigConstantSymbol + hi def link kconfigConfOptGExpNCSym kconfigSymbol + hi def link kconfigConfOptGExpEq kconfigOperator + hi def link kconfigConfOptGExpNEq kconfigOperator + hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol + hi def link kconfigConfOptGExpNCSym2 kconfigSymbol + hi def link kconfigConfOptGExpNeg kconfigOperator + hi def link kconfigConfOptGExpAnd kconfigOperator + hi def link kconfigConfOptGExpOr kconfigOperator + hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup else -syn keyword kconfigTodo contained TODO FIXME XXX NOTE + syn keyword kconfigTodo contained TODO FIXME XXX NOTE -syn match kconfigComment display '#.*$' contains=kconfigTodo + syn match kconfigComment display '#.*$' contains=kconfigTodo -syn keyword kconfigKeyword config menuconfig comment mainmenu + syn keyword kconfigKeyword config menuconfig comment mainmenu -syn keyword kconfigConditional menu endmenu choice endchoice if endif + syn keyword kconfigConditional menu endmenu choice endchoice if endif -syn keyword kconfigPreProc source - \ nextgroup=kconfigPath - \ skipwhite + syn keyword kconfigPreProc source + \ nextgroup=kconfigPath + \ skipwhite -syn keyword kconfigTriState y m n + syn keyword kconfigTriState y m n -syn match kconfigSpecialChar contained '\\.' -syn match kconfigSpecialChar '\\$' + syn match kconfigSpecialChar contained '\\.' + syn match kconfigSpecialChar '\\$' -syn region kconfigPath matchgroup=kconfigPath - \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ - \ contains=kconfigSpecialChar + syn region kconfigPath matchgroup=kconfigPath + \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ + \ contains=kconfigSpecialChar -syn region kconfigPath matchgroup=kconfigPath - \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ - \ contains=kconfigSpecialChar + syn region kconfigPath matchgroup=kconfigPath + \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ + \ contains=kconfigSpecialChar -syn match kconfigPath '\S\+' - \ contained + syn match kconfigPath '\S\+' + \ contained -syn region kconfigString matchgroup=kconfigString - \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ - \ contains=kconfigSpecialChar + syn region kconfigString matchgroup=kconfigString + \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ + \ contains=kconfigSpecialChar -syn region kconfigString matchgroup=kconfigString - \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ - \ contains=kconfigSpecialChar + syn region kconfigString matchgroup=kconfigString + \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ + \ contains=kconfigSpecialChar -syn keyword kconfigType bool boolean tristate string hex int + syn keyword kconfigType bool boolean tristate string hex int -syn keyword kconfigOption prompt default requires select range - \ optional -syn match kconfigOption 'depends\%( on\)\=' + syn keyword kconfigOption prompt default requires select range + \ optional + syn match kconfigOption 'depends\%( on\)\=' -syn keyword kconfigMacro def_bool def_tristate + syn keyword kconfigMacro def_bool def_tristate -syn region kconfigHelpText - \ matchgroup=kconfigOption - \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' - \ skip='^$' - \ end='^\z1\@!' + syn region kconfigHelpText + \ matchgroup=kconfigOption + \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' + \ skip='^$' + \ end='^\z1\@!' -hi def link kconfigTodo Todo -hi def link kconfigComment Comment -hi def link kconfigKeyword Keyword -hi def link kconfigConditional Conditional -hi def link kconfigPreProc PreProc -hi def link kconfigTriState Boolean -hi def link kconfigSpecialChar SpecialChar -hi def link kconfigPath String -hi def link kconfigString String -hi def link kconfigType Type -hi def link kconfigOption Identifier -hi def link kconfigHelpText Normal -hi def link kconfigmacro Macro + hi def link kconfigTodo Todo + hi def link kconfigComment Comment + hi def link kconfigKeyword Keyword + hi def link kconfigConditional Conditional + hi def link kconfigPreProc PreProc + hi def link kconfigTriState Boolean + hi def link kconfigSpecialChar SpecialChar + hi def link kconfigPath String + hi def link kconfigString String + hi def link kconfigType Type + hi def link kconfigOption Identifier + hi def link kconfigHelpText Normal + hi def link kconfigmacro Macro endif diff --git a/runtime/syntax/lnk.vim b/runtime/syntax/lnk.vim new file mode 100644 index 0000000000..45ca382aca --- /dev/null +++ b/runtime/syntax/lnk.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: TI linker command file +" Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html +" Document: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Last Change: 2024 Dec 31 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/cmacro.vim + +syn case ignore +syn match lnkNumber "0x[0-9a-f]\+" +" Linker command files are ASCII files that contain one or more of the following: +" Input filenames, which specify object files, archive libraries, or other command files. +" Linker options, which can be used in the command file in the same manner that they are used on the command line +syn match lnkOption "^[-+][-_a-zA-Z#@]\+" +syn match lnkOption "^--[^ \t$=`'"|);]\+" +syn match lnkFile '[^ =]\+\%(\.\S\+\)\+\>' +syn match lnkLibFile '[^ =]\+\.lib\>' +" The MEMORY and SECTIONS linker directives. The MEMORY directive defines the target memory configuration (see Section 8.5.4). The SECTIONS directive controls how sections are built and allocated (see Section 8.5.5.) +syn keyword lnkKeyword ADDRESS_MASK f LOAD ORIGIN START ALGORITHM FILL LOAD_END PAGE TABLE ALIGN GROUP LOAD_SIZE PALIGN TYPE ATTR HAMMING_MASK LOAD_START PARITY_MASK UNION BLOCK HIGH MEMORY RUN UNORDERED COMPRESSION INPUT_PAGE MIRRORING RUN_END VFILL COPY INPUT_RANGE NOINIT RUN_SIZE DSECT l NOLOAD RUN_START ECC LEN o SECTIONS END LENGTH ORG SIZE +syn region lnkLibrary start=+<+ end=+>+ +syn match lnkAttrib '\<[RWXI]\+\>' +syn match lnkSections '\<\.\k\+' +" Assignment statements, which define and assign values to global symbols +syn case match + +hi def link lnkNumber Number +hi def link lnkOption Special +hi def link lnkKeyword Keyword +hi def link lnkLibrary String +hi def link lnkFile String +hi def link lnkLibFile Special +hi def link lnkAttrib Type +hi def link lnkSections Macro + +let b:current_syntax = "lnk" diff --git a/runtime/syntax/lnkmap.vim b/runtime/syntax/lnkmap.vim new file mode 100644 index 0000000000..dc097f412f --- /dev/null +++ b/runtime/syntax/lnkmap.vim @@ -0,0 +1,35 @@ +" Vim syntax file +" Language: TI Linker map +" Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Last Change: 2024 Dec 30 + +if exists("b:current_syntax") + finish +endif + +syn match lnkmapTime ">> .*$" +syn region lnkmapHeadline start="^\*\+$" end="^\*\+$" +syn match lnkmapHeadline "^[A-Z][-A-Z0-9 ']*\ze\%(:\|$\)" +syn match lnkmapSectionDelim "^=\+$" +syn match lnkmapTableDelim "\%(^\|\s\)\zs---*\ze\%($\|\s\)" +syn match lnkmapNumber "\%(^\|\s\)\zs[0-9a-f]\+\ze\%($\|\s\)" +syn match lnkmapSections '\<\.\k\+\>' +syn match lnkmapFile '[^ =]\+\%(\.\S\+\)\+\>' +syn match lnkmapLibFile '[^ =]\+\.lib\>' +syn match lnkmapAttrib '\<[RWIX]\+\>' +syn match lnkmapAttrib '\s\zs--HOLE--\ze\%\(\s\|$\)' +syn keyword lnkmapAttrib UNINITIALIZED DESCT + + +hi def link lnkmapTime Comment +hi def link lnkmapHeadline Title +hi def link lnkmapSectionDelim PreProc +hi def link lnkmapTableDelim PreProc +hi def link lnkmapNumber Number +hi def link lnkmapSections Macro +hi def link lnkmapFile String +hi def link lnkmapLibFile Special +hi def link lnkmapAttrib Type + +let b:current_syntax = "lnkmap" diff --git a/runtime/syntax/lyrics.vim b/runtime/syntax/lyrics.vim index fd127988f2..48a5b1171c 100644 --- a/runtime/syntax/lyrics.vim +++ b/runtime/syntax/lyrics.vim @@ -2,7 +2,7 @@ " Language: LyRiCs " Maintainer: ObserverOfTime <chronobserver@disroot.org> " Filenames: *.lrc -" Last Change: 2024 Sep 20 +" Last Change: 2025 Jan 13 if exists('b:current_syntax') finish @@ -23,7 +23,7 @@ syn match lrcTagName contained nextgroup=lrcTagValue syn match lrcTagValue /:\zs.\+\ze\]/ contained " Lyrics -syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\]\)\+/ +syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\d\?\]\)\+/ \ contains=lrcNumber nextgroup=lrcLyricLine syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell diff --git a/runtime/syntax/netrw.vim b/runtime/syntax/netrw.vim deleted file mode 100644 index f5b7fdc2c6..0000000000 --- a/runtime/syntax/netrw.vim +++ /dev/null @@ -1,148 +0,0 @@ -" Language : Netrw Listing Syntax -" Maintainer: This runtime file is looking for a new maintainer. -" Former Maintainer: Charles E. Campbell -" Last Change: Nov 07, 2019 -" 2024 Feb 19 by Vim Project (announce adoption) -" Version : 20 -" --------------------------------------------------------------------- -if exists("b:current_syntax") - finish -endif - -" --------------------------------------------------------------------- -" Directory List Syntax Highlighting: {{{1 -syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt -syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe - -syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell -syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell -syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime -syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4') -syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup -else -syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup -endif -syn match netrwTreeBarSpace " " contained - -syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained -syn match netrwDateSep "/" contained -syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep -syn match netrwTimeSep ":" - -syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell -syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat -syn match netrwSlash "/" contained -syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep -syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat -syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList -syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList -syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList -syn match netrwList ".*$" contained contains=netrwComma,@NoSpell -syn match netrwComma "," contained -syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained -syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep -syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite -syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote -syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell -syn match netrwVersion "(netrw.*)" contained contains=@NoSpell -syn match netrwLink "-->" contained skipwhite - -" ----------------------------- -" Special filetype highlighting {{{1 -" ----------------------------- -if exists("g:netrw_special_syntax") && g:netrw_special_syntax - if exists("+suffixes") && &suffixes != "" - let suflist= join(split(&suffixes,',')) - let suflist= escape(substitute(suflist," ",'\\|','g'),'.~') - exe "syn match netrwSpecFile '\\(\\S\\+ \\)*\\S*\\(".suflist."\\)\\>' contains=netrwTreeBar,@NoSpell" - endif - syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell - syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell - if has("unix") - syn match netrwCoreDump "\<core\%(\.\d\+\)\=\>" contains=netrwTreeBar,@NoSpell - endif - syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell - syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell - syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\|docx\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell - syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwPix "\c\(\S\+ \)*\S*\.\%(bmp\|fits\=\|gif\|je\=pg\|pcx\|ppc\|pgm\|png\|ppm\|psd\|rgb\|tif\|xbm\|xcf\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwTags "\<tags\>" contains=netrwTreeBar,@NoSpell - syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell - syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell -endif - -" --------------------------------------------------------------------- -" Highlighting Links: {{{1 -if !exists("did_drchip_netrwlist_syntax") - let did_drchip_netrwlist_syntax= 1 - hi default link netrwClassify Function - hi default link netrwCmdSep Delimiter - hi default link netrwComment Comment - hi default link netrwDir Directory - hi default link netrwHelpCmd Function - hi default link netrwQHTopic Number - hi default link netrwHidePat Statement - hi default link netrwHideSep netrwComment - hi default link netrwList Statement - hi default link netrwVersion Identifier - hi default link netrwSymLink Question - hi default link netrwExe PreProc - hi default link netrwDateSep Delimiter - - hi default link netrwTreeBar Special - hi default link netrwTimeSep netrwDateSep - hi default link netrwComma netrwComment - hi default link netrwHide netrwComment - hi default link netrwMarkFile TabLineSel - hi default link netrwLink Special - - " special syntax highlighting (see :he g:netrw_special_syntax) - hi default link netrwCoreDump WarningMsg - hi default link netrwData Folded - hi default link netrwHdr netrwPlain - hi default link netrwLex netrwPlain - hi default link netrwLib DiffChange - hi default link netrwMakefile DiffChange - hi default link netrwYacc netrwPlain - hi default link netrwPix Special - - hi default link netrwBak netrwGray - hi default link netrwCompress netrwGray - hi default link netrwSpecFile netrwGray - hi default link netrwObj netrwGray - hi default link netrwTags netrwGray - hi default link netrwTilde netrwGray - hi default link netrwTmp netrwGray -endif - - " set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those - " can be hard/impossible to read). Users may override this in a colorscheme by - " specifying netrwGray highlighting. - redir => s:netrwgray - sil hi netrwGray - redir END - if s:netrwgray !~ 'guifg' - if has("gui") && has("gui_running") - if &bg == "dark" - exe "hi netrwGray gui=NONE guifg=gray30" - else - exe "hi netrwGray gui=NONE guifg=gray70" - endif - else - hi link netrwGray Folded - endif - endif - -" Current Syntax: {{{1 -let b:current_syntax = "netrwlist" -" --------------------------------------------------------------------- -" vim: ts=8 fdm=marker diff --git a/runtime/syntax/opencl.vim b/runtime/syntax/opencl.vim new file mode 100644 index 0000000000..c237aa30f9 --- /dev/null +++ b/runtime/syntax/opencl.vim @@ -0,0 +1,13 @@ +" Vim syntax file +" Language: OpenCL +" Last Change: 2024 Nov 19 +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> + +if exists("b:current_syntax") + finish +endif + +" TODO: support openCL specific keywords +runtime! syntax/c.vim + +let current_syntax = "opencl" diff --git a/runtime/syntax/po.vim b/runtime/syntax/po.vim index 08d6baec27..6da27f639d 100644 --- a/runtime/syntax/po.vim +++ b/runtime/syntax/po.vim @@ -1,10 +1,11 @@ " Vim syntax file " Language: po (gettext) " Maintainer: Dwayne Bailey <dwayne@translate.org.za> -" Last Change: 2015 Jun 07 +" Last Change: 2024 Nov 28 " Contributors: Dwayne Bailey (Most advanced syntax highlighting) " Leonardo Fontenelle (Spell checking) " Nam SungHyun <namsh@kldp.org> (Original maintainer) +" Eisuke Kawashima (add format-flags: #16132) " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -32,9 +33,9 @@ syn region poMsgCTxt matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 syn region poMsgID matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid syn region poMsgSTR matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr syn region poStringCTxt start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained +syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable -syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained +syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained \ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable " Header and Copyright @@ -45,13 +46,43 @@ syn match poCopyrightUnset "SOME DESCRIPTIVE TITLE\|FIRST AUTHOR <EMAIL@ADDR " Translation comment block including: translator comment, automatic comments, flags and locations syn match poComment "^#.*$" syn keyword poFlagFuzzy fuzzy contained + +syn match poFlagFormat /\<\%(no-\)\?awk-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?boost-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?c++-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?c-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?csharp-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?elisp-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?gcc-internal-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?gfc-internal-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?java-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?java-printf-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?javascript-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?kde-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?librep-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?lisp-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?lua-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?objc-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?object-pascal-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?perl-brace-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?perl-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?php-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?python-brace-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?python-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?qt-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?qt-plural-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?ruby-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?scheme-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?sh-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?smalltalk-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?tcl-format\>/ contained +syn match poFlagFormat /\<\%(no-\)\?ycp-format\>/ contained + syn match poCommentTranslator "^# .*$" contains=poCopyrightUnset -syn match poCommentAutomatic "^#\..*$" +syn match poCommentAutomatic "^#\..*$" syn match poCommentSources "^#:.*$" -syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy -syn match poDiffOld '\(^#| "[^{]*+}\|{+[^}]*+}\|{+[^}]*\|"$\)' contained -syn match poDiffNew '\(^#| "[^{]*-}\|{-[^}]*-}\|{-[^}]*\|"$\)' contained -syn match poCommentDiff "^#|.*$" contains=poDiffOld,poDiffNew +syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy,poFlagFormat +syn match poCommentPrevious "^#|.*$" " Translations (also includes header fields as they appear in a translation msgstr) syn region poCommentKDE start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained @@ -66,13 +97,13 @@ syn match poFormat "%%" contained syn region poMsguniqError matchgroup=poMsguniqErrorMarkers start="#-#-#-#-#" end='#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)\\n' contained " Obsolete messages -syn match poObsolete "^#\~.*$" +syn match poObsolete "^#\~.*$" " KDE Name= handling syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1 " Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char -syn match poAcceleratorId contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 +syn match poAcceleratorId contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 syn match poAcceleratorStr contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 contains=@Spell " Variables simple @@ -86,11 +117,10 @@ hi def link poComment Comment hi def link poCommentAutomatic Comment hi def link poCommentTranslator Comment hi def link poCommentFlags Special -hi def link poCommentDiff Comment +hi def link poCommentPrevious Comment hi def link poCopyrightUnset Todo hi def link poFlagFuzzy Todo -hi def link poDiffOld Todo -hi def link poDiffNew Special +hi def link poFlagFormat Todo hi def link poObsolete Comment hi def link poStatementMsgid Statement diff --git a/runtime/syntax/ptx.vim b/runtime/syntax/ptx.vim new file mode 100644 index 0000000000..98de4ff6d3 --- /dev/null +++ b/runtime/syntax/ptx.vim @@ -0,0 +1,52 @@ +" Vim syntax file +" Language: Nvidia PTX (Parallel Thread Execution) +" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com> +" Latest Revision: 2024-12-05 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syntax iskeyword .,_,a-z,48-57 + +" https://docs.nvidia.com/cuda/parallel-thread-execution/#directives +syntax keyword ptxFunction .entry .func +syntax keyword ptxDirective .branchtargets .file .loc .secion .maxnctapersm .maxnreg .minnctapersm .noreturn .pragma .reqntid .target .version .weak +syntax keyword ptxOperator .address_size .alias .align .callprototype .calltargets +syntax keyword ptxStorageClass .common .const .extern .global .local .param .reg .sreg .shared .tex .visible +syntax keyword ptxType .explicitcluster .maxclusterrank .reqnctapercluster + +" https://docs.nvidia.com/cuda/parallel-thread-execution/#fundamental-types +" signed integer +syntax keyword ptxType .s8 .s16 .s32 .s64 +" unsigned integer +syntax keyword ptxType .u8 .u16 .u32 .u64 +" floating-point +syntax keyword ptxType .f16 .f16x2 .f32 .f64 +" bits (untyped) +syntax keyword ptxType .b8 .b16 .b32 .b64 .b128 +" predicate +syntax keyword ptxType .pred + +" https://docs.nvidia.com/cuda/parallel-thread-execution/#instruction-statements +syntax keyword ptxStatement ret + +syntax region ptxCommentL start="//" skip="\\$" end="$" keepend +syntax region ptxComment matchgroup=ptxCommentStart start="/\*" end="\*/" extend + +hi def link ptxFunction Function +hi def link ptxDirective Keyword +hi def link ptxOperator Operator +hi def link ptxStorageClass StorageClass +hi def link ptxType Type +hi def link ptxStatement Statement + +hi def link ptxCommentL ptxComment +hi def link ptxCommentStart ptxComment +hi def link ptxComment Comment + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/query.lua b/runtime/syntax/query.lua index 2dfe29f69b..0de08b4dfb 100644 --- a/runtime/syntax/query.lua +++ b/runtime/syntax/query.lua @@ -1,6 +1,5 @@ -- Neovim syntax file -- Language: Treesitter query --- Last Change: 2024 Jul 03 -- it's a lisp! vim.cmd([[runtime! syntax/lisp.vim]]) diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 97e74d205f..67268cdfe3 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -4,6 +4,9 @@ " Previous Maintainers: Charles E. Campbell " Lennart Schultz <Lennart.Schultz@ecmwf.int> " Last Change: 2024 Mar 04 by Vim Project +" 2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941) +" 2025 Jan 06 add $PS0 to bashSpecialVariables (#16394) +" 2025 Jan 18 add bash coproc, remove duplicate syn keywords (#16467) " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax @@ -22,7 +25,7 @@ elseif getline(1) =~ '\<bash\>' elseif getline(1) =~ '\<dash\>' let b:is_dash = 1 elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") && !exists("g:is_dash") - " user did not specify which shell to use, and + " user did not specify which shell to use, and " the script itself does not specify which shell to use. FYI: /bin/sh is ambiguous. " Assuming /bin/sh is executable, and if its a link, find out what it links to. let s:shell = "" @@ -127,6 +130,50 @@ else com! -nargs=* ShFoldIfDoFor <args> endif +" Generate bracket expression items {{{1 +" ================================= +" Note that the following function can be invoked as many times as necessary +" provided that these constraints hold for the passed dictionary argument: +" - every time a unique group-name value is assigned to the "itemGroup" key; +" - only ONCE either the "extraArgs" key is not entered or it is entered and +" its value does not have "contained" among other optional arguments (":help +" :syn-arguments"). +fun! s:GenerateBracketExpressionItems(dict) abort + let itemGroup = a:dict.itemGroup + let bracketGroup = a:dict.bracketGroup + let invGroup = itemGroup . 'Inv' + let skipLeftBracketGroup = itemGroup . 'SkipLeftBracket' + let skipRightBracketGroup = itemGroup . 'SkipRightBracket' + let extraArgs = has_key(a:dict, 'extraArgs') ? a:dict.extraArgs : '' + + " Make the leading "[!^]" stand out in a NON-matching expression. + exec 'syn match ' . invGroup . ' contained "\[\@<=[!^]"' + + " Set up indirections for unbalanced-bracket highlighting. + exec 'syn region ' . skipRightBracketGroup . ' contained matchgroup=' . bracketGroup . ' start="\[\%([!^]\=\\\=\]\)\@=" matchgroup=shCollSymb end="\[\.[^]]\{-}\][^]]\{-}\.\]" matchgroup=' . itemGroup . ' end="\]" contains=@shBracketExprList,shDoubleQuote,' . invGroup + exec 'syn region ' . skipLeftBracketGroup . ' contained matchgroup=' . bracketGroup . ' start="\[\%([!^]\=\\\=\]\)\@=" skip="[!^]\=\\\=\]\%(\[[^]]\+\]\|[^]]\)\{-}\%(\[[:.=]\@!\)\@=" matchgroup=' . itemGroup . ' end="\[[:.=]\@!" contains=@shBracketExprList,shDoubleQuote,' . invGroup + + " Look for a general matching expression. + exec 'syn region ' . itemGroup . ' matchgroup=' . bracketGroup . ' start="\[\S\@=" end="\]" contains=@shBracketExprList,shDoubleQuote ' . extraArgs + " Look for a general NON-matching expression. + exec 'syn region ' . itemGroup . ' matchgroup=' . bracketGroup . ' start="\[[!^]\@=" end="\]" contains=@shBracketExprList,shDoubleQuote,' . invGroup . ' ' . extraArgs + + " Accommodate unbalanced brackets in bracket expressions. The supported + " syntax for a plain "]" can be: "[]ws]" and "[^]ws]"; or, "[ws[.xs]ys.]zs]" + " and "[^ws[.xs]ys.]zs]"; see §9.3.5 RE Bracket Expression (in XBD). + exec 'syn region ' . itemGroup . ' matchgroup=NONE start="\[[!^]\=\\\=\]" matchgroup=' . bracketGroup . ' end="\]" contains=@shBracketExprList,shDoubleQuote,' . skipRightBracketGroup . ' ' . extraArgs + " Strive to handle "[]...[]" etc. + exec 'syn region ' . itemGroup . ' matchgroup=NONE start="\[[!^]\=\\\=\]\%(\[[^]]\+\]\|[^]]\)\{-}\[[:.=]\@!" matchgroup=' . bracketGroup . ' end="\]" contains=@shBracketExprList,shDoubleQuote,' . skipLeftBracketGroup . ' ' . extraArgs + + if !exists("g:skip_sh_syntax_inits") + exec 'hi def link ' . skipLeftBracketGroup . ' ' . itemGroup + exec 'hi def link ' . skipRightBracketGroup . ' ' . itemGroup + exec 'hi def link ' . invGroup . ' Underlined' + endif +endfun + +call s:GenerateBracketExpressionItems({'itemGroup': 'shBracketExpr', 'bracketGroup': 'shBracketExprDelim'}) + " sh syntax is case sensitive {{{1 syn case match @@ -136,23 +183,24 @@ syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsa if exists("b:is_kornshell") || exists("b:is_bash") syn cluster ErrorList add=shDTestError endif -syn cluster shArithParenList contains=shArithmetic,shArithParen,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor,shFunctionKey,shFunctionOne,shFunctionTwo +syn cluster shArithParenList contains=shArithmetic,shArithParen,shCaseEsac,shComment,shDeref,shDerefVarArray,shDo,shDerefSimple,shEcho,shEscape,shExpr,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shArithList contains=@shArithParenList,shParenError +syn cluster shBracketExprList contains=shCharClassOther,shCharClass,shCollSymb,shEqClass syn cluster shCaseEsacList contains=shCaseStart,shCaseLabel,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shComment,shDblBrace,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shCaseList add=shForPP,shDblParen endif -syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable +syn cluster shCommandSubList contains=shAlias,shArithmetic,shBracketExpr,shCmdParenRegion,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial " COMBAK: removing shEscape from shDblQuoteList fails ksh04:43 -- Jun 09, 2022: I don't see the problem with ksh04, so am reinstating shEscape syn cluster shDblQuoteList contains=shArithmetic,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial,shSpecialDQ syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS syn cluster shDerefVarList contains=shDerefOffset,shDerefOp,shDerefVarArray,shDerefOpError -syn cluster shEchoList contains=shArithmetic,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote -syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq +syn cluster shEchoList contains=shArithmetic,shBracketExpr,shCommandSub,shCommandSubBQ,shDerefVarArray,shSubshare,shValsub,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote +syn cluster shExprList1 contains=shBracketExpr,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest -syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq +syn cluster shFunctionList contains=shBracketExpr,@shCommandSubList,shCaseEsac,shColon,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shFunctionList add=shRepeat,shDblBrace,shDblParen,shForPP syn cluster shDerefList add=shCommandSubList,shEchoDeref @@ -160,16 +208,16 @@ endif syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload -syn cluster shIdList contains=shArithmetic,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shWrapLineOperator,shSetOption,shComment,shDeref,shDerefSimple,shHereString,shNumber,shOperator,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr +syn cluster shIdList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDerefVarArray,shSubshare,shValsub,shWrapLineOperator,shSetOption,shComment,shDeref,shDerefSimple,shHereString,shNumber,shOperator,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shIf,shOption,shSet,shTest,shTestOpr,shTouch if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shLoopList add=shForPP,shDblParen endif -syn cluster shPPSLeftList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shSubshare,shValsub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable +syn cluster shPPSLeftList contains=shAlias,shArithmetic,shBracketExpr,shCmdParenRegion,shCommandSub,shSubshare,shValsub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shPPSRightList contains=shDeref,shDerefSimple,shEscape,shPosnParm -syn cluster shSubShList contains=@shCommandSubList,shCommandSubBQ,shSubshare,shValsub,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator -syn cluster shTestList contains=shArithmetic,shCharClass,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr +syn cluster shSubShList contains=shBracketExpr,@shCommandSubList,shCommandSubBQ,shSubshare,shValsub,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator +syn cluster shTestList contains=shArithmetic,shBracketExpr,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr syn cluster shNoZSList contains=shSpecialNoZS syn cluster shForList contains=shTestOpr,shNumber,shDerefSimple,shDeref,shCommandSub,shCommandSubBQ,shSubshare,shValsub,shArithmetic @@ -190,7 +238,7 @@ endif syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]' " This must be after the strings, so that ... \" will be correct -syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shExDoubleQuote,shDoubleQuote,shCharClass,shCtrlSeq +syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shBracketExpr,shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shExDoubleQuote,shDoubleQuote,shCtrlSeq " Alias: {{{1 " ===== @@ -240,7 +288,6 @@ syn match shRedir "\d<<-\=" " ========== syn match shOperator "<<\|>>" contained syn match shOperator "[!&;|]" contained -syn match shOperator "\[[[^:]\|\]]" contained syn match shOperator "[-=/*+%]\==" skipwhite nextgroup=shPattern syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref @@ -251,9 +298,9 @@ syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" " Tests: {{{1 "======= -syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial +syn region shExpr matchgroup=shRange start="\[\s\@=" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial syn region shTest transparent matchgroup=shStatement start="\<test\s" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1 -syn region shNoQuote start='\S' skip='\%(\\\\\)*\\.' end='\ze\s' end="\ze['"]" contained contains=shDerefSimple,shDeref +syn region shNoQuote start='\S' skip='\%(\\\\\)*\\.' end='\ze\s' end="\ze['"]" contained contains=shBracketExpr,shDerefSimple,shDeref syn match shAstQuote contained '\*\ze"' nextgroup=shString syn match shTestOpr contained '[^-+/%]\zs=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern syn match shTestOpr contained "<=\|>=\|!=\|==\|=\~\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]" @@ -262,13 +309,16 @@ syn region shTestDoubleQuote contained start='\%(\%(\\\\\)*\\\)\@<!"' skip=+\\\\ syn match shTestSingleQuote contained '\\.' nextgroup=shTestSingleQuote syn match shTestSingleQuote contained "'[^']*'" if exists("b:is_kornshell") || exists("b:is_bash") - syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\%(\\\\\)*\\$+ end="\]\]" contains=@shTestList,shAstQuote,shNoQuote,shComment + syn region shDblBrace matchgroup=Delimiter start="\[\[\s\@=" skip=+\%(\\\\\)*\\$+ end="\]\]" contains=@shTestList,shAstQuote,shNoQuote,shComment syn region shDblParen matchgroup=Delimiter start="((" skip=+\%(\\\\\)*\\$+ end="))" contains=@shTestList,shComment endif " Character Class In Range: {{{1 " ========================= +syn match shCharClassOther contained "\[:\w\{-}:\]" syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]" +syn match shCollSymb contained "\[\..\{-}\.\]" +syn match shEqClass contained "\[=.\{-}=\]" " Loops: do, if, while, until {{{1 " ====== @@ -298,12 +348,12 @@ syn match shComma contained "," " ==== syn match shCaseBar contained skipwhite "\(^\|[^\\]\)\(\\\\\)*\zs|" nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar -syn match shCaseLabel contained skipwhite "\%(\\.\|[-a-zA-Z0-9_*.]\)\+" contains=shCharClass +syn match shCaseLabel contained skipwhite "\%(\\.\|[-a-zA-Z0-9_*.]\)\+" contains=shBracketExpr if exists("b:is_bash") ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end=";;&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment elseif exists("b:is_kornshell") ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment -else +else ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment endif ShFoldIfDoFor syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList @@ -317,11 +367,9 @@ endif syn region shCaseSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseDoubleQuote matchgroup=shQuote start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained +call s:GenerateBracketExpressionItems({'itemGroup': 'shCaseRange', 'bracketGroup': 'shBracketExprDelim', 'extraArgs': 'skip=+\\\\+ contained'}) if exists("b:is_bash") - syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+ contained contains=shCharClass syn match shCharClass '\[:\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|or\|xdigit\):\]' contained -else - syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+ contained endif " Misc: {{{1 "====== @@ -358,7 +406,7 @@ syn region shCmdParenRegion matchgroup=shCmdSubRegion start="((\@!" skip='\\\\\| if exists("b:is_bash") syn cluster shCommandSubList add=bashSpecialVariables,bashStatement syn cluster shCaseList add=bashAdminStatement,bashStatement - syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID + syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ARGC BASH_ARGV BASH_CMDS BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_LINENO BASHOPTS BASHPID BASH_REMATCH BASH_SOURCE BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD CDPATH COLUMNS COMP_CWORD COMP_KEY COMP_LINE COMP_POINT COMPREPLY COMP_TYPE COMP_WORDBREAKS COMP_WORDS COPROC COPROC_PID DIRSTACK EMACS ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LINENO LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT PPID PROMPT_COMMAND PS0 PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_POINT REPLY SECONDS SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR UID syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep head less ls mkdir mv rm rmdir rpm sed sleep sort strip tail syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop syn keyword bashStatement command compgen @@ -453,7 +501,18 @@ endif "============= syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained syn match shVariable "\<\h\w*\ze=" nextgroup=shVarAssign -syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote,shVar +if exists("b:is_bash") + " The subscript form for array values, e.g. "foo=([2]=10 [4]=100)". + syn region shArrayValue contained start="\[\%(..\{-}\]=\)\@=" end="\]=\@=" contains=@shArrayValueList nextgroup=shVarAssign + syn cluster shArrayValueList contains=shArithmetic,shArithParen,shCommandSub,shDeref,shDerefSimple,shExpr,shNumber,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shSpecial,shParen,bashSpecialVariables,shParenError +endif +if exists("b:is_bash") || exists("b:is_kornshell") + syn match shVariable "\<\h\w*\%(\[..\{-}\]\)\=\ze\%([|^&*/%+-]\|[<^]<\|[>^]>\)\==" contains=shDerefVarArray nextgroup=shVarAssign + syn match shVarAssign contained "\%([|^&*/%+-]\|[<^]<\|[>^]>\)\==" nextgroup=shArrayRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote,shVar + syn region shArrayRegion contained matchgroup=shShellVariables start="(" skip='\\\\\|\\.' end=")" contains=@shArrayValueList,shArrayValue,shComment +else + syn match shVarAssign contained "=" nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote,shVar +endif syn match shVar contained "\h\w*" syn region shAtExpr contained start="@(" end=")" contains=@shIdList if exists("b:is_bash") @@ -482,6 +541,7 @@ if !exists("b:is_posix") endif if exists("b:is_bash") + syn keyword shFunctionKey coproc ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*[A-Za-z_0-9:][-a-zA-Z_0-9:]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\%(do\)\@!\&\<[A-Za-z_0-9:][-a-zA-Z_0-9:]*\>\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*[A-Za-z_0-9:][-a-zA-Z_0-9:]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment @@ -571,8 +631,11 @@ syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList - syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern + syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern skipnl syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern + " Match parametric bracket expressions with a leading whitespace character. + syn region shDerefPattern contained matchgroup=shBracketExprDelim start="\[" end="\]" contains=@shBracketExprList,shDoubleQuote nextgroup=shDerefPattern + call s:GenerateBracketExpressionItems({'itemGroup': 'shDerefPattern', 'bracketGroup': 'shBracketExprDelim', 'extraArgs': 'contained nextgroup=shDerefPattern'}) syn match shDerefEscape contained '\%(\\\\\)*\\.' endif if exists("b:is_bash") @@ -592,15 +655,16 @@ if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") endif if exists("b:is_bash") + " bash : ${parameter/pattern/string} " bash : ${parameter//pattern/string} - " bash : ${parameter//pattern} syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' end='"' nextgroup=shDerefPPSright contains=@shPPSLeftList syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shPPSRightList - " bash : ${parameter/#substring/replacement} - syn match shDerefPSR contained '/#' nextgroup=shDerefPSRleft,shDoubleQuote,shSingleQuote - syn region shDerefPSRleft contained start='[^"']' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPSRright + " bash : ${parameter/#pattern/string} + " bash : ${parameter/%pattern/string} + syn match shDerefPSR contained '/[#%]' nextgroup=shDerefPSRleft,shDoubleQuote,shSingleQuote + syn region shDerefPSRleft contained start='[^"']' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPSRright contains=shBracketExpr syn region shDerefPSRright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' endif @@ -631,10 +695,10 @@ if exists("b:is_kornshell") || exists("b:is_posix") " Additional bash Keywords: {{{1 " ===================== elseif exists("b:is_bash") - syn keyword shStatement bg builtin disown export false fg getopts jobs let printf sleep true unalias + syn keyword shStatement bg builtin disown export false fg getopts jobs let printf true unalias syn keyword shStatement typeset nextgroup=shSetOption syn keyword shStatement fc hash history source suspend times type - syn keyword shStatement bind builtin caller compopt declare dirs disown enable export help logout local mapfile popd pushd readarray shopt source typeset + syn keyword shStatement bind caller compopt declare dirs enable help logout local mapfile popd pushd readarray shopt typeset else syn keyword shStatement login newgrp endif @@ -670,6 +734,7 @@ syn sync match shWhileSync grouphere shRepeat "\<while\>" " ===================== if !exists("skip_sh_syntax_inits") hi def link shArithRegion shShellVariables + hi def link shArrayValue shDeref hi def link shAstQuote shDoubleQuote hi def link shAtExpr shSetList hi def link shBkslshSnglQuote shSingleQuote @@ -764,7 +829,10 @@ if !exists("skip_sh_syntax_inits") endif hi def link shArithmetic Special + hi def link shBracketExprDelim Delimiter hi def link shCharClass Identifier + hi def link shCollSymb shCharClass + hi def link shEqClass shCharClass hi def link shSnglCase Statement hi def link shCommandSub Special hi def link shCommandSubBQ shCommandSub @@ -814,6 +882,10 @@ delc ShFoldFunctions delc ShFoldHereDoc delc ShFoldIfDoFor +" Delete the bracket expression function {{{1 +" ====================================== +delfun s:GenerateBracketExpressionItems + " Set Current Syntax: {{{1 " =================== if exists("b:is_bash") diff --git a/runtime/syntax/shaderslang.vim b/runtime/syntax/shaderslang.vim new file mode 100644 index 0000000000..1cae202b04 --- /dev/null +++ b/runtime/syntax/shaderslang.vim @@ -0,0 +1,360 @@ +" Vim syntax file +" Language: Slang +" Maintainer: Austin Shijo <epestr@proton.me> +" Last Change: 2024 Jan 05 + +if exists("b:current_syntax") + finish +endif + +" Read the C syntax to start with +runtime! syntax/c.vim +unlet b:current_syntax + +" Annotations +syn match shaderslangAnnotation /<.*;>/ + +" Attributes +syn match shaderslangAttribute /^\s*\[maxvertexcount(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[domain(\s*"\(tri\|quad\|isoline\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[earlydepthstencil\]/ +syn match shaderslangAttribute /^\s*\[instance(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[maxtessfactor(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[numthreads(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[outputcontrolpoints(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[outputtopology(\s*"\(point\|line\|triangle_cw\|triangle_ccw\|triangle\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[partitioning(\s*"\(integer\|fractional_even\|fractional_odd\|pow2\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[patchconstantfunc(\s*"\(\d\|\w\|_\)\+"\s*)\]/ +syn match shaderslangAttribute /^\s*\[WaveSize(\s*\w\+\(\s*,\s*\w\+\(\s*,\s*\w\+\)\?\)\?\s*)\]/ +syn match shaderslangAttribute /^\s*\[shader(\s*"\(anyhit\|callable\|closesthit\|intersection\|miss\|raygeneration\)"\s*)\]/ + +syn match shaderslangAttribute /^\s*\[fastopt\]/ +syn match shaderslangAttribute /^\s*\[loop\]/ +syn match shaderslangAttribute /^\s*\[unroll\]/ +syn match shaderslangAttribute /^\s*\[allow_uav_condition\]/ +syn match shaderslangAttribute /^\s*\[branch\]/ +syn match shaderslangAttribute /^\s*\[flatten\]/ +syn match shaderslangAttribute /^\s*\[forcecase\]/ +syn match shaderslangAttribute /^\s*\[call\]/ +syn match shaderslangAttribute /^\s*\[WaveOpsIncludeHelperLanes\]/ + +syn match shaderslangAttribute /\[raypayload\]/ + +" Work graph shader target attributes +syn match shaderslangAttribute /^\s*\[Shader(\s*"\(\d\|\w\|_\)\+"\s*)\]/ + +" Work graph shader function attributes +syn match shaderslangAttribute /^\s*\[NodeLaunch(\s*"\(broadcasting\|coalescing\|thread\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeIsProgramEntry\]/ +syn match shaderslangAttribute /^\s*\[NodeLocalRootArgumentsTableIndex(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NumThreads(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeShareInputOf(\s*"\w\+"\(\s*,\s*\w\+\)\?\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeDispatchGrid(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeMaxDispatchGrid(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeMaxRecursionDepth(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeMaxInputRecordsPerGraphEntryRecord(\s*\w\+\s*,\s*\(true\|false\)\s*)\]/ + +" Work graph record attributes +syn match shaderslangAttribute /\[NodeTrackRWInputSharing\]/ +syn match shaderslangAttribute /\[MaxRecords(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /\[NodeID(\s*"\w\+"\(\s*,\s*\w\+\)\?\s*)\]/ +syn match shaderslangAttribute /\[MaxRecordsSharedWith(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /\[AllowSparseNodes\]/ +syn match shaderslangAttribute /\[NodeArraySize(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /\[UnboundedSparseNodes\]/ + +" Intrinsic functions +syn keyword shaderslangFunc abs acos acosh asin asinh atan atanh cos cosh exp exp2 floor log log10 log2 round rsqrt sin sincos sinh sqrt tan tanh trunc +syn keyword shaderslangFunc AllMemoryBarrier AllMemoryBarrierWithGroupSync DeviceMemoryBarrier DeviceMemoryBarrierWithGroupSync GroupMemoryBarrier GroupMemoryBarrierWithGroupSync +syn keyword shaderslangFunc abort clip errorf printf +syn keyword shaderslangFunc all any countbits faceforward firstbithigh firstbitlow isfinite isinf isnan max min noise pow reversebits sign +syn keyword shaderslangFunc asdouble asfloat asint asuint D3DCOLORtoUBYTE4 f16tof32 f32tof16 +syn keyword shaderslangFunc ceil clamp degrees fma fmod frac frexp ldexp lerp mad modf radiants saturate smoothstep step +syn keyword shaderslangFunc cross determinant distance dot dst length lit msad4 mul normalize rcp reflect refract transpose +syn keyword shaderslangFunc ddx ddx_coarse ddx_fine ddy ddy_coarse ddy_fine fwidth +syn keyword shaderslangFunc EvaluateAttributeAtCentroid EvaluateAttributeAtSample EvaluateAttributeSnapped +syn keyword shaderslangFunc GetRenderTargetSampleCount GetRenderTargetSamplePosition +syn keyword shaderslangFunc InterlockedAdd InterlockedAnd InterlockedCompareExchange InterlockedCompareStore InterlockedExchange InterlockedMax InterlockedMin InterlockedOr InterlockedXor +syn keyword shaderslangFunc InterlockedCompareStoreFloatBitwise InterlockedCompareExchangeFloatBitwise +syn keyword shaderslangFunc Process2DQuadTessFactorsAvg Process2DQuadTessFactorsMax Process2DQuadTessFactorsMin ProcessIsolineTessFactors +syn keyword shaderslangFunc ProcessQuadTessFactorsAvg ProcessQuadTessFactorsMax ProcessQuadTessFactorsMin ProcessTriTessFactorsAvg ProcessTriTessFactorsMax ProcessTriTessFactorsMin +syn keyword shaderslangFunc tex1D tex1Dbias tex1Dgrad tex1Dlod tex1Dproj +syn keyword shaderslangFunc tex2D tex2Dbias tex2Dgrad tex2Dlod tex2Dproj +syn keyword shaderslangFunc tex3D tex3Dbias tex3Dgrad tex3Dlod tex3Dproj +syn keyword shaderslangFunc texCUBE texCUBEbias texCUBEgrad texCUBElod texCUBEproj +syn keyword shaderslangFunc WaveIsFirstLane WaveGetLaneCount WaveGetLaneIndex +syn keyword shaderslangFunc IsHelperLane +syn keyword shaderslangFunc WaveActiveAnyTrue WaveActiveAllTrue WaveActiveBallot +syn keyword shaderslangFunc WaveReadLaneFirst WaveReadLaneAt +syn keyword shaderslangFunc WaveActiveAllEqual WaveActiveAllEqualBool WaveActiveCountBits +syn keyword shaderslangFunc WaveActiveSum WaveActiveProduct WaveActiveBitAnd WaveActiveBitOr WaveActiveBitXor WaveActiveMin WaveActiveMax +syn keyword shaderslangFunc WavePrefixCountBits WavePrefixProduct WavePrefixSum +syn keyword shaderslangFunc QuadReadAcrossX QuadReadAcrossY QuadReadAcrossDiagonal QuadReadLaneAt +syn keyword shaderslangFunc QuadAny QuadAll +syn keyword shaderslangFunc WaveMatch WaveMultiPrefixSum WaveMultiPrefixProduct WaveMultiPrefixCountBits WaveMultiPrefixAnd WaveMultiPrefixOr WaveMultiPrefixXor +syn keyword shaderslangFunc NonUniformResourceIndex +syn keyword shaderslangFunc DispatchMesh SetMeshOutputCounts +syn keyword shaderslangFunc dot4add_u8packed dot4add_i8packed dot2add + +syn keyword shaderslangFunc RestartStrip +syn keyword shaderslangFunc CalculateLevelOfDetail CalculateLevelOfDetailUnclamped Gather GetDimensions GetSamplePosition Load Sample SampleBias SampleCmp SampleCmpLevelZero SampleGrad SampleLevel GatherRaw SampleCmpLevel +syn keyword shaderslangFunc SampleCmpBias SampleCmpGrad +syn keyword shaderslangFunc WriteSamplerFeedback WriteSamplerFeedbackBias WriteSamplerFeedbackGrad WriteSamplerFeedbackLevel +syn keyword shaderslangFunc Append Consume DecrementCounter IncrementCounter +syn keyword shaderslangFunc Load2 Load3 Load4 Store Store2 Store3 Store4 +syn keyword shaderslangFunc GatherRed GatherGreen GatherBlue GatherAlpha GatherCmp GatherCmpRed GatherCmpGreen GatherCmpBlue GatherCmpAlpha +syn match shaderslangFunc /\.mips\[\d\+\]\[\d\+\]/ +syn match shaderslangFunc /\.sample\[\d\+\]\[\d\+\]/ + +" Ray intrinsics +syn keyword shaderslangFunc AcceptHitAndEndSearch CallShader IgnoreHit ReportHit TraceRay +syn keyword shaderslangFunc DispatchRaysIndex DispatchRaysDimensions +syn keyword shaderslangFunc WorldRayOrigin WorldRayDirection RayTMin RayTCurrent RayFlags +syn keyword shaderslangFunc InstanceIndex InstanceID GeometryIndex PrimitiveIndex ObjectRayOrigin ObjectRayDirection ObjectToWorld3x4 ObjectToWorld4x3 WorldToObject3x4 WorldToObject4x3 +syn keyword shaderslangFunc HitKind + +" RayQuery intrinsics +syn keyword shaderslangFunc TraceRayInline Proceed Abort CommittedStatus +syn keyword shaderslangFunc CandidateType CandidateProceduralPrimitiveNonOpaque CandidateTriangleRayT CandidateInstanceIndex CandidateInstanceID CandidateInstanceContributionToHitGroupIndex CandidateGeometryIndex +syn keyword shaderslangFunc CandidatePrimitiveIndex CandidateObjectRayOrigin CandidateObjectRayDirection CandidateObjectToWorld3x4 CandidateObjectToWorld4x3 CandidateWorldToObject3x4 CandidateWorldToObject4x3 +syn keyword shaderslangFunc CommitNonOpaqueTriangleHit CommitProceduralPrimitiveHit CommittedStatus CommittedRayT CommittedInstanceIndex CommittedInstanceID CommittedInstanceContributionToHitGroupIndex +syn keyword shaderslangFunc CommittedGeometryIndex CommittedPrimitiveIndex CommittedObjectRayOrigin CommittedObjectRayDirection CommittedObjectToWorld3x4 CommittedObjectToWorld4x3 CommittedWorldToObject3x4 +syn keyword shaderslangFunc CommittedWorldToObject4x3 CandidateTriangleBarycentrics CandidateTriangleFrontFace CommittedTriangleBarycentrics CommittedTriangleFrontFace + +" Pack/unpack math intrinsics +syn keyword shaderslangFunc unpack_s8s16 unpack_u8u16 unpack_s8s32 unpack_u8u32 +syn keyword shaderslangFunc pack_u8 pack_s8 pack_clamp_u8 pack_clamp_s8 + +" Work graph object methods +syn keyword shaderslangFunc Get FinishedCrossGroupSharing Count GetThreadNodeOutputRecords GetGroupNodeOutputRecords IsValid GroupIncrementOutputCount ThreadIncrementOutputCount OutputComplete + +" Work graph free intrinsics +syn keyword shaderslangFunc GetRemainingRecursionLevels Barrier + +" Layout Qualifiers +syn keyword shaderslangLayoutQual const row_major column_major +syn keyword shaderslangLayoutQual point line triangle lineadj triangleadj +syn keyword shaderslangLayoutQual InputPatch OutputPatch +syn match shaderslangLayoutQual /PointStream<\s*\w\+\s*>/ +syn match shaderslangLayoutQual /LineStream<\s*\w\+\s*>/ +syn match shaderslangLayoutQual /TriangleStream<\s*\w\+\s*>/ + +" User defined Semantics +syn match shaderslangSemantic /:\s*[A-Z]\w*/ +syn match shaderslangSemantic /:\s*packoffset(\s*c\d\+\(\.[xyzw]\)\?\s*)/ " packoffset +syn match shaderslangSemantic /:\s*register(\s*\(r\|x\|v\|t\|s\|cb\|icb\|b\|c\|u\)\d\+\s*)/ " register +syn match shaderslangSemantic /:\s*read(\s*\(\(anyhit\|closesthit\|miss\|caller\)\s*,\s*\)*\(anyhit\|closesthit\|miss\|caller\)\?\s*)/ " read +syn match shaderslangSemantic /:\s*write(\s*\(\(anyhit\|closesthit\|miss\|caller\)\s*,\s*\)*\(anyhit\|closesthit\|miss\|caller\)\?\s*)/ " write + +" System-Value Semantics +" Vertex Shader +syn match shaderslangSemantic /SV_ClipDistance\d\+/ +syn match shaderslangSemantic /SV_CullDistance\d\+/ +syn keyword shaderslangSemantic SV_Position SV_InstanceID SV_PrimitiveID SV_VertexID +syn keyword shaderslangSemantic SV_StartVertexLocation SV_StartInstanceLocation +" Tessellation pipeline +syn keyword shaderslangSemantic SV_DomainLocation SV_InsideTessFactor SV_OutputControlPointID SV_TessFactor +" Geometry Shader +syn keyword shaderslangSemantic SV_GSInstanceID SV_RenderTargetArrayIndex +" Pixel Shader - MSAA +syn keyword shaderslangSemantic SV_Coverage SV_Depth SV_IsFrontFace SV_SampleIndex +syn match shaderslangSemantic /SV_Target[0-7]/ +syn keyword shaderslangSemantic SV_ShadingRate SV_ViewID +syn match shaderslangSemantic /SV_Barycentrics[0-1]/ +" Compute Shader +syn keyword shaderslangSemantic SV_DispatchThreadID SV_GroupID SV_GroupIndex SV_GroupThreadID +" Mesh shading pipeline +syn keyword shaderslangSemantic SV_CullPrimitive +" Work graph record system values +syn keyword shaderslangSemantic SV_DispatchGrid + +" slang structures +syn keyword shaderslangStructure cbuffer + +" Shader profiles +" Cg profiles +syn keyword shaderslangProfile arbfp1 arbvp1 fp20 vp20 fp30 vp30 ps_1_1 ps_1_2 ps_1_3 +" Shader Model 1 +syn keyword shaderslangProfile vs_1_1 +" Shader Model 2 +syn keyword shaderslangProfile ps_2_0 ps_2_x vs_2_0 vs_2_x +" Shader Model 3 +syn keyword shaderslangProfile ps_3_0 vs_3_0 +" Shader Model 4 +syn keyword shaderslangProfile gs_4_0 ps_4_0 vs_4_0 gs_4_1 ps_4_1 vs_4_1 +" Shader Model 5 +syn keyword shaderslangProfile cs_4_0 cs_4_1 cs_5_0 ds_5_0 gs_5_0 hs_5_0 ps_5_0 vs_5_0 +" Shader Model 6 +syn keyword shaderslangProfile cs_6_0 ds_6_0 gs_6_0 hs_6_0 ps_6_0 vs_6_0 lib_6_0 + +" Swizzling +syn match shaderslangSwizzle /\.[xyzw]\{1,4\}\>/ +syn match shaderslangSwizzle /\.[rgba]\{1,4\}\>/ +syn match shaderslangSwizzle /\.\(_m[0-3]\{2}\)\{1,4\}/ +syn match shaderslangSwizzle /\.\(_[1-4]\{2}\)\{1,4\}/ + +" Other Statements +syn keyword shaderslangStatement discard + +" Storage class +syn match shaderslangStorageClass /\<in\(\s+pipeline\)\?\>/ +syn match shaderslangStorageClass /\<out\(\s\+indices\|\s\+vertices\|\s\+primitives\)\?\>/ +syn keyword shaderslangStorageClass inout +syn keyword shaderslangStorageClass extern nointerpolation precise shared groupshared static uniform volatile +syn keyword shaderslangStorageClass snorm unorm +syn keyword shaderslangStorageClass linear centroid nointerpolation noperspective sample +syn keyword shaderslangStorageClass globallycoherent + +" Types +" Buffer types +syn keyword shaderslangType ConstantBuffer Buffer ByteAddressBuffer ConsumeStructuredBuffer StructuredBuffer +syn keyword shaderslangType AppendStructuredBuffer RWBuffer RWByteAddressBuffer RWStructuredBuffer +syn keyword shaderslangType RasterizerOrderedBuffer RasterizerOrderedByteAddressBuffer RasterizerOrderedStructuredBuffer + +" Scalar types +syn keyword shaderslangType bool int uint dword half float double +syn keyword shaderslangType min16float min10float min16int min12int min16uint +syn keyword shaderslangType float16_t float32_t float64_t + +" Vector types +syn match shaderslangType /vector<\s*\w\+,\s*[1-4]\s*>/ +syn keyword shaderslangType bool1 bool2 bool3 bool4 +syn keyword shaderslangType int1 int2 int3 int4 +syn keyword shaderslangType uint1 uint2 uint3 uint4 +syn keyword shaderslangType dword1 dword2 dword3 dword4 +syn keyword shaderslangType half1 half2 half3 half4 +syn keyword shaderslangType float1 float2 float3 float4 +syn keyword shaderslangType double1 double2 double3 double4 +syn keyword shaderslangType min16float1 min16float2 min16float3 min16float4 +syn keyword shaderslangType min10float1 min10float2 min10float3 min10float4 +syn keyword shaderslangType min16int1 min16int2 min16int3 min16int4 +syn keyword shaderslangType min12int1 min12int2 min12int3 min12int4 +syn keyword shaderslangType min16uint1 min16uint2 min16uint3 min16uint4 +syn keyword shaderslangType float16_t1 float16_t2 float16_t3 float16_t4 +syn keyword shaderslangType float32_t1 float32_t2 float32_t3 float32_t4 +syn keyword shaderslangType float64_t1 float64_t2 float64_t3 float64_t4 +syn keyword shaderslangType int16_t1 int16_t2 int16_t3 int16_t4 +syn keyword shaderslangType int32_t1 int32_t2 int32_t3 int32_t4 +syn keyword shaderslangType int64_t1 int64_t2 int64_t3 int64_t4 +syn keyword shaderslangType uint16_t1 uint16_t2 uint16_t3 uint16_t4 +syn keyword shaderslangType uint32_t1 uint32_t2 uint32_t3 uint32_t4 +syn keyword shaderslangType uint64_t1 uint64_t2 uint64_t3 uint64_t4 + +" Packed types +syn keyword shaderslangType uint8_t4_packed int8_t4_packed + +" Matrix types +syn match shaderslangType /matrix<\s*\w\+\s*,\s*[1-4]\s*,\s*[1-4]\s*>/ +syn keyword shaderslangType bool1x1 bool2x1 bool3x1 bool4x1 bool1x2 bool2x2 bool3x2 bool4x2 bool1x3 bool2x3 bool3x3 bool4x3 bool1x4 bool2x4 bool3x4 bool4x4 +syn keyword shaderslangType int1x1 int2x1 int3x1 int4x1 int1x2 int2x2 int3x2 int4x2 int1x3 int2x3 int3x3 int4x3 int1x4 int2x4 int3x4 int4x4 +syn keyword shaderslangType uint1x1 uint2x1 uint3x1 uint4x1 uint1x2 uint2x2 uint3x2 uint4x2 uint1x3 uint2x3 uint3x3 uint4x3 uint1x4 uint2x4 uint3x4 uint4x4 +syn keyword shaderslangType dword1x1 dword2x1 dword3x1 dword4x1 dword1x2 dword2x2 dword3x2 dword4x2 dword1x3 dword2x3 dword3x3 dword4x3 dword1x4 dword2x4 dword3x4 dword4x4 +syn keyword shaderslangType half1x1 half2x1 half3x1 half4x1 half1x2 half2x2 half3x2 half4x2 half1x3 half2x3 half3x3 half4x3 half1x4 half2x4 half3x4 half4x4 +syn keyword shaderslangType float1x1 float2x1 float3x1 float4x1 float1x2 float2x2 float3x2 float4x2 float1x3 float2x3 float3x3 float4x3 float1x4 float2x4 float3x4 float4x4 +syn keyword shaderslangType double1x1 double2x1 double3x1 double4x1 double1x2 double2x2 double3x2 double4x2 double1x3 double2x3 double3x3 double4x3 double1x4 double2x4 double3x4 double4x4 +syn keyword shaderslangType min16float1x1 min16float2x1 min16float3x1 min16float4x1 min16float1x2 min16float2x2 min16float3x2 min16float4x2 min16float1x3 min16float2x3 min16float3x3 min16float4x3 min16float1x4 min16float2x4 min16float3x4 min16float4x4 +syn keyword shaderslangType min10float1x1 min10float2x1 min10float3x1 min10float4x1 min10float1x2 min10float2x2 min10float3x2 min10float4x2 min10float1x3 min10float2x3 min10float3x3 min10float4x3 min10float1x4 min10float2x4 min10float3x4 min10float4x4 +syn keyword shaderslangType min16int1x1 min16int2x1 min16int3x1 min16int4x1 min16int1x2 min16int2x2 min16int3x2 min16int4x2 min16int1x3 min16int2x3 min16int3x3 min16int4x3 min16int1x4 min16int2x4 min16int3x4 min16int4x4 +syn keyword shaderslangType min12int1x1 min12int2x1 min12int3x1 min12int4x1 min12int1x2 min12int2x2 min12int3x2 min12int4x2 min12int1x3 min12int2x3 min12int3x3 min12int4x3 min12int1x4 min12int2x4 min12int3x4 min12int4x4 +syn keyword shaderslangType min16uint1x1 min16uint2x1 min16uint3x1 min16uint4x1 min16uint1x2 min16uint2x2 min16uint3x2 min16uint4x2 min16uint1x3 min16uint2x3 min16uint3x3 min16uint4x3 min16uint1x4 min16uint2x4 min16uint3x4 min16uint4x4 +syn keyword shaderslangType float16_t1x1 float16_t2x1 float16_t3x1 float16_t4x1 float16_t1x2 float16_t2x2 float16_t3x2 float16_t4x2 float16_t1x3 float16_t2x3 float16_t3x3 float16_t4x3 float16_t1x4 float16_t2x4 float16_t3x4 float16_t4x4 +syn keyword shaderslangType float32_t1x1 float32_t2x1 float32_t3x1 float32_t4x1 float32_t1x2 float32_t2x2 float32_t3x2 float32_t4x2 float32_t1x3 float32_t2x3 float32_t3x3 float32_t4x3 float32_t1x4 float32_t2x4 float32_t3x4 float32_t4x4 +syn keyword shaderslangType float64_t1x1 float64_t2x1 float64_t3x1 float64_t4x1 float64_t1x2 float64_t2x2 float64_t3x2 float64_t4x2 float64_t1x3 float64_t2x3 float64_t3x3 float64_t4x3 float64_t1x4 float64_t2x4 float64_t3x4 float64_t4x4 +syn keyword shaderslangType int16_t1x1 int16_t2x1 int16_t3x1 int16_t4x1 int16_t1x2 int16_t2x2 int16_t3x2 int16_t4x2 int16_t1x3 int16_t2x3 int16_t3x3 int16_t4x3 int16_t1x4 int16_t2x4 int16_t3x4 int16_t4x4 +syn keyword shaderslangType int32_t1x1 int32_t2x1 int32_t3x1 int32_t4x1 int32_t1x2 int32_t2x2 int32_t3x2 int32_t4x2 int32_t1x3 int32_t2x3 int32_t3x3 int32_t4x3 int32_t1x4 int32_t2x4 int32_t3x4 int32_t4x4 +syn keyword shaderslangType int64_t1x1 int64_t2x1 int64_t3x1 int64_t4x1 int64_t1x2 int64_t2x2 int64_t3x2 int64_t4x2 int64_t1x3 int64_t2x3 int64_t3x3 int64_t4x3 int64_t1x4 int64_t2x4 int64_t3x4 int64_t4x4 +syn keyword shaderslangType uint16_t1x1 uint16_t2x1 uint16_t3x1 uint16_t4x1 uint16_t1x2 uint16_t2x2 uint16_t3x2 uint16_t4x2 uint16_t1x3 uint16_t2x3 uint16_t3x3 uint16_t4x3 uint16_t1x4 uint16_t2x4 uint16_t3x4 uint16_t4x4 +syn keyword shaderslangType uint32_t1x1 uint32_t2x1 uint32_t3x1 uint32_t4x1 uint32_t1x2 uint32_t2x2 uint32_t3x2 uint32_t4x2 uint32_t1x3 uint32_t2x3 uint32_t3x3 uint32_t4x3 uint32_t1x4 uint32_t2x4 uint32_t3x4 uint32_t4x4 +syn keyword shaderslangType uint64_t1x1 uint64_t2x1 uint64_t3x1 uint64_t4x1 uint64_t1x2 uint64_t2x2 uint64_t3x2 uint64_t4x2 uint64_t1x3 uint64_t2x3 uint64_t3x3 uint64_t4x3 uint64_t1x4 uint64_t2x4 uint64_t3x4 uint64_t4x4 + +" Sampler types +syn keyword shaderslangType SamplerState SamplerComparisonState +syn keyword shaderslangType sampler sampler1D sampler2D sampler3D samplerCUBE sampler_state + +" Texture types +syn keyword shaderslangType Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D TextureCube TextureCubeArray +syn keyword shaderslangType RWTexture1D RWTexture2D RWTexture2DArray RWTexture3D RWTextureCubeArray RWTexture2DMS RWTexture2DMSArray +syn keyword shaderslangType FeedbackTexture2D FeedbackTexture2DArray +syn keyword shaderslangType RasterizerOrderedTexture1D RasterizerOrderedTexture1DArray RasterizerOrderedTexture2D RasterizerOrderedTexture2DArray RasterizerOrderedTexture3D +syn keyword shaderslangTypeDeprec texture texture1D texture2D texture3D + +" Raytracing types +syn keyword shaderslangType RaytracingAccelerationStructure RayDesc RayQuery BuiltInTriangleIntersectionAttributes + +" Work graph input record objects +syn keyword shaderslangType DispatchNodeInputRecord RWDispatchNodeInputRecord GroupNodeInputRecords RWGroupNodeInputRecords ThreadNodeInputRecord RWThreadNodeInputRecord EmptyNodeInput + +" Work graph output node objects +syn keyword shaderslangType NodeOutput NodeOutputArray EmptyNodeOutput EmptyNodeOutputArray + +" Work graph output record objects +syn keyword shaderslangType ThreadNodeOutputRecords GroupNodeOutputRecords + +" State Groups args +syn case ignore " This section case insensitive + +" Blend state group +syn keyword shaderslangStateGroupArg AlphaToCoverageEnable BlendEnable SrcBlend DestBlend BlendOp SrcBlendAlpha DestBlendAlpha BlendOpAlpha RenderTargetWriteMask +syn keyword shaderslangStateGroupVal ZERO ONE SRC_COLOR INV_SRC_COLOR SRC_ALPHA INV_SRC_ALPHA DEST_ALPHA INV_DEST_ALPHA DEST_COLOR INV_DEST_COLOR SRC_ALPHA_SAT BLEND_FACTOR INV_BLEND_FACTOR SRC1_COLOR INV_SRC1_COLOR SRC1_ALPHA INV_SRC1_ALPHA +syn keyword shaderslangStateGroupVal ADD SUBSTRACT REV_SUBSTRACT MIN MAX + +" Rasterizer state group +syn keyword shaderslangStateGroupArg FillMode CullMode FrontCounterClockwise DepthBias DepthBiasClamp SlopeScaledDepthBias ZClipEnable DepthClipEnable ScissorEnable MultisampleEnable AntialiasedLineEnable +syn keyword shaderslangStateGroupVal SOLID WIREFRAME +syn keyword shaderslangStateGroupVal NONE FRONT BACK + +" Sampler state group +syn keyword shaderslangStateGroupArg Filter AddressU AddressV AddressW MipLODBias MaxAnisotropy ComparisonFunc BorderColor MinLOD MaxLOD ComparisonFilter +syn keyword shaderslangStateGroupVal MIN_MAG_MIP_POINT MIN_MAG_POINT_MIP_LINEAR MIN_POINT_MAG_LINEAR_MIP_POINT MIN_POINT_MAG_MIP_LINEAR MIN_LINEAR_MAG_MIP_POINT MIN_LINEAR_MAG_POINT_MIP_LINEAR MIN_MAG_LINEAR_MIP_POINT MIN_MAG_MIP_LINEAR ANISOTROPIC +syn keyword shaderslangStateGroupVal COMPARISON_MIN_MAG_MIP_POINT COMPARISON_MIN_MAG_POINT_MIP_LINEAR COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT COMPARISON_MIN_POINT_MAG_MIP_LINEAR COMPARISON_MIN_LINEAR_MAG_MIP_POINT +syn keyword shaderslangStateGroupVal COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR COMPARISON_MIN_MAG_LINEAR_MIP_POINT COMPARISON_MIN_MAG_MIP_LINEAR COMPARISON_ANISOTROPIC +syn keyword shaderslangStateGroupVal COMPARISON_NEVER COMPARISON_LESS COMPARISON_EQUAL COMPARISON_LESS_EQUAL COMPARISON_GREATER COMPARISON_NOT_EQUAL COMPARISON_GREATER_EQUAL COMPARISON_ALWAYS +syn keyword shaderslangStateGroupVal WRAP MIRROR CLAMP BORDER MIRROR_ONCE +syn keyword shaderslangStateGroupVal SAMPLER_FEEDBACK_MIN_MIP SAMPLER_FEEDBACK_MIP_REGION_USED + +" Ray flags +syn keyword shaderslangStateGroupVal RAY_FLAG_NONE RAY_FLAG_FORCE_OPAQUE RAY_FLAG_FORCE_NON_OPAQUE RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH RAY_FLAG_SKIP_CLOSEST_HIT_SHADER +syn keyword shaderslangStateGroupVal RAY_FLAG_CULL_BACK_FACING_TRIANGLES RAY_FLAG_CULL_FRONT_FACING_TRIANGLES RAY_FLAG_CULL_OPAQUE RAY_FLAG_CULL_NON_OPAQUE +syn keyword shaderslangStateGroupVal RAY_FLAG_SKIP_TRIANGLES RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES + +" HitKind enum +syn keyword shaderslangStateGroupVal HIT_KIND_TRIANGLE_FRONT_FACE HIT_KIND_TRIANGLE_BACK_FACE + +" RayQuery enums +syn keyword shaderslangStateGroupVal COMMITTED_NOTHING COMMITTED_TRIANGLE_HIT COMMITTED_PROCEDURAL_PRIMITIVE_HIT +syn keyword shaderslangStateGroupVal CANDIDATE_NON_OPAQUE_TRIANGLE CANDIDATE_PROCEDURAL_PRIMITIVE + +" Heap objects +syn keyword shaderslangStateGroupVal ResourceDescriptorHeap SamplerDescriptorHeap + +" Work graph constants +syn keyword shaderslangStateGroupVal UAV_MEMORY GROUP_SHARED_MEMORY NODE_INPUT_MEMORY NODE_OUTPUT_MEMORY ALL_MEMORY GROUP_SYNC GROUP_SCOPE DEVICE_SCOPE + +syn case match " Case sensitive from now on + +" Effect files declarations and functions +" Effect groups, techniques passes +syn keyword shaderslangEffectGroup fxgroup technique11 pass +" Effect functions +syn keyword shaderslangEffectFunc SetBlendState SetDepthStencilState SetRasterizerState SetVertexShader SetHullShader SetDomainShader SetGeometryShader SetPixelShader SetComputeShader CompileShader ConstructGSWithSO SetRenderTargets + +" Default highlighting +hi def link shaderslangProfile shaderslangStatement +hi def link shaderslangStateGroupArg shaderslangStatement +hi def link shaderslangStateGroupVal Number +hi def link shaderslangStatement Statement +hi def link shaderslangType Type +hi def link shaderslangTypeDeprec WarningMsg +hi def link shaderslangStorageClass StorageClass +hi def link shaderslangSemantic PreProc +hi def link shaderslangFunc shaderslangStatement +hi def link shaderslangLayoutQual shaderslangFunc +hi def link shaderslangAnnotation PreProc +hi def link shaderslangStructure Structure +hi def link shaderslangSwizzle SpecialChar +hi def link shaderslangAttribute Statement + +hi def link shaderslangEffectGroup Type +hi def link shaderslangEffectFunc Statement + +let b:current_syntax = "shaderslang" diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 77a40e11d3..4f35bba939 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -3,7 +3,8 @@ " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Charles E. Campbell " Last Change: Apr 22, 2022 -" 2024 Feb 19 by Vim Project (announce adoption) +" 2024 Feb 19 by Vim Project: announce adoption +" 2025 Jan 18 by Vim Project: add texEmphStyle to texMatchGroup, #16228 " Version: 121 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " @@ -176,11 +177,11 @@ if !s:tex_excludematcher endif if !s:tex_nospell if !s:tex_no_error - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texEmphStyle,texZone,texInputFile,texOption,@Spell syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell else - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texEmphStyle,texZone,texInputFile,texOption,@Spell syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell endif diff --git a/runtime/syntax/tiasm.vim b/runtime/syntax/tiasm.vim new file mode 100644 index 0000000000..c79596bdfe --- /dev/null +++ b/runtime/syntax/tiasm.vim @@ -0,0 +1,102 @@ +" Vim syntax file +" Language: TI linear assembly language +" Document: https://downloads.ti.com/docs/esd/SPRUI03B/#SPRUI03B_HTML/assembler-description.html +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Last Change: 2025 Jan 08 + +if exists("b:current_syntax") + finish +endif + +syn case ignore + +" storage types +syn match tiasmType "\.bits" +syn match tiasmType "\.byte" +syn match tiasmType "\.char" +syn match tiasmType "\.cstring" +syn match tiasmType "\.double" +syn match tiasmType "\.field" +syn match tiasmType "\.float" +syn match tiasmType "\.half" +syn match tiasmType "\.int" +syn match tiasmType "\.long" +syn match tiasmType "\.short" +syn match tiasmType "\.string" +syn match tiasmType "\.ubyte" +syn match tiasmType "\.uchar" +syn match tiasmType "\.uhalf" +syn match tiasmType "\.uint" +syn match tiasmType "\.ulong" +syn match tiasmType "\.ushort" +syn match tiasmType "\.uword" +syn match tiasmType "\.word" + +syn match tiasmIdentifier "[a-z_][a-z0-9_]*" + +syn match tiasmDecimal "\<[1-9]\d*\>" display +syn match tiasmOctal "\<0[0-7][0-7]\+\>\|\<[0-7]\+[oO]\>" display +syn match tiasmHexadecimal "\<0[xX][0-9a-fA-F]\+\>\|\<[0-9][0-9a-fA-F]*[hH]\>" display +syn match tiasmBinary "\<0[bB][0-1]\+\>\|\<[01]\+[bB]\>" display + +syn match tiasmFloat "\<\d\+\.\d*\%(e[+-]\=\d\+\)\=\>" display +syn match tiasmFloat "\<\d\%(e[+-]\=\d\+\)\>" display + +syn match tiasmCharacter "'.'\|''\|'[^']'" + +syn region tiasmString start="\"" end="\"" skip="\"\"" + +syn match tiasmFunction "\$[a-zA-Z_][a-zA-Z_0-9]*\ze(" + +syn keyword tiasmTodo contained TODO FIXME XXX NOTE +syn region tiasmComment start=";" end="$" keepend contains=tiasmTodo,@Spell +syn match tiasmComment "^[*!].*" contains=tiasmTodo,@Spell +syn match tiasmLabel "^[^ *!;][^ :]*" + +syn match tiasmInclude "\.include" +syn match tiasmCond "\.if" +syn match tiasmCond "\.else" +syn match tiasmCond "\.endif" +syn match tiasmMacro "\.macro" +syn match tiasmMacro "\.endm" + +syn match tiasmDirective "\.[A-Za-z][0-9A-Za-z-_]*" + +syn case match + +hi def link tiasmLabel Label +hi def link tiasmComment Comment +hi def link tiasmTodo Todo +hi def link tiasmDirective Statement + +hi def link tiasmInclude Include +hi def link tiasmCond PreCondit +hi def link tiasmMacro Macro + +if exists('g:tiasm_legacy_syntax_groups') + hi def link hexNumber Number + hi def link decNumber Number + hi def link octNumber Number + hi def link binNumber Number + hi def link tiasmHexadecimal hexNumber + hi def link tiasmDecimal decNumber + hi def link tiasmOctal octNumber + hi def link tiasmBinary binNumber +else + hi def link tiasmHexadecimal Number + hi def link tiasmDecimal Number + hi def link tiasmOctal Number + hi def link tiasmBinary Number +endif +hi def link tiasmFloat Float + +hi def link tiasmString String +hi def link tiasmStringEscape Special +hi def link tiasmCharacter Character +hi def link tiasmCharacterEscape Special + +hi def link tiasmIdentifier Identifier +hi def link tiasmType Type +hi def link tiasmFunction Function + +let b:current_syntax = "tiasm" diff --git a/runtime/syntax/typst.vim b/runtime/syntax/typst.vim index dae1424780..b1f05ec853 100644 --- a/runtime/syntax/typst.vim +++ b/runtime/syntax/typst.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: Typst -" Maintainer: Gregory Anders <greg@gpanders.com> -" Last Change: 2024 Nov 02 +" Previous Maintainer: Gregory Anders +" Maintainer: Luca Saccarola <github.e41mv@aleeas.com> +" Last Change: 2024 Dec 09 " Based on: https://github.com/kaarmu/typst.vim if exists('b:current_syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 3ad04e2957..c4e231d145 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -60,10 +60,10 @@ syn case ignore syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo " Default highlighting groups {{{2 -syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC CursorIM LineNrAbove LineNrBelow +syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel ComplMatchIns Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC CursorIM LineNrAbove LineNrBelow syn match vimHLGroup contained "\<Conceal\>" syn keyword vimOnlyHLGroup contained Menu Scrollbar ToolbarButton ToolbarLine Tooltip VisualNOS -syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor TermCursorNC VisualNC Whitespace WinBar WinBarNC WinSeparator +syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor VisualNC Whitespace WinBar WinBarNC WinSeparator "}}}2 syn case match @@ -185,20 +185,20 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList -syn cluster vim9CmdList contains=vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var +syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 -syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand +syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand syn match vimBang contained "!" syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" @@ -207,7 +207,6 @@ syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" syn match vimVar "\s\zs&t_k;" syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in -syn match vimBang contained "!" syn cluster vimExprList contains=vimEnvvar,vimFunc,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar,@vim9ExprList syn cluster vim9ExprList contains=vim9Boolean,vim9Null @@ -275,9 +274,16 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@<!!" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "||\|&&\|[-+*/%.]" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "?" skipwhite nextgroup=@vimExprList +" distinguish ternary : from ex-colon +syn match vimOper "\s\@1<=:\ze\s\|\s\@1<=:$" skipwhite nextgroup=@vimExprList +syn match vimOper "??" skipwhite nextgroup=@vimExprList +syn match vimOper "=" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\<is\%(not\)\=\>" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\<is\%(not\)\=[?#]" skipwhite nextgroup=vimString,vimSpecFile syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") @@ -289,9 +295,9 @@ endif syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag -syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold -syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet -syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For +syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold +syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet,vimSearch +syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9Search syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -309,8 +315,8 @@ syn match vimFuncSID contained "\<[sg]:" syn keyword vimFuncKey contained fu[nction] syn keyword vimDefKey contained def -syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError contains=vimFuncParam,@vimContinue -syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError contains=vimDefParam,vim9Comment,vimFuncParamEquals +syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError contains=vimFuncParam,vimOperParen,@vimContinue +syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError contains=vimDefParam,vim9Comment,vimFuncParamEquals,vimOperParen syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals @@ -553,19 +559,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -678,10 +686,12 @@ syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod " Autocmd: {{{2 " ======= -syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent,nvimAutoEvent nextgroup=vimAutoCmdSpace +syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList +syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent,nvimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock -syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList +syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList @@ -1013,8 +1023,10 @@ syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== -syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim +VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained +Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim +syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 @@ -1275,6 +1287,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand hi def link vimAutoCmd vimCommand + hi def link vimAutoCmdBang vimBang hi def link vimAutoEvent Type hi def link vimAutoCmdMod Special hi def link vimBang vimOper @@ -1396,10 +1409,11 @@ if !exists("skip_vim_syntax_inits") hi def link vimPattern Type hi def link vimPlainMark vimMark hi def link vimPlainRegister vimRegister + hi def link vimQuoteEscape vimEscape hi def link vimRegister SpecialChar hi def link vimScriptDelim Comment - hi def link vimSearchDelim Statement hi def link vimSearch vimString + hi def link vimSearchDelim Delimiter hi def link vimSep Delimiter hi def link vimSet vimCommand hi def link vimSetAll vimOption @@ -1492,6 +1506,8 @@ if !exists("skip_vim_syntax_inits") hi def link vim9MethodNameError vimFunctionError hi def link vim9Null Constant hi def link vim9Public vimCommand + hi def link vim9Search vimString + hi def link vim9SearchDelim Delimiter hi def link vim9Static vimCommand hi def link vim9Super Identifier hi def link vim9This Identifier diff --git a/runtime/syntax/xf86conf.vim b/runtime/syntax/xf86conf.vim index e8162f3a35..0f4e5036ff 100644 --- a/runtime/syntax/xf86conf.vim +++ b/runtime/syntax/xf86conf.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: XF86Config (XFree86 configuration file) +" Maintainer: This runtime file is looking for a new maintainer. +" Last Change: 2025 Jan 06 by Jan-Arvid Harrach (#16397) " Former Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz> " Last Change By David: 2010 Nov 01 -" Last Change: 2023 Jan 23 -" Required Vim Version: 6.0 " " Options: let xf86conf_xfree86_version = 3 or 4 " to force XFree86 3.x or 4.x XF86Config syntax @@ -58,7 +58,7 @@ syn match xf86confModeLineValue "\"[^\"]\+\"\(\_s\+[0-9.]\+\)\{9}" nextgroup=xf8 " Sections and subsections if b:xf86conf_xfree86_version >= 4 - syn region xf86confSection matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,xf86confSectionError + syn region xf86confSection matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\|OutputClass\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,xf86confSectionError syn region xf86confSectionModule matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Module\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionAny,xf86confComment,xf86confOption,xf86confKeyword syn region xf86confSectionMonitor matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Monitor\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment,xf86confOption,xf86confKeyword syn region xf86confSectionModes matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Modes\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment @@ -162,7 +162,7 @@ syn match xf86confSync "\(\s\+[+-][CHV]_*Sync\)\+" contained " Synchronization if b:xf86conf_xfree86_version >= 4 - syn sync match xf86confSyncSection grouphere xf86confSection "^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\)\"" + syn sync match xf86confSyncSection grouphere xf86confSection "^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\|OutputClass\)\"" syn sync match xf86confSyncSectionModule grouphere xf86confSectionModule "^\s*Section\s\+\"Module\"" syn sync match xf86confSyncSectionModes groupthere xf86confSectionModes "^\s*Section\s\+\"Modes\"" else diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim index 084f8cdb41..04b39aeac0 100644 --- a/runtime/syntax/zsh.vim +++ b/runtime/syntax/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt <cb@256bit.org> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2022-07-26 +" Latest Revision: 2024 Jan 04 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -48,8 +48,9 @@ syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}' syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}' syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ - \ contains=zshQuoted,@zshDerefs,@zshSubstQuoted fold + \ contains=@Spell,zshQuoted,@zshDerefs,@zshSubstQuoted fold syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold + \ contains=@Spell syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ \ skip=+\\[\\']+ end=+'+ contains=zshPOSIXQuoted,zshQuoted syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' @@ -68,7 +69,7 @@ syn keyword zshConditional if then elif else fi esac select syn keyword zshCase case nextgroup=zshCaseWord skipwhite syn match zshCaseWord /\S\+/ nextgroup=zshCaseIn skipwhite contained transparent -syn keyword zshCaseIn in nextgroup=zshCasePattern skipwhite skipnl contained +syn keyword zshCaseIn in nextgroup=zshComment,zshCasePattern skipwhite skipnl contained syn match zshCasePattern /\S[^)]*)/ contained syn keyword zshRepeat while until repeat @@ -94,22 +95,24 @@ syn match zshRedir '|\@1<!|&\=|\@!' syn region zshHereDoc matchgroup=zshRedir \ start='<\@<!<<\s*\z([^<]\S*\)' - \ end='^\z1\>' - \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString + \ end='^\z1$' + \ contains=@Spell,@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString syn region zshHereDoc matchgroup=zshRedir \ start='<\@<!<<\s*\\\z(\S\+\)' - \ end='^\z1\>' - \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString + \ end='^\z1$' + \ contains=@Spell syn region zshHereDoc matchgroup=zshRedir \ start='<\@<!<<-\s*\\\=\z(\S\+\)' - \ end='^\s*\z1\>' - \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString + \ end='^\t*\z1$' + \ contains=@Spell syn region zshHereDoc matchgroup=zshRedir \ start=+<\@<!<<\s*\(["']\)\z(\S\+\)\1+ - \ end='^\z1\>' + \ end='^\z1$' + \ contains=@Spell syn region zshHereDoc matchgroup=zshRedir \ start=+<\@<!<<-\s*\(["']\)\z(\S\+\)\1+ - \ end='^\s*\z1\>' + \ end='^\t*\z1$' + \ contains=@Spell syn match zshVariable '\<\h\w*' contained |