robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
7945732ed7
master
1" Vim filetype plugin file 2" Language: Zig 3" Maintainer: Mathias Lindgren <math.lindgren@gmail.com> 4" Last Change: 2024 Oct 04 5" 2026 Jun 27 by Vim Project (normalize recommended style guard) 6" Based on: https://codeberg.org/ziglang/zig.vim 7 8if exists ( "b:did_ftplugin" ) 9finish 10endif 11 12let b: did_ftplugin = 1 13 14let s: cpo_save = & cpo 15set cpo & vim 16 17" Match Zig builtin fns 18setlocal iskeyword += @-@ 19setlocal formatoptions -= tformatoptions += croql 20setlocal suffixesadd = .zig,.zir,.zon 21let & l: define = '\v(<fn>|<const>|<var>|^\s*\#\s*define)' 22let b: undo_ftplugin = 'setl isk< fo< sua< mp< def<' 23 24if get ( g:, 'zig_recommended_style' , 25 \get ( g:, 'filetype_recommended_style' , 1 )) 26setlocal expandtab 27setlocal tabstop = 8 28setlocal softtabstop = 4 29setlocal shiftwidth = 4 30let b: undo_ftplugin .= ' | setl et< ts< sts< sw<' 31endif 32 33if has ( 'comments' ) 34setlocal comments = :///,://!,:// 35setlocal commentstring = //\ %s 36let b: undo_ftplugin .= ' | setl com< cms<' 37endif 38 39if has ( 'find_in_path' ) 40let & l: includeexpr = 'substitute(v:fname, "^([^.])$", "\1.zig", "")' 41let & l: include = '\v(\@import>|\@cInclude>|^\s*\#\s*include)' 42let b: undo_ftplugin .= ' | setl inex< inc<' 43endif 44 45if exists ( 'g:zig_std_dir' ) 46let & l: path .= ',' . g: zig_std_dir 47let b: undo_ftplugin .= ' | setl pa<' 48endif 49 50if ! exists ( 'current_compiler' ) 51compiler zig_build 52let b: undo_ftplugin .= "| compiler make" 53endif 54 55let & cpo = s: cpo_save 56unlet s: cpo_save 57" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab