Skip to content

Commit 05ce286

Browse files
committed
Add Kakoune and Helix configuration
1 parent 61cb76b commit 05ce286

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

manual.adoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,40 @@ Then click on apply, and restart the LSP server for your rust project.
427427

428428
https://gitlab.com/cppit/jucipp[juCi++] has built-in support for the language server protocol, and since version 1.7.0 offers installation of both Rust and rust-analyzer when opening a Rust file.
429429

430+
=== Kakoune
431+
432+
https://kakoune.org/[Kakoune] editor support LSP with the help of https://github.com/kak-lsp/kak-lsp[`kak-lsp`].
433+
Follow the https://github.com/kak-lsp/kak-lsp#installation[instructions] to install `kak-lsp`.
434+
To configure `kak-lsp`, refer to the https://github.com/kak-lsp/kak-lsp#configuring-kak-lsp[configuration section] which is basically about copying the https://github.com/kak-lsp/kak-lsp/blob/master/kak-lsp.toml[configuration file] in the right place (latest versions should use `rust-analyzer` by default).
435+
436+
Finally, you need to configure Kakoune to talk to `kak-lsp` (see https://github.com/kak-lsp/kak-lsp#usage[Usage section]).
437+
A basic configuration will only get you LSP but you can also activate inlay diagnostics and auto-formatting on save.
438+
The following might help you get all of this.
439+
440+
[source,txt]
441+
----
442+
eval %sh{kak-lsp --kakoune -s $kak_session} # Not needed if you load it with plug.kak.
443+
hook global WinSetOption filetype=rust %{
444+
# Enable LSP
445+
lsp-enable-window
446+
447+
# Auto-formatting on save
448+
hook window BufWritePre .* lsp-formatting-sync
449+
450+
# Configure inlay hints (only on save)
451+
hook window -group rust-inlay-hints BufWritePost .* rust-analyzer-inlay-hints
452+
hook -once -always window WinSetOption filetype=.* %{
453+
remove-hooks window rust-inlay-hints
454+
}
455+
}
456+
----
457+
458+
=== Helix
459+
460+
https://docs.helix-editor.com/[Helix] editor does support LSP by default.
461+
However, it won't install `rust-analyzer` automatically.
462+
You can follow instructions for installing <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
463+
430464
== Troubleshooting
431465

432466
Start with looking at the rust-analyzer version.

0 commit comments

Comments
 (0)