Skip to content

Commit 4f88d97

Browse files
committed
Opt in to register aucmd for auto format and ast check.
1 parent 54c216e commit 4f88d97

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ftplugin/zig.vim

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ endif
5050
let b:undo_ftplugin =
5151
\ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
5252

53-
augroup vim-zig
54-
autocmd! * <buffer>
55-
autocmd BufWritePre <buffer> if get(g:, 'zig_fmt_autosave', 1) | call zig#fmt#Format() | endif
56-
augroup END
53+
if get(g:, 'zig_fmt_autosave', 0)
54+
augroup vim-zig
55+
autocmd! * <buffer>
56+
autocmd BufWritePre <buffer> call zig#fmt#Format()
57+
augroup END
58+
endif
5759

5860
let b:undo_ftplugin .= '|au! vim-zig * <buffer>'
5961

0 commit comments

Comments
 (0)