forked from ziglang/zig.vim
Vim configuration for Zig.
- Vim Script 100%
| autoload/zig |
Add ZON support to zig fmt integration
|
|
| compiler | Remove wrong escape in zig compiler files | |
| ftdetect | ftdetect zon files | |
| ftplugin | fix appending undo_ftplugin options | |
| indent | fix incorrect indentation after labeled block | |
| syntax |
add @SpirvType
|
|
| .mailmap |
Add .mailmap to repo root
|
|
| LICENSE | port files from zig | |
| README.md | Update README with zig_run compiler details | |
zig.vim
File detection and syntax highlighting for the zig programming language.
Installation
If using vim-plug (for Vim or Neovim)
- Open your vim config and add the following:
call plug#begin('~/.vim/plugged')
Plug 'https://codeberg.org/ziglang/zig.vim'
call plug#end()
- Restart vim / reload vim config
- type
:PlugInstall
If using Vim:
- Use Vim 8 or newer
mkdir -p ~/.vim/pack/plugins/start/cd ~/.vim/pack/plugins/start/git clone https://codeberg.org/ziglang/zig.vim
If using Neovim:
mkdir -p ~/.local/share/nvim/site/pack/plugins/start/cd ~/.local/share/nvim/site/pack/plugins/start/git clone https://codeberg.org/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 :compiler for details)
is zig_build when build.zig can be found upward in the directory structure
and is zig_build_exe otherwise. In total, the compiler options are:
:compiler zig_buildwhich runszig build.:compiler zig_testwhich runszig teston the current file.:compiler zig_build_exewhich runszig build-exeon the current file.:compiler zig_runwhich runszig runon the current file.:compiler zigwhich requires that a subcommand is passed as an argument and it runs on the current file.