From 88033a159f32cad6ce3a2d18ac34a175503ff754 Mon Sep 17 00:00:00 2001 From: Ominitay <37453713+Ominitay@users.noreply.github.com> Date: Thu, 18 Mar 2021 10:44:24 +0000 Subject: [PATCH] Added Doom Emacs instructions to config --- build.zig | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 51a1014..9c2e565 100644 --- a/build.zig +++ b/build.zig @@ -80,7 +80,7 @@ pub fn config(step: *std.build.Step) anyerror!void { std.debug.warn("Successfully saved configuration options!\n", .{}); - const editor = try zinput.askSelectOne("Which code editor do you use?", enum { VSCode, Sublime, Kate, Neovim, Vim8, Emacs, Other }); + const editor = try zinput.askSelectOne("Which code editor do you use?", enum { VSCode, Sublime, Kate, Neovim, Vim8, Emacs, Doom, Other }); std.debug.warn("\n", .{}); switch (editor) { @@ -155,6 +155,24 @@ pub fn config(step: *std.build.Step) anyerror!void { \\ :server-id 'zls)) , .{}); }, + .Doom => { + std.debug.warn( + \\To use ZLS in Doom Emacs, enable the lsp module + \\And install the zig mode (https://github.com/ziglang/zig-mode) package by adding `(package! zig-mode)` to your packages.el file. + \\ + \\(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 "") + \\ :major-modes '(zig-mode) + \\ :server-id 'zls))) + , .{}); + }, .Other => { std.debug.warn( \\We might not *officially* support your editor, but you can definitely still use ZLS!