Merge pull request #255 from bnjmnt4n/docs/emacs
Emacs: update setup instructions
This commit is contained in:
commit
4198edbdaa
31
README.md
31
README.md
@ -216,13 +216,12 @@ let g:LanguageClient_serverCommands = {
|
|||||||
- [zig mode](https://github.com/ziglang/zig-mode) is also useful
|
- [zig mode](https://github.com/ziglang/zig-mode) is also useful
|
||||||
|
|
||||||
```elisp
|
```elisp
|
||||||
(require 'lsp)
|
;; Setup lsp-mode as desired.
|
||||||
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
|
;; See https://emacs-lsp.github.io/lsp-mode/page/installation/ for more information.
|
||||||
(lsp-register-client
|
(require 'lsp-mode)
|
||||||
(make-lsp-client
|
|
||||||
:new-connection (lsp-stdio-connection "<path to zls>")
|
;; Either place zls in your PATH or add the following:
|
||||||
:major-modes '(zig-mode)
|
(setq lsp-zig-zls-executable "<path to zls>")
|
||||||
:server-id 'zls))
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Doom Emacs
|
### Doom Emacs
|
||||||
@ -231,17 +230,17 @@ let g:LanguageClient_serverCommands = {
|
|||||||
- Install the [zig-mode](https://github.com/ziglang/zig-mode) package (add `(package! zig-mode)` to your `packages.el` file
|
- Install the [zig-mode](https://github.com/ziglang/zig-mode) package (add `(package! zig-mode)` to your `packages.el` file
|
||||||
|
|
||||||
```elisp
|
```elisp
|
||||||
(require 'lsp)
|
|
||||||
(use-package! zig-mode
|
(use-package! zig-mode
|
||||||
:hook ((zig-mode . lsp))
|
:hook ((zig-mode . lsp-deferred))
|
||||||
:custom (zig-format-on-save nil)
|
:custom (zig-format-on-save nil)
|
||||||
:init
|
:config
|
||||||
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
|
(after! lsp-mode
|
||||||
(lsp-register-client
|
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
|
||||||
(make-lsp-client
|
(lsp-register-client
|
||||||
:new-connection (lsp-stdio-connection "<path to zls>")
|
(make-lsp-client
|
||||||
:major-modes '(zig-mode)
|
:new-connection (lsp-stdio-connection "<path to zls>")
|
||||||
:server-id 'zls)))
|
:major-modes '(zig-mode)
|
||||||
|
:server-id 'zls))))
|
||||||
```
|
```
|
||||||
|
|
||||||
## Related Projects
|
## Related Projects
|
||||||
|
29
build.zig
29
build.zig
@ -146,31 +146,26 @@ pub fn config(step: *std.build.Step) anyerror!void {
|
|||||||
\\Zig mode (https://github.com/ziglang/zig-mode) is also useful!
|
\\Zig mode (https://github.com/ziglang/zig-mode) is also useful!
|
||||||
\\Then, add the following to your emacs config:
|
\\Then, add the following to your emacs config:
|
||||||
\\
|
\\
|
||||||
\\(require 'lsp)
|
\\(require 'lsp-mode)
|
||||||
\\(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
|
\\(setq lsp-zig-zls-executable "<path to zls>")
|
||||||
\\(lsp-register-client
|
|
||||||
\\ (make-lsp-client
|
|
||||||
\\ :new-connection (lsp-stdio-connection "<path to zls>")
|
|
||||||
\\ :major-modes '(zig-mode)
|
|
||||||
\\ :server-id 'zls))
|
|
||||||
, .{});
|
, .{});
|
||||||
},
|
},
|
||||||
.Doom => {
|
.Doom => {
|
||||||
std.debug.warn(
|
std.debug.warn(
|
||||||
\\To use ZLS in Doom Emacs, enable the lsp module
|
\\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.
|
\\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
|
\\(use-package! zig-mode
|
||||||
\\ :hook ((zig-mode . lsp))
|
\\ :hook ((zig-mode . lsp-deferred))
|
||||||
\\ :custom (zig-format-on-save nil)
|
\\ :custom (zig-format-on-save nil)
|
||||||
\\ :init
|
\\ :config
|
||||||
\\ (add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
|
\\ (after! lsp-mode
|
||||||
\\ (lsp-register-client
|
\\ (add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
|
||||||
\\ (make-lsp-client
|
\\ (lsp-register-client
|
||||||
\\ :new-connection (lsp-stdio-connection "<path to zls>")
|
\\ (make-lsp-client
|
||||||
\\ :major-modes '(zig-mode)
|
\\ :new-connection (lsp-stdio-connection "<path to zls>")
|
||||||
\\ :server-id 'zls)))
|
\\ :major-modes '(zig-mode)
|
||||||
|
\\ :server-id 'zls))))
|
||||||
, .{});
|
, .{});
|
||||||
},
|
},
|
||||||
.Other => {
|
.Other => {
|
||||||
|
Loading…
Reference in New Issue
Block a user