@@ -56,20 +56,14 @@ you can write: <!-- date-check: nov 2022 --><!-- the date comment is for the edi
56
56
in your ` .vscode/settings.json ` file. This will ask ` rust-analyzer ` to use
57
57
` ./x.py check ` to check the sources, and the stage 0 rustfmt to format them.
58
58
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.
59
62
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"], ` .
73
67
74
68
Another way is without a plugin, and creating your own logic in your configuration. The required
75
69
Lua for doing so is below.
@@ -107,11 +101,6 @@ Lua for doing so is below.
107
101
}
108
102
```
109
103
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
-
115
104
If you have enough free disk space and you would like to be able to run ` x.py ` commands while
116
105
rust-analyzer runs in the background, you can also add ` --build-dir build-rust-analyzer ` to the
117
106
` overrideCommand ` to avoid x.py locking.
0 commit comments