aboutsummaryrefslogtreecommitdiff
path: root/docs/user/manual.adoc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-01 18:20:53 +0000
committerGitHub <[email protected]>2021-02-01 18:20:53 +0000
commitc0d3e315e33e8d95d064bfe2c276858dd802fd0d (patch)
tree5edb4b869c26c167e53e3910dea2d4d4a043dcdb /docs/user/manual.adoc
parent4131e88bb7b62db5743cdf5a9ed01e3cababc5ea (diff)
parent84c324b3dd84a191defcc490a6308a5f5c16a7f5 (diff)
Merge #7509
7509: Improve nvim-lsp setup instructions r=lnicola a=lnicola bors r+ Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'docs/user/manual.adoc')
-rw-r--r--docs/user/manual.adoc35
1 files changed, 34 insertions, 1 deletions
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index 990b11859..10d4fd606 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -272,7 +272,40 @@ let g:ale_linters = {'rust': ['analyzer']}
272 272
273NeoVim 0.5 (not yet released) has built-in language server support. 273NeoVim 0.5 (not yet released) has built-in language server support.
274For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lspconfig#rust_analyzer[neovim/nvim-lspconfig]. 274For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lspconfig#rust_analyzer[neovim/nvim-lspconfig].
275Once `neovim/nvim-lspconfig` is installed, use `+lua require'nvim_lsp'.rust_analyzer.setup({})+` in your `init.vim`. 275Once `neovim/nvim-lspconfig` is installed, use `+lua require'lspconfig'.rust_analyzer.setup({})+` in your `init.vim`.
276
277You can also pass LSP settings to the server:
278
279[source,vim]
280----
281lua << EOF
282local nvim_lsp = require'lspconfig'
283
284local on_attach = function(client)
285 require'completion'.on_attach(client)
286end
287
288nvim_lsp.rust_analyzer.setup({
289 on_attach=on_attach,
290 settings = {
291 ["rust-analyzer"] = {
292 assist = {
293 importMergeBehavior = "last",
294 importPrefix = "by_self",
295 },
296 cargo = {
297 loadOutDirsFromCheck = true
298 },
299 procMacro = {
300 enable = true
301 },
302 }
303 }
304})
305EOF
306----
307
308See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started.
276 309
277=== Sublime Text 3 310=== Sublime Text 3
278 311