Skip to content

Commit 4f315b8

Browse files
authoredJun 12, 2020
Add vim-lsp instruction (hashicorp#153)
* docs: Add vim-lsp instruction * Group vim family and sort list alphabetically At the time of this writing, the vim-lsp and coc.nvim supports both vim8 and neovim each other (contrary to the intuition from the name).
1 parent a576e1b commit 4f315b8

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed
 

‎docs/USAGE.md

+36-16
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,27 @@ provides overlapping functionality (and more features at the time of writing).
3939
As a result having both enabled at the same time may result in suboptimal UX,
4040
such as duplicate completion candidates.
4141

42-
## NeoVim
42+
## Sublime Text 2
43+
44+
- Install the [LSP package](https://github.com/sublimelsp/LSP#installation)
45+
- Add the following snippet to your _User_ `LSP.sublime-settings` (editable via `Preferences → Package Settings → LSP → Settings` or via the command pallete → `Preferences: LSP Settings`)
46+
47+
```json
48+
{
49+
"clients": {
50+
"terraform": {
51+
"command": ["terraform-ls", "serve"],
52+
"enabled": true,
53+
"languageId": "terraform",
54+
"scopes": ["source.terraform"],
55+
"syntaxes": ["Packages/Terraform/Terraform.sublime-syntax"]
56+
}
57+
}
58+
}
59+
```
60+
61+
## Vim / NeoVim
62+
### coc.nvim
4363

4464
- Install the [coc.nvim plugin](https://github.com/neoclide/coc.nvim)
4565
- Add the following snippet to the `coc-setting.json` file (editable via `:CocConfig` in NeoVim)
@@ -68,23 +88,23 @@ Make sure to read through the [example vim configuration](https://github.com/neo
6888
inoremap <silent><expr> <c-space> coc#refresh()
6989
```
7090

71-
## Sublime Text 2
91+
### vim-lsp
7292

73-
- Install the [LSP package](https://github.com/sublimelsp/LSP#installation)
74-
- Add the following snippet to your _User_ `LSP.sublime-settings` (editable via `Preferences → Package Settings → LSP → Settings` or via the command pallete → `Preferences: LSP Settings`)
93+
- Install the following plugins:
94+
* [async.vim plugin](https://github.com/prabirshrestha/async.vim)
95+
* [vim-lsp plugin](https://github.com/prabirshrestha/vim-lsp)
96+
* [asyncomplete.vim plugin](https://github.com/prabirshrestha/asyncomplete.vim)
97+
* [asyncomplete-lsp.vim plugin](https://github.com/prabirshrestha/asyncomplete-lsp.vim)
98+
- Add the following to your `.vimrc`:
7599

76-
```json
77-
{
78-
"clients": {
79-
"terraform": {
80-
"command": ["terraform-ls", "serve"],
81-
"enabled": true,
82-
"languageId": "terraform",
83-
"scopes": ["source.terraform"],
84-
"syntaxes": ["Packages/Terraform/Terraform.sublime-syntax"]
85-
}
86-
}
87-
}
100+
```vim
101+
if executable('terraform-ls')
102+
au User lsp_setup call lsp#register_server({
103+
\ 'name': 'terraform-ls',
104+
\ 'cmd': {server_info->['terraform-ls', 'serve']},
105+
\ 'whitelist': ['terraform'],
106+
\ })
107+
endif
88108
```
89109

90110
## VS Code

0 commit comments

Comments
 (0)
Please sign in to comment.