Provides use zig function for use with zvm
Go to file
2024-10-31 14:13:22 -07:00
direnvrc fix zvm check 2024-10-31 14:10:32 -07:00
LICENSE initial commit - still requires hash 2024-10-31 14:04:56 -07:00
README.md finalize installation instructions in readme 2024-10-31 14:13:22 -07:00

zvm-direnv

A way to use zvm with direnv

Installing

Put the following lines in your .envrc:

if ! has zvm_direnv_version || ! zvm_direnv_version 1.0.0; then
  source_url "https://git.lerch.org/lobo/zvm-direnv/raw/tag/1.0.0/direnvrc" "sha256-Gtddvcr6aJsrjKd53uChxA1reQmJgEBpmPUWmMdtDIQ="
fi

Usage

$ echo "use zig 0.13.0" >> .envrc
$ direnv allow

If you haven't used direnv before, make sure to hook it into your shell first.

How it works

This implementation utilizes zvm for installation of both zig and zls. It avoids the use of zvm use as this will change the zig version system-wide, possibly resulting in some confusing behavior. Instead, it uses zvm to download the appropriate versions if necessary, then prepends the desired version to the path used in the direnv directory.