:lang zig

C, but simpler

1. Description

This module adds Zig support to Doom Emacs, with optional (but recommended) LSP support via zls.

  • Syntax highlighting
  • Syntax-checking (flycheck)
  • Code completion and LSP integration (zls)

1.1. Maintainers

1.2. Module flags

+lsp
Enable LSP support for zig-mode. Requires :tools lsp and a langserver (supports zls).

1.3. Packages

1.4. Hacks

No hacks documented for this module.

2. Prerequisites

To get started with Zig, you need the zig tool. Pre-built binaries for most systems are available for download from https://ziglang.org/download/ or from system package managers.

zls is a language server for Zig, which provides code completion,

2.1. LSP support

This module supports LSP. For it to work you’ll need:

  1. zls installed.
  2. The :tools lsp module enabled. Only lsp-mode is supported for now.
  3. The +lsp flag on this module enabled.

3. Usage

3.1. Keybinds

Binding Description
<localleader> b zig-compile
<localleader> f zig-format-buffer
<localleader> r zig-run
<localleader> t zig-test-buffer

4. TODO Configuration

This module’s configuration documentation is incomplete. Complete it?

4.1. Customize zls path

To customize the path of the zls executable, modify lsp-zig-zls-executable.

;; in $DOOMDIR/config.el
(setq lsp-zig-zls-executable "~/path/to/zls")

5. Troubleshooting

There are no known problems with this module. Report one?

6. TODO Appendix

This module has no appendix yet. Write one?