Skip to content

Commit ef263ea

Browse files
committed
remove the zigVarDecl group which maps to Function
The previous mapping made no sense. The mapping of threadlocal and comptime will be changed in future commits. As a reference I used the builtin syntax highlighting from neovim for the following languages that have similar keywords to Zig's `var` and `const`: - Rust: `let` - Go: `var` - Javascript: `var`,`let`, `const` They all map their keywords to the Keyword syntax highlighting group.
1 parent f85dc5a commit ef263ea

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

syntax/zig.vim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ syntax keyword zigComparatorWord and or orelse
2323
syntax keyword zigStructure struct enum union error packed opaque
2424
syntax keyword zigException error
2525
syntax keyword zigStorageClass
26-
syntax keyword zigVarDecl var const comptime threadlocal
2726
syntax keyword zigDummyVariable _
28-
syntax keyword zigKeyword fn try test pub usingnamespace
27+
syntax keyword zigKeyword var const fn try test pub comptime usingnamespace
2928
syntax keyword zigExecution return break continue
3029
syntax keyword zigMacro defer errdefer async nosuspend await suspend resume export extern
31-
syntax keyword zigPreProc addrspace align asm callconv catch inline noalias noinline
30+
syntax keyword zigPreProc addrspace align asm callconv catch inline noalias noinline threadlocal
3231
syntax keyword zigBuiltinFn @addrSpaceCast @addWithOverflow @alignCast @alignOf @as @atomicLoad @atomicRmw @atomicStore @bitCast @bitOffsetOf @bitSizeOf @branchHint @breakpoint @mulAdd @byteSwap @bitReverse @offsetOf @call @cDefine @cImport @cInclude @clz @cmpxchgStrong @cmpxchgWeak @compileError @compileLog @constCast @ctz @cUndef @cVaArg @cVaCopy @cVaEnd @cVaStart @disableInstrumentation @disableIntrinsics @divExact @divFloor @divTrunc @embedFile @enumFromInt @errorFromInt @errorName @errorReturnTrace @errorCast @export @extern @field @fieldParentPtr @FieldType @floatCast @floatFromInt @frameAddress @hasDecl @hasField @import @inComptime @intCast @intFromBool @intFromEnum @intFromError @intFromFloat @intFromPtr @max @memcpy @memmove @memset @min @wasmMemorySize @wasmMemoryGrow @mod @mulWithOverflow @panic @popCount @prefetch @ptrCast @ptrFromInt @rem @returnAddress @select @setEvalBranchQuota @setFloatMode @setRuntimeSafety @shlExact @shlWithOverflow @shrExact @shuffle @sizeOf @splat @reduce @src @sqrt @sin @cos @tan @exp @exp2 @log @log2 @log10 @abs @floor @ceil @trunc @round @subWithOverflow @tagName @This @trap @truncate @Type @typeInfo @typeName @TypeOf @unionInit @Vector @volatileCast @workGroupId @workGroupSize @workItemId
3332

3433
syntax match zigType "\v<[iu][1-9]\d*>"
@@ -98,7 +97,6 @@ highlight default link zigConditional Conditional
9897
highlight default link zigComparatorWord Keyword
9998
highlight default link zigRepeat Repeat
10099
highlight default link zigSpecial Special
101-
highlight default link zigVarDecl Function
102100
highlight default link zigPreProc PreProc
103101
highlight default link zigException Exception
104102

0 commit comments

Comments
 (0)