zig.vim (1304B)
1 " Vim compiler file 2 " Compiler: Zig Compiler 3 " Upstream: https://codeberg.org/ziglang/zig.vim 4 " Last Change: 5 " 2026 May 12 by the Vim project (set errormformat) 6 " 2026 May 24 by the Vim project (do not escape vars for makeprg) 7 8 if exists("current_compiler") 9 finish 10 endif 11 let current_compiler = "zig" 12 13 let s:save_cpo = &cpo 14 set cpo&vim 15 16 " a subcommand must be provided for the this compiler (test, build-exe, etc) 17 CompilerSet makeprg=zig\ $*\ %:S 18 19 CompilerSet errorformat= 20 \%-G, 21 \%-G\ %#+-\ %.%#, 22 \%-Ginstall, 23 \%-Ginstall\ transitive\ failure, 24 \%-Grun, 25 \%-Grun\ transitive\ failure, 26 \%-Gtest, 27 \%-Gtest\ transitive\ failure, 28 \%-Gfailed\ command:\ %.%#, 29 \%-Gerror:\ %*\\d\ compilation\ errors, 30 \%-GBuild\ Summary:\ %.%#, 31 \%-Gerror:\ the\ following\ build\ command\ failed\ with\ exit\ code\ %*\\d:, 32 \%-G.zig-cache%.%#, 33 \%E%f:%l:%c:\ error:\ %m, 34 \%I%f:%l:%c:\ note:\ %m 35 36 " zig has no warnings, but zig cc and zig c++ do 37 CompilerSet errorformat+= 38 \%W%f:%l:%c:\ warning:\ %m, 39 \%-G%*\\d\ warnings\ generated. 40 41 let &cpo = s:save_cpo 42 unlet s:save_cpo 43 " vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab