Later edit:
Thanks all, here it is what I did:
I put the example linked by Justus (thanks) in main.zig
I did zig fetch as instructed here: GitHub - rockorager/libvaxis: a modern tui library written in zig
elbci@localhost:~/Documents/ZIG/BridgeSeek> zig fetch --save git+https://github.com/rockorager/libvaxis.git
info: resolved to commit 95b167909f8aaec7f9b2315e6a1f64d9a48afe9b
I replaced in my build.zig (autogenerated by zig init)
const exe = b.addExecutable(.{
.name = "BridgeSeek",
.root_module = b.createModule(.{
// b.createModule defines a new module just like b.addModule but,
// unlike b.addModule, it does not expose the module to consumers of
// this package, which is why in this case we don't have to give it a name.
.root_source_file = b.path("src/main.zig"),
// Target and optimization levels must be explicitly wired in when
// defining an executable or library (in the root module), and you
// can also hardcode a specific target for an executable or library
// definition if desireable (e.g. firmware for embedded devices).
.target = target,
.optimize = optimize,
// List of modules available for import in source files part of the
// root module.
.imports = &.{
// Here "BridgeSeek" is the name you will use in your source code to
// import this module (e.g. `@import("BridgeSeek")`). The name is
// repeated because you are allowed to rename your imports, which
// can be extremely useful in case of collisions (which can happen
// importing modules from different packages).
.{ .name = "BridgeSeek", .module = mod },
},
}),
});
with
// // NEW CODE //////////////////////////////////
// Create a module for the executable (for ZLS support)
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
// Add vaxis dependency to the module
const vaxis = b.dependency("vaxis", .{
.target = target,
.optimize = optimize,
});
exe_mod.addImport("vaxis", vaxis.module("vaxis"));
// Create executable using this module
const exe = b.addExecutable(.{
.name = "BridgeSeek",
.root_module = exe_mod,
});
// // END NEW CODE /////////////////////////////////////////////
Now the code compiles and runs with zig build run.