Skip to content

Commit fef560f

Browse files
committed
Update with a better UX plugin
1 parent 336540a commit fef560f

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

src/building/suggested.md

+7-18
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,14 @@ you can write: <!-- date-check: nov 2022 --><!-- the date comment is for the edi
5656
in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use
5757
`./x.py check` to check the sources, and the stage 0 rustfmt to format them.
5858

59+
There are several ways for configuring neovim for rustc. The easiest way is to use the plugin
60+
[neoconf.nvim](https://github.com/folke/neoconf.nvim/), which is compatible with VSCode (and
61+
other) config formats. To manage configuration files use the `:Neoconf local` command.
5962

60-
For Neovim users there are several options for configuring for rustc. The easiest way is by using
61-
[nlsp-settings](https://github.com/tamago324/nlsp-settings.nvim), which allows for project-local
62-
configuration files with the native LSP. The steps for how to use it are below.
63-
64-
1. First install the plugin
65-
2. Run `:LspSettings local rust_analyzer` while the rust repo is open.
66-
67-
This will create and open a JSON file to put the above JSON in.
68-
69-
3. Open a Rust buffer that causes Rust Analyzer to attach.
70-
4. Run `:LspSettings update rust_analyzer`
71-
72-
The final step must be repeated every time you open Neovim after you open a Rust buffer.
63+
If you're running `coc.nvim`, you can use `:CocLocalConfig` to create a
64+
`.vim/coc-settings.json` and enter the same settings as above, but replacing
65+
`editor.formatOnSave: true,` with
66+
`"coc.preferences.formatOnSaveFiletypes": ["rust"],`.
7367

7468
Another way is without a plugin, and creating your own logic in your configuration. The required
7569
Lua for doing so is below.
@@ -107,11 +101,6 @@ Lua for doing so is below.
107101
}
108102
```
109103

110-
If you're running `coc.nvim`, you can use `:CocLocalConfig` to create a
111-
`.vim/coc-settings.json` and enter the same settings as above, but replacing
112-
`editor.formatOnSave: true,` with
113-
`"coc.preferences.formatOnSaveFiletypes": ["rust"],`.
114-
115104
If you have enough free disk space and you would like to be able to run `x.py` commands while
116105
rust-analyzer runs in the background, you can also add `--build-dir build-rust-analyzer` to the
117106
`overrideCommand` to avoid x.py locking.

0 commit comments

Comments
 (0)