diff options
author | Francisco Lopes <[email protected]> | 2019-12-17 23:47:20 +0000 |
---|---|---|
committer | Francisco Lopes <[email protected]> | 2019-12-17 23:57:32 +0000 |
commit | f909d2b56c2f21c03beea2275d5e0d9052599302 (patch) | |
tree | c9ba05d96dacaabf193095886ddad013a780c579 /docs/user | |
parent | ee93fac7767d36ee91d5a0029bb58023765c72d5 (diff) |
Cleanup Vim and NeoVim instructions. Fix #2579
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/README.md | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/docs/user/README.md b/docs/user/README.md index 04c349342..9cdabfd42 100644 --- a/docs/user/README.md +++ b/docs/user/README.md | |||
@@ -135,37 +135,25 @@ to load path and require it in `init.el` | |||
135 | * (Optionally) bind commands like `rust-analyzer-join-lines`, `rust-analyzer-extend-selection` and `rust-analyzer-expand-macro` to keys, and enable `rust-analyzer-inlay-hints-mode` to get inline type hints | 135 | * (Optionally) bind commands like `rust-analyzer-join-lines`, `rust-analyzer-extend-selection` and `rust-analyzer-expand-macro` to keys, and enable `rust-analyzer-inlay-hints-mode` to get inline type hints |
136 | 136 | ||
137 | 137 | ||
138 | ## Vim and NeoVim | 138 | ## Vim and NeoVim (coc-rust-analyzer) |
139 | 139 | ||
140 | Neovim 0.5 has a built in language server. For a quick start configuration of | 140 | * Install coc.nvim by following the instructions at [coc.nvim][] (nodejs required) |
141 | rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp#rust_analyzer). | 141 | * Run `:CocInstall coc-rust-analyzer` to install [coc-rust-analyzer], this extension implements _most_ of the features supported in the VSCode extension: |
142 | Once `neovim/nvim-lsp` is installed, you can use `call nvim_lsp#setup("rust_analyzer", {})` | ||
143 | or `lua require'nvim_lsp'.rust_analyzer.setup({})` to quickly get set up. | ||
144 | |||
145 | * Install coc.nvim by following the instructions at [coc.nvim] | ||
146 | - You will need nodejs installed. | ||
147 | - You may want to include some of the sample vim configurations [from here][coc-vim-conf] | ||
148 | - Note that if you use a plugin manager other than `vim-plug`, you may need to manually | ||
149 | checkout the `release` branch wherever your plugin manager cloned it. Otherwise you will | ||
150 | get errors about a missing javascript file. | ||
151 | * Run `:CocInstall coc-rust-analyzer` to install [coc-rust-analyzer], this extension implemented _most_ of the features supported in the VSCode extension: | ||
152 | - same configurations as VSCode extension, `rust-analyzer.raLspServerPath`, `rust-analyzer.enableCargoWatchOnStartup` etc. | 142 | - same configurations as VSCode extension, `rust-analyzer.raLspServerPath`, `rust-analyzer.enableCargoWatchOnStartup` etc. |
153 | - same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.startCargoWatch` etc. | 143 | - same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.startCargoWatch` etc. |
154 | - highlighting and inlay_hints are not implemented yet | 144 | - highlighting and inlay_hints are not implemented yet |
155 | 145 | ||
156 | [coc.nvim]: https://github.com/neoclide/coc.nvim | 146 | [coc.nvim]: https://github.com/neoclide/coc.nvim |
157 | [coc-vim-conf]: https://github.com/neoclide/coc.nvim/#example-vim-configuration | ||
158 | [coc-rust-analyzer]: https://github.com/fannheyward/coc-rust-analyzer | 147 | [coc-rust-analyzer]: https://github.com/fannheyward/coc-rust-analyzer |
159 | 148 | ||
160 | ## Vim and NeoVim Alternative | 149 | ## Vim and NeoVim (LanguageClient-neovim) |
161 | 150 | ||
162 | * Install LanguageClient-neovim by following the instructions [here][lang-client-neovim] | 151 | * Install LanguageClient-neovim by following the instructions [here][lang-client-neovim] |
163 | - No extra run-time is required as this server is written in Rust | ||
164 | - The github project wiki has extra tips on configuration | 152 | - The github project wiki has extra tips on configuration |
165 | 153 | ||
166 | * Configure by adding this to your vim/neovim config file (replacing the existing rust specific line if it exists): | 154 | * Configure by adding this to your vim/neovim config file (replacing the existing rust specific line if it exists): |
167 | 155 | ||
168 | ``` | 156 | ```vim |
169 | let g:LanguageClient_serverCommands = { | 157 | let g:LanguageClient_serverCommands = { |
170 | \ 'rust': ['ra_lsp_server'], | 158 | \ 'rust': ['ra_lsp_server'], |
171 | \ } | 159 | \ } |
@@ -173,6 +161,13 @@ let g:LanguageClient_serverCommands = { | |||
173 | 161 | ||
174 | [lang-client-neovim]: https://github.com/autozimu/LanguageClient-neovim | 162 | [lang-client-neovim]: https://github.com/autozimu/LanguageClient-neovim |
175 | 163 | ||
164 | ## NeoVim (nvim-lsp) | ||
165 | |||
166 | NeoVim 0.5 (not yet released) has built in language server support. For a quick start configuration | ||
167 | of rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp#rust_analyzer). | ||
168 | Once `neovim/nvim-lsp` is installed, you can use `call nvim_lsp#setup("rust_analyzer", {})` | ||
169 | or `lua require'nvim_lsp'.rust_analyzer.setup({})` to quickly get set up. | ||
170 | |||
176 | 171 | ||
177 | ## Sublime Text 3 | 172 | ## Sublime Text 3 |
178 | 173 | ||