ziglang / zig.vim

Vim configuration for Zig
MIT License
448 stars 56 forks source link

Move BufWrite autocmd to ftplugin #78

Closed gpanders closed 2 years ago

gpanders commented 2 years ago

Move the autocommand into the ftplugin, making it buffer local.

This also has the nice benefit of removing the need for the plugin file altogether, so now the zig.vim plugin does not execute any code unless a Zig buffer is explicitly opened (which is a good pattern for filetype plugins). This also clears the way for the Zig runtime files to be upstreamed to Vim itself (all filetype specific code needs to be in an ftplugin).

andrewrk commented 2 years ago

Thanks!