about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJean SIMARD <woshilapin@tuziwo.info>2022-02-23 08:55:16 +0100
committerJean SIMARD <woshilapin@tuziwo.info>2022-02-23 08:55:56 +0100
commit8025b6449ccb8820fd694dcda7c0979ac405c911 (patch)
tree737bc471034d569c4dd9ee4d2a4be6af4da31aad
parentc79ef5f5ca22a426ef5c25f19b21053474b06368 (diff)
downloadrust-8025b6449ccb8820fd694dcda7c0979ac405c911.tar.gz
rust-8025b6449ccb8820fd694dcda7c0979ac405c911.zip
Add Kakoune and Helix configuration
Follow-up of rust-analyzer/rust-analyser.github.io#181
Fixes rust-analyzer/rust-analyser.github.io#180
-rw-r--r--docs/user/manual.adoc34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index 1a033ab3645..3578c0d78a6 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -436,6 +436,40 @@ Then click on apply, and restart the LSP server for your rust project.
 
 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.
 
+=== Kakoune
+
+https://kakoune.org/[Kakoune] supports LSP with the help of https://github.com/kak-lsp/kak-lsp[`kak-lsp`].
+Follow the https://github.com/kak-lsp/kak-lsp#installation[instructions] to install `kak-lsp`.
+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).
+
+Finally, you need to configure Kakoune to talk to `kak-lsp` (see https://github.com/kak-lsp/kak-lsp#usage[Usage section]).
+A basic configuration will only get you LSP but you can also activate inlay diagnostics and auto-formatting on save.
+The following might help you get all of this.
+
+[source,txt]
+----
+eval %sh{kak-lsp --kakoune -s $kak_session}  # Not needed if you load it with plug.kak.
+hook global WinSetOption filetype=rust %{
+    # Enable LSP
+    lsp-enable-window
+
+    # Auto-formatting on save
+    hook window BufWritePre .* lsp-formatting-sync
+
+    # Configure inlay hints (only on save)
+    hook window -group rust-inlay-hints BufWritePost .* rust-analyzer-inlay-hints
+    hook -once -always window WinSetOption filetype=.* %{
+        remove-hooks window rust-inlay-hints
+    }
+}
+----
+
+=== Helix
+
+https://docs.helix-editor.com/[Helix] supports LSP by default.
+However, it won't install `rust-analyzer` automatically.
+You can follow instructions for installing <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
+
 == Troubleshooting
 
 Start with looking at the rust-analyzer version.