spacemacs/layers/+lang/zig
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
..
README.org [bot] Auto-update (#14648) 2021-04-15 22:16:34 +02:00
config.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
funcs.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
layers.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
packages.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00

README.org

Zig layer

Description

This layer adds support for the zig programming language https://ziglang.org/

Features:

  • Syntax Highlighting
  • LSP support via zls (see LSP)

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add zig to the existing dotspacemacs-configuration-layers list in this file.

Choosing a backend

You can choose between multiple language backends. This choice defines mainly which kind of IDE features spacemacs can deliver.

Alternatively, if non is set the lsp backend will be automatically chosen if the layer lsp is used, otherwise zig-mode will be used.

For best results, make sure that the auto-completion and syntax-checking layers are enabled as well.

LSP (zls)

You can use zls">zls as a Language Server backend to add features like auto-completion, code navigation, formatting etc.

To do so, make sure you have the lsp layer in your dotspacemacs-configuration-layers. If necessary, upgrade the lsp-mode package (support for Zig was added in version 20210318.923). Install zls following the instructions on the Wiki and then configure the zls layer with the appropriate variable:

  (setq-default dotspacemacs-configuration-layers
    '((zig :variables
          zls-backend 'lsp)))

zig-mode

This mode provides support for the language with syntax highlighting, indentation and custom commands for compilation and testing.

For more information check the zig-mode repository">zig-mode repository.

Key bindings

LSP

You can find an overview of all the key bindings on the lsp layer description.