Skip to content

Commit 3843d35

Browse files
committed
Simplify Neovim installation instruction
Users don't have to interact with low-level `nvim.lsp` API anymore, they can use the official `nvim-lspconfig` I'd love to merge neovim.md directly into the README, but given these lines: > You can find a standalone LSP launch script in kotlin-lsp.sh along with > very experimental (aka "works on someone's machine") instructions that > setup LSP for other editors in scripts folder. See ./kotlin-lsp.sh > --help for available options. I don't dare to do so
1 parent c3e6187 commit 3843d35

File tree

1 file changed

+4
-43
lines changed

1 file changed

+4
-43
lines changed

scripts/neovim.md

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,5 @@
1-
# neovim setup
1+
# Neovim setup
22

3-
## stdio way
4-
5-
1. Ensure socat and netcat are installed
6-
7-
2. Ensure `kotlin-lsp.sh` is executable
8-
9-
```sh
10-
chmod +x $KOTLIN_LSP_DIR/kotlin-lsp.sh
11-
```
12-
13-
3. Create a symlink inside your `PATH` to `kotlin-lsp.sh` script, e.g.:
14-
15-
```sh
16-
ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-lsp
17-
```
18-
19-
4. Configure [nvim.lsp](https://neovim.io/doc/user/lsp.html) e.g:
20-
```lua
21-
{
22-
cmd = { "kotlin-lsp", "--stdio" },
23-
single_file_support = true,
24-
filetypes = { "kotlin" },
25-
root_markers = { "build.gradle", "build.gradle.kts", "pom.xml" },
26-
}
27-
```
28-
29-
## tcp way
30-
31-
Requires manual launch of language server
32-
33-
1. launch language server with `kotlin-lsp.sh` script
34-
35-
2. Configure [nvim.lsp](https://neovim.io/doc/user/lsp.html) e.g:
36-
```lua
37-
{
38-
cmd = vim.lsp.rpc.connect('127.0.0.1', tonumber(9999)),
39-
single_file_support = true,
40-
filetypes = { "kotlin" },
41-
root_markers = { "build.gradle", "build.gradle.kts", "pom.xml" },
42-
}
43-
```
44-
3+
1. [Install `kotlin-lsp` CLI](../README.md#install-kotlin-lsp-cli)
4+
2. Install the official Neovim [`nvim-lspconfig` plugin](https://github.com/neovim/nvim-lspconfig)
5+
3. Enable the LSP `vim.lsp.enable('kotlin_lsp')`

0 commit comments

Comments
 (0)