Skip to content

ziglang/zig.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Repository files navigation

zig.vim

File detection and syntax highlighting for the zigprogramming language.

Installation

If usingvim-plug(for Vim or Neovim)

  • Open vim config
  • WritePlug 'ziglang/zig.vim'inside theplugcommand:
callplug#begin('~/.vim/plugged')
Plug'ziglang/zig.vim'
callplug#end()
  • Restart vim / reload vim config
  • type:PlugInstall

If usingVim:

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

If usingNeovim:

  • mkdir -p ~/.local/share/nvim/site/pack/plugins/start/
  • cd ~/.local/share/nvim/site/pack/plugins/start/
  • git clone https://github.com/ziglang/zig.vim

Configuration

This plugin enables automatic code formatting on save by default using zig fmt.To disable it, you can use this configuration in vimrc:

let g:zig_fmt_autosave = 0

The default compiler which gets used by:make(:help:compilerfor details) iszig_buildand it runszig build.The other options are:

  • :compiler zig_testwhich runszig teston the current file.
  • :compiler zig_build_exewhich runszig build-exeon the current file.
  • :compiler zigwhich requires that a subcommand is passed as an argument and it runs on the current file.