doomemacs/modules/lang/zig
Henrik Lissner a70e634ebd
refactor(:lang): move tree-sitter init
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
2022-07-25 17:34:44 +02:00
..
config.el refactor(:lang): move tree-sitter init 2022-07-25 17:34:44 +02:00
doctor.el docs(tree-sitter): add doc checks for langs 2022-06-17 20:08:42 +01:00
packages.el bump: :lang 2022-03-31 21:09:38 +02:00
README.org Update variable name in documentation 2021-04-05 16:49:39 +08:00

lang/zig

Description

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

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

Maintainers

Module Flags

  • +lsp Enables integration for the zls LSP server. It is highly recommended you use this.

Plugins

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,

Features

LSP support

This module supports LSP integration. 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.

Keybinds

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

Configuration

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")