Merge pull request #252 from Ominitay/master

Add usage for Doom Emacs.
This commit is contained in:
Auguste Rame 2021-03-17 17:57:09 -04:00 committed by GitHub
commit 92831bedf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)