mirror of
https://github.com/oxalica/nil.git
synced 2025-12-23 09:19:49 +00:00
Add emacs lsp-mode documentation and fix typo (#47)
This commit is contained in:
parent
6aa1e29457
commit
cac705a233
2 changed files with 27 additions and 2 deletions
25
README.md
25
README.md
|
|
@ -107,6 +107,31 @@ if executable('nil')
|
|||
endif
|
||||
```
|
||||
|
||||
### Emacs with [`lsp-mode`]
|
||||
|
||||
[`lsp-mode`]: https://github.com/emacs-lsp/lsp-mode
|
||||
|
||||
Add the following elisp code to your configuration. (using `use-package`)
|
||||
|
||||
```elisp
|
||||
(use-package lsp-mode
|
||||
:ensure t)
|
||||
|
||||
(use-package lsp-nix
|
||||
:ensure lsp-mode
|
||||
:after (lsp-mode)
|
||||
:demand t
|
||||
:custom
|
||||
(lsp-nix-nil-formatter ["nixpkgs-fmt"]))
|
||||
|
||||
(use-package nix-mode
|
||||
:hook (nix-mode . lsp-deferred)
|
||||
:ensure t)
|
||||
```
|
||||
|
||||
There are various other configurations to tweak it. Refer the
|
||||
[specific manual page](https://emacs-lsp.github.io/lsp-mode/page/lsp-nix-nil/ "https://emacs-lsp.github.io/lsp-mode/page/lsp-nix-nil/") for more details.
|
||||
|
||||
### Emacs with [`eglot`]
|
||||
|
||||
[`eglot`]: https://github.com/joaotavora/eglot
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
## LSP Configuration
|
||||
|
||||
There are some tunable options and settings for `nil`.
|
||||
They are retrieved via LSP and support runtine modification.
|
||||
They are retrieved via LSP and support runtime modification.
|
||||
|
||||
All settings are nested under a key `"nil"`.
|
||||
For example, `formatting.command` means to write
|
||||
|
|
@ -24,7 +24,7 @@ The values shown here are the default values.
|
|||
// It should accepts file content in stdin and print the formatted code into stdout.
|
||||
// Type: [string] | null
|
||||
// Example: ["nixpkgs-fmt"]
|
||||
"command": null,
|
||||
"command": null,
|
||||
},
|
||||
"diagnostics": {
|
||||
// Ignored diagnostic kinds.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue