Merge pull request #107 from kristianhasselknippe/simple-emacs-setup

Added usage instructions for emacs
This commit is contained in:
Alexandros Naskos 2020-06-08 14:43:53 +03:00 committed by GitHub
commit ada79a944c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@ Zig Language Server, or `zls`, is a language server for Zig. The Zig wiki states
- [Sublime Text 3](#sublime-text-3)
- [Kate](#kate)
- [Neovim/Vim8](#neovimvim8)
- [Emacs](#emacs)
- [Related Projects](#related-projects)
- [License](#license)
@ -117,6 +118,21 @@ Install the `zls-vscode` extension from [here](https://github.com/zigtools/zls-v
}
```
### Emacs
- Install [lsp-mode](https://github.com/emacs-lsp/lsp-mode) from melpa
- [zig mode](https://github.com/ziglang/zig-mode) is also useful
```elisp
(require 'lsp)
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection "<path to zls>")
:major-modes '(zig-mode)
:server-id 'zls))
```
## Related Projects
- [`sublime-zig-language` by @prime31](https://github.com/prime31/sublime-zig-language)
- Supports basic language features