Zift; configurable ZIg FormaTter

Hello.

This is just somethingI am planning to have fun with. I forked a couple of files from the Zig Standard Library to expose configuration options. Only indents for now, but I’d love ideas and contributions.

// zift.zon 
.{
	.indent = .tabs,
	// .indent = .{ .spaces = 4 }, // or any number up to 15.
}

It is currently configurable via a zift.zon file at working directory.

I am yet to wire it up to my editor.

4 Likes

cursed!

:heart_hands:

6 Likes

To set it up in Zed make sure it is in your PATH and add this to settings.json

"languages": {
	// other languages go here.
	"Zig": {
		"formatter": {
			"external": {
				"command": "zift",
				"arguments": ["--stdin"],
			},
		},
	}
},```