|
5 | 5 | <!-- vim-markdown-toc GFM --> |
6 | 6 |
|
7 | 7 | * [Description](#description) |
8 | | -* [Requrement](#requrement) |
| 8 | +* [Install](#install) |
| 9 | +* [Manual Language Server Installation](#manual-language-server-installation) |
9 | 10 | * [Rust](#rust) |
10 | 11 | * [Python](#python) |
11 | 12 | * [Go](#go) |
|
14 | 15 | * [Haskell](#haskell) |
15 | 16 | * [Lua](#lua) |
16 | 17 | * [vue](#vue) |
17 | | -* [Install](#install) |
18 | 18 | * [Key Bindings](#key-bindings) |
19 | 19 | * [Related Projects](#related-projects) |
20 | 20 |
|
|
24 | 24 |
|
25 | 25 | This layer adds supports [Language Server Protocol](https://langserver.org/). |
26 | 26 |
|
27 | | -## Requrement |
| 27 | +## Install |
| 28 | + |
| 29 | +To use this configuration layer, add it to your `~/.spacevim`, set it up like so: |
| 30 | + |
| 31 | +```vim |
| 32 | +let g:spacevim_layers = [ |
| 33 | + \ 'lsp', |
| 34 | + \ ] |
| 35 | +``` |
| 36 | + |
| 37 | +Currently [LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim) is the default *language server client* when using the lsp layer. |
| 38 | + |
| 39 | +Currently the *language server client* builtin to Neovim is not supported by space-vim [#483](https://github.com/liuchengxu/space-vim/issues/483). |
| 40 | + |
| 41 | +To use [coc.nvim](https://github.com/neoclide/coc.nvim) or [vim-lsp](https://github.com/prabirshrestha/vim-lsp) instead of the default set `g:spacevim_lsp_engine` as desired: |
| 42 | + |
| 43 | +```vim |
| 44 | +let g:spacevim_layers = [ |
| 45 | + \ 'lsp', |
| 46 | + \ ] |
| 47 | +
|
| 48 | +let g:spacevim_lsp_engine = 'coc' |
| 49 | +let g:spacevim_lsp_engine = 'vim_lsp' |
| 50 | +``` |
| 51 | + |
| 52 | +Note that coc.nvim is dependent on Node.js, the nodejs layer will satisfy that dependency. |
| 53 | + |
| 54 | +If using vim-lsp as the *language server client*, this layer will handle the configuration and installation of many *language servers* for you (this layer includes the [vim-lsp-settings](https://github.com/mattn/vim-lsp-settings) plugin). On opening a file this layer will detect if there is a *language server* for that filetype and prompt you to run the command `:LspInstallServer`. |
| 55 | + |
| 56 | +Unlike other Vim *language server clients*, LanguageClient-neovim does not include configuration and installation of *language servers*. space-vim includes some configuration for *language servers* and this client, but installation must be done manually. |
| 57 | + |
| 58 | +Often the Yarn or npm tools are needed to retrieve a *language server* and its dependencies. For convenience space-vim includes these tools within the nodejs layer, which builds them or locates them using the `$PATH` and `$NODE` environmental variables. You may include the nodejs layer as follows (which may require the programming layer): |
| 59 | + |
| 60 | +```vim |
| 61 | +let g:spacevim_layers = [ |
| 62 | + \ 'programming', 'nodejs', 'lsp', |
| 63 | + \ ] |
| 64 | +``` |
| 65 | + |
| 66 | +## Manual Language Server Installation |
| 67 | + |
| 68 | +If using LanguageClient-neovim, directions for the manual installation of some LSP servers are as follows. Other configuration and installation directions can be found in locations like its github wiki pages. |
28 | 69 |
|
29 | 70 | ### Rust |
30 | 71 |
|
@@ -120,16 +161,6 @@ $ luarocks install --server=http://luarocks.org/dev lua-lsp |
120 | 161 | $ npm install vue-language-server -g |
121 | 162 | ``` |
122 | 163 |
|
123 | | -## Install |
124 | | - |
125 | | -To use this configuration layer, add it to your `~/.spacevim`. |
126 | | - |
127 | | -Currently, [LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim) is the default LS client. To use [coc.nvim](https://github.com/neoclide/coc.nvim) instead: |
128 | | - |
129 | | -```vim |
130 | | -let g:spacevim_lsp_engine = 'coc' |
131 | | -``` |
132 | | - |
133 | 164 | ## Key Bindings |
134 | 165 |
|
135 | 166 | Key Binding | Mode | Description |
|
0 commit comments