Merge pull request #253 from Ominitay/master

Doom Emacs Changes
This commit is contained in:
Alexandros Naskos 2021-03-18 13:36:26 +02:00 committed by GitHub
commit 3ad218b3ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -239,7 +239,7 @@ let g:LanguageClient_serverCommands = {
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig")) (add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
(lsp-register-client (lsp-register-client
(make-lsp-client (make-lsp-client
:new-connection (lsp-stdio-connection "zls") :new-connection (lsp-stdio-connection "<path to zls>")
:major-modes '(zig-mode) :major-modes '(zig-mode)
:server-id 'zls))) :server-id 'zls)))
``` ```

View File

@ -80,7 +80,7 @@ pub fn config(step: *std.build.Step) anyerror!void {
std.debug.warn("Successfully saved configuration options!\n", .{}); 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", .{}); std.debug.warn("\n", .{});
switch (editor) { switch (editor) {
@ -155,6 +155,24 @@ pub fn config(step: *std.build.Step) anyerror!void {
\\ :server-id 'zls)) \\ :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 => { .Other => {
std.debug.warn( std.debug.warn(
\\We might not *officially* support your editor, but you can definitely still use ZLS! \\We might not *officially* support your editor, but you can definitely still use ZLS!