Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zed_odin_template

A starting point for Odin projects in Zed. It includes build tasks, clickable compiler errors, OLS settings, formatting, tests, and a debugger configuration.

Requirements

  • Odin on your PATH
  • Zed with the Odin extension installed

Install the extension from zed: extensions. It downloads OLS automatically. The project still builds without the extension, but editor integration will not work.

Quick start

./build.sh          # debug build
./build.sh release  # optimized build
./build/debug/app

In Zed, run task: spawn and pick odin: build & run.

Tasks

Task What it does
odin: build & run Builds and runs the debug binary
odin: build (debug) Builds with -debug -o:none
odin: build (release) Builds with -o:speed -no-bounds-check
odin: check Type checks without producing a binary
odin: test Runs every @(test) procedure in src

Debugging

.zed/debug.json launches build/debug/app with CodeLLDB. Run a debug build first. The debugger does not build the binary and will otherwise launch a stale file or fail because the file does not exist.

Layout

build.sh            build script
ols.json            language server settings
odinfmt.json        formatter settings
src/                project code and an example test
.zed/tasks.json     build and run tasks
.zed/settings.json  editor and OLS settings
.zed/debug.json     debugger launch configuration

build/ is generated and ignored by Git.

Odin prints errors as path/main.odin(12:5). build.sh rewrites them as path/file.odin:12:5 so Zed makes the locations clickable.

Adapting the template

The output binary is named app. That name appears in build.sh, .zed/tasks.json, and .zed/debug.json. Change all three together.

src/main_test.odin shows how the test task is wired. Delete it after adding real tests.

Verified versions

Tool Version
Odin dev-2026-07:301c287de
Zed 1.12.1
Zed Odin extension 0.3.15

Odin development builds move quickly. Check the compiler version first if a newer build breaks the template.

About

Odin project template for Zed with build tasks, clickable errors, OLS, and CodeLLDB debugging

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages