forked from doomemacs/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.org
More file actions
87 lines (67 loc) · 2.71 KB
/
Copy pathREADME.org
File metadata and controls
87 lines (67 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#+title: :lang zig
#+subtitle: C, but simpler
#+created: April 05, 2021
#+since: 21.12.0 (#4827)
* Description :unfold:
This module adds [[https://ziglang.org/][Zig]] support, with optional (but recommended) LSP support via
[[https://github.com/zigtools/zls][zls]].
- Syntax highlighting
- Syntax-checking ([[doom-package:flycheck]])
- Code completion and LSP integration (~zls~)
** Maintainers
- [[doom-user:][@bnjmnt4n]]
[[doom-contrib-maintainer:][Become a maintainer?]]
** Module flags
- +lsp ::
Enables integration for the zls LSP server. It is highly recommended you use
this.
- +tree-sitter ::
Leverages tree-sitter for better syntax highlighting and structural text
editing. Requires [[doom-module::tools tree-sitter]].
** Packages
- [[doom-package:zig-mode]]
** Hacks
/No hacks documented for this module./
** TODO Changelog
# This section will be machine generated. Don't edit it by hand.
/This module does not have a changelog yet./
* Installation
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
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
[[https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager][system package managers]].
=zls= is a language server for Zig, which provides code completion,
* TODO Usage
#+begin_quote
/This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote
** LSP support
This module supports LSP integration. For it to work you'll need:
1. zls installed,
2. The [[doom-module::tools lsp]] module enabled. Only [[doom-package:lsp-mode]] is supported for now,
3. The [[doom-module:+lsp]] flag on this module enabled.
** Keybinds
| Binding | Description |
|-------------------+---------------------|
| [[kbd:][<localleader> b]] | ~zig-compile~ |
| [[kbd:][<localleader> f]] | ~zig-format-buffer~ |
| [[kbd:][<localleader> r]] | ~zig-run~ |
| [[kbd:][<localleader> t]] | ~zig-test-buffer~ |
* TODO Configuration
#+begin_quote
/This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote
** Customize zls path
To customize the path of the =zls= executable, modify ~lsp-zig-zls-executable~:
#+begin_src emacs-lisp
;; in $DOOMDIR/config.el
(setq lsp-zig-zls-executable "~/path/to/zls")
#+end_src
* Troubleshooting
/There are no known problems with this module./ [[doom-report:][Report one?]]
* Frequently asked questions
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
* TODO Appendix
#+begin_quote
This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote