diff --git a/package.json b/package.json index 294e5545..1c6c7167 100644 --- a/package.json +++ b/package.json @@ -584,10 +584,14 @@ "language": "loremipsum", "path": "./snippets/loremipsum.json" }, - { - "language": "cmake", - "path": "./snippets/cmake.json" - } + { + "language": "cmake", + "path": "./snippets/cmake.json" + }, + { + "language": "zig", + "path": "./snippets/zig.json" + } ] } } diff --git a/snippets/zig.json b/snippets/zig.json new file mode 100644 index 00000000..7a06b3ee --- /dev/null +++ b/snippets/zig.json @@ -0,0 +1,29 @@ +{ + "Import": { + "prefix": "import", + "body": ["const ${1} = @import(\"${1}\")"], + "description": "Importing Librarys" + }, + "CImport": { + "prefix": "cimport", + "body": [ + "const c = @cImport({", + "@cDefine(\"${1}\")", + "});" + ], + "description": "Importing C Header Files" + }, + "buildExe": { + "prefix": "bExe", + "body": [ + "const exe = b.addExecutable(.{", + ".name = \"${1}",\", + ".root_source_file = b.path(\"${2: path}\"),", + ".target = target,", + ".optimize = optimize,", + "});", + "\n\n\n b.installArtifact(exe);", + ], + "description": "Building an exe" + } +}