Add usage for Doom Emacs.

All credit goes to @g-w1 for this :3
This commit is contained in:
Ominitay 2021-03-17 21:37:51 +00:00
parent 8c7a93fdf3
commit 29049bc467
No known key found for this signature in database
GPG Key ID: DD7CAB34AB04B8E2

View File

@ -14,6 +14,7 @@ Zig Language Server, or `zls`, is a language server for Zig. The Zig wiki states
- [Kate](#kate) - [Kate](#kate)
- [Neovim/Vim8](#neovimvim8) - [Neovim/Vim8](#neovimvim8)
- [Emacs](#emacs) - [Emacs](#emacs)
- [Doom Emacs](#doom-emacs)
- [Related Projects](#related-projects) - [Related Projects](#related-projects)
- [License](#license) - [License](#license)
@ -224,6 +225,25 @@ let g:LanguageClient_serverCommands = {
:server-id 'zls)) :server-id 'zls))
``` ```
### Doom Emacs
- Enable the `lsp` module
- Install the [zig-mode](https://github.com/zigland/zig-mode) package (add `(package! zig-mode)` to your `packages.el` file
```elisp
(require 'lsp)
(use-package! zig-mode
:hook ((zig-mode . lsp))
:custom (zig-format-on-save nil)
:init
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection "zls")
:major-modes '(zig-mode)
:server-id 'zls)))
```
## Related Projects ## Related Projects
- [`sublime-zig-language` by @prime31](https://github.com/prime31/sublime-zig-language) - [`sublime-zig-language` by @prime31](https://github.com/prime31/sublime-zig-language)