Vim configuration for Zig
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoload/zig
ftdetect
ftplugin
plugin
syntax
LICENSE
README.md

README.md

zig.vim

File detection and syntax highlighting for the zig programming language.

Installation

  • Use Vim 8 or newer
  • mkdir -p ~/.vim/pack/plugins/start/
  • cd ~/.vim/pack/plugins/start/
  • git clone https://github.com/ziglang/zig.vim

Configuration

To enable automatic formatting on save, follow these steps:

  • Build the zig stage 2 compiler.
  • Add the following configuration to your vimrc, where zig2 is the stage 2 compiler binary:
let g:zig_fmt_autosave = 1
let g:zig_fmt_command = ['zig2', 'fmt', '--color', 'off']