Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
zig.vim298 linesDownload Raw Back to syntax
1" Vim syntax file2" Language: Zig3" Upstream: https://github.com/ziglang/zig.vim4 5if exists("b:current_syntax")6  finish7endif8 9let s:cpo_save = &cpo10set cpo&vim11 12let s:zig_syntax_keywords = {13    \   'zigBoolean': ["true"14    \ ,                "false"]15    \ , 'zigNull': ["null"]16    \ , 'zigType': ["bool"17    \ ,             "f16"18    \ ,             "f32"19    \ ,             "f64"20    \ ,             "f80"21    \ ,             "f128"22    \ ,             "void"23    \ ,             "type"24    \ ,             "anytype"25    \ ,             "anyerror"26    \ ,             "anyframe"27    \ ,             "volatile"28    \ ,             "linksection"29    \ ,             "noreturn"30    \ ,             "allowzero"31    \ ,             "i0"32    \ ,             "u0"33    \ ,             "isize"34    \ ,             "usize"35    \ ,             "comptime_int"36    \ ,             "comptime_float"37    \ ,             "c_char"38    \ ,             "c_short"39    \ ,             "c_ushort"40    \ ,             "c_int"41    \ ,             "c_uint"42    \ ,             "c_long"43    \ ,             "c_ulong"44    \ ,             "c_longlong"45    \ ,             "c_ulonglong"46    \ ,             "c_longdouble"47    \ ,             "anyopaque"]48    \ , 'zigConstant': ["undefined"49    \ ,                 "unreachable"]50    \ , 'zigConditional': ["if"51    \ ,                    "else"52    \ ,                    "switch"]53    \ , 'zigRepeat': ["while"54    \ ,               "for"]55    \ , 'zigComparatorWord': ["and"56    \ ,                       "or"57    \ ,                       "orelse"]58    \ , 'zigStructure': ["struct"59    \ ,                  "enum"60    \ ,                  "union"61    \ ,                  "error"62    \ ,                  "packed"63    \ ,                  "opaque"]64    \ , 'zigException': ["error"]65    \ , 'zigVarDecl': ["var"66    \ ,                "const"67    \ ,                "comptime"68    \ ,                "threadlocal"]69    \ , 'zigDummyVariable': ["_"]70    \ , 'zigKeyword': ["fn"71    \ ,                "try"72    \ ,                "test"73    \ ,                "pub"74    \ ,                "usingnamespace"]75    \ , 'zigExecution': ["return"76    \ ,                  "break"77    \ ,                  "continue"]78    \ , 'zigMacro': ["defer"79    \ ,              "errdefer"80    \ ,              "async"81    \ ,              "nosuspend"82    \ ,              "await"83    \ ,              "suspend"84    \ ,              "resume"85    \ ,              "export"86    \ ,              "extern"]87    \ , 'zigPreProc': ["catch"88    \ ,                "inline"89    \ ,                "noinline"90    \ ,                "asm"91    \ ,                "callconv"92    \ ,                "noalias"]93    \ , 'zigBuiltinFn': ["align"94    \ ,                  "@addWithOverflow"95    \ ,                  "@as"96    \ ,                  "@atomicLoad"97    \ ,                  "@atomicStore"98    \ ,                  "@bitCast"99    \ ,                  "@breakpoint"100    \ ,                  "@trap"101    \ ,                  "@alignCast"102    \ ,                  "@alignOf"103    \ ,                  "@cDefine"104    \ ,                  "@cImport"105    \ ,                  "@cInclude"106    \ ,                  "@cUndef"107    \ ,                  "@clz"108    \ ,                  "@cmpxchgWeak"109    \ ,                  "@cmpxchgStrong"110    \ ,                  "@compileError"111    \ ,                  "@compileLog"112    \ ,                  "@constCast"113    \ ,                  "@ctz"114    \ ,                  "@popCount"115    \ ,                  "@divExact"116    \ ,                  "@divFloor"117    \ ,                  "@divTrunc"118    \ ,                  "@embedFile"119    \ ,                  "@export"120    \ ,                  "@extern"121    \ ,                  "@tagName"122    \ ,                  "@TagType"123    \ ,                  "@errorName"124    \ ,                  "@call"125    \ ,                  "@errorReturnTrace"126    \ ,                  "@fence"127    \ ,                  "@fieldParentPtr"128    \ ,                  "@field"129    \ ,                  "@unionInit"130    \ ,                  "@frameAddress"131    \ ,                  "@import"132    \ ,                  "@inComptime"133    \ ,                  "@newStackCall"134    \ ,                  "@asyncCall"135    \ ,                  "@ptrFromInt"136    \ ,                  "@max"137    \ ,                  "@min"138    \ ,                  "@memcpy"139    \ ,                  "@memset"140    \ ,                  "@mod"141    \ ,                  "@mulAdd"142    \ ,                  "@mulWithOverflow"143    \ ,                  "@splat"144    \ ,                  "@src"145    \ ,                  "@bitOffsetOf"146    \ ,                  "@byteOffsetOf"147    \ ,                  "@offsetOf"148    \ ,                  "@OpaqueType"149    \ ,                  "@panic"150    \ ,                  "@prefetch"151    \ ,                  "@ptrCast"152    \ ,                  "@intFromPtr"153    \ ,                  "@rem"154    \ ,                  "@returnAddress"155    \ ,                  "@setCold"156    \ ,                  "@Type"157    \ ,                  "@shuffle"158    \ ,                  "@reduce"159    \ ,                  "@select"160    \ ,                  "@setRuntimeSafety"161    \ ,                  "@setEvalBranchQuota"162    \ ,                  "@setFloatMode"163    \ ,                  "@shlExact"164    \ ,                  "@This"165    \ ,                  "@hasDecl"166    \ ,                  "@hasField"167    \ ,                  "@shlWithOverflow"168    \ ,                  "@shrExact"169    \ ,                  "@sizeOf"170    \ ,                  "@bitSizeOf"171    \ ,                  "@sqrt"172    \ ,                  "@byteSwap"173    \ ,                  "@subWithOverflow"174    \ ,                  "@intCast"175    \ ,                  "@floatCast"176    \ ,                  "@floatFromInt"177    \ ,                  "@intFromFloat"178    \ ,                  "@intFromBool"179    \ ,                  "@errorCast"180    \ ,                  "@truncate"181    \ ,                  "@typeInfo"182    \ ,                  "@typeName"183    \ ,                  "@TypeOf"184    \ ,                  "@atomicRmw"185    \ ,                  "@errorFromInt"186    \ ,                  "@intFromError"187    \ ,                  "@enumFromInt"188    \ ,                  "@intFromEnum"189    \ ,                  "@setAlignStack"190    \ ,                  "@frame"191    \ ,                  "@Frame"192    \ ,                  "@frameSize"193    \ ,                  "@bitReverse"194    \ ,                  "@Vector"195    \ ,                  "@volatileCast"196    \ ,                  "@sin"197    \ ,                  "@cos"198    \ ,                  "@tan"199    \ ,                  "@exp"200    \ ,                  "@exp2"201    \ ,                  "@log"202    \ ,                  "@log2"203    \ ,                  "@log10"204    \ ,                  "@abs"205    \ ,                  "@floor"206    \ ,                  "@ceil"207    \ ,                  "@trunc"208    \ ,                  "@wasmMemorySize"209    \ ,                  "@wasmMemoryGrow"210    \ ,                  "@round"]211    \ }212 213function! s:syntax_keyword(dict)214  for key in keys(a:dict)215    execute 'syntax keyword' key join(a:dict[key], ' ')216  endfor217endfunction218 219call s:syntax_keyword(s:zig_syntax_keywords)220 221syntax match zigType "\v<[iu][1-9]\d*>"222syntax match zigOperator display "\V\[-+/*=^&?|!><%~]"223syntax match zigArrowCharacter display "\V->"224 225"                                     12_34  (. but not ..)? (12_34)?     (exponent  12_34)?226syntax match zigDecNumber display   "\v<\d%(_?\d)*%(\.\.@!)?%(\d%(_?\d)*)?%([eE][+-]?\d%(_?\d)*)?"227syntax match zigHexNumber display "\v<0x\x%(_?\x)*%(\.\.@!)?%(\x%(_?\x)*)?%([pP][+-]?\d%(_?\d)*)?"228syntax match zigOctNumber display "\v<0o\o%(_?\o)*"229syntax match zigBinNumber display "\v<0b[01]%(_?[01])*"230 231syntax match zigCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/232syntax match zigCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/233syntax match zigCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=zigEscape,zigEscapeError,zigCharacterInvalid,zigCharacterInvalidUnicode234syntax match zigCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{6}\)\)'/ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigCharacterInvalid235 236syntax region zigBlock start="{" end="}" transparent fold237 238syntax region zigCommentLine start="//" end="$" contains=zigTodo,@Spell239syntax region zigCommentLineDoc start="//[/!]/\@!" end="$" contains=zigTodo,@Spell240 241syntax match zigMultilineStringPrefix /c\?\\\\/ contained containedin=zigMultilineString242syntax region zigMultilineString matchgroup=zigMultilineStringDelimiter start="c\?\\\\" end="$" contains=zigMultilineStringPrefix display243 244syntax keyword zigTodo contained TODO245 246syntax region zigString matchgroup=zigStringDelimiter start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zigEscape,zigEscapeUnicode,zigEscapeError,@Spell247syntax match zigEscapeError   display contained /\\./248syntax match zigEscape        display contained /\\\([nrt\\'"]\|x\x\{2}\)/249syntax match zigEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/250 251highlight default link zigDecNumber zigNumber252highlight default link zigHexNumber zigNumber253highlight default link zigOctNumber zigNumber254highlight default link zigBinNumber zigNumber255 256highlight default link zigBuiltinFn Statement257highlight default link zigKeyword Keyword258highlight default link zigType Type259highlight default link zigCommentLine Comment260highlight default link zigCommentLineDoc Comment261highlight default link zigDummyVariable Comment262highlight default link zigTodo Todo263highlight default link zigString String264highlight default link zigStringDelimiter String265highlight default link zigMultilineString String266highlight default link zigMultilineStringContent String267highlight default link zigMultilineStringPrefix String268highlight default link zigMultilineStringDelimiter Delimiter269highlight default link zigCharacterInvalid Error270highlight default link zigCharacterInvalidUnicode zigCharacterInvalid271highlight default link zigCharacter Character272highlight default link zigEscape Special273highlight default link zigEscapeUnicode zigEscape274highlight default link zigEscapeError Error275highlight default link zigBoolean Boolean276highlight default link zigNull Boolean277highlight default link zigConstant Constant278highlight default link zigNumber Number279highlight default link zigArrowCharacter zigOperator280highlight default link zigOperator Operator281highlight default link zigStructure Structure282highlight default link zigExecution Special283highlight default link zigMacro Macro284highlight default link zigConditional Conditional285highlight default link zigComparatorWord Keyword286highlight default link zigRepeat Repeat287highlight default link zigSpecial Special288highlight default link zigVarDecl Function289highlight default link zigPreProc PreProc290highlight default link zigException Exception291 292delfunction s:syntax_keyword293 294let b:current_syntax = "zig"295 296let &cpo = s:cpo_save297unlet! s:cpo_save298 
codekingpro/portable-devtools · Team Ai