Added Doom Emacs instructions to config

This commit is contained in:
Ominitay 2021-03-18 10:44:24 +00:00
parent 2db3c6f5a0
commit 88033a159f
No known key found for this signature in database
GPG Key ID: DD7CAB34AB04B8E2

View File

@ -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 "<path to zls>")
\\ :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!