From 29049bc4671b0a7e4f4b5707adad48fc03aefd2b Mon Sep 17 00:00:00 2001 From: Ominitay <37453713+Ominitay@users.noreply.github.com> Date: Wed, 17 Mar 2021 21:37:51 +0000 Subject: [PATCH] Add usage for Doom Emacs. All credit goes to @g-w1 for this :3 --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index e74ee71..bc76698 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Zig Language Server, or `zls`, is a language server for Zig. The Zig wiki states - [Kate](#kate) - [Neovim/Vim8](#neovimvim8) - [Emacs](#emacs) + - [Doom Emacs](#doom-emacs) - [Related Projects](#related-projects) - [License](#license) @@ -224,6 +225,25 @@ let g:LanguageClient_serverCommands = { :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 - [`sublime-zig-language` by @prime31](https://github.com/prime31/sublime-zig-language)