How to install servers - kakoune-lsp/kakoune-lsp GitHub Wiki
This is a short reference for installation of language servers listed in default kak-lsp.toml configuration.
Rust
rustup component add rust-analyzer rust-src
Crystal
Clojure
To install, follow https://clojure-lsp.io/installation/
C, C++
If you prefer ccls, use a hook like this:
hook global BufSetOption filetype=(?:c|cpp) %{
set-option buffer lsp_servers %{
[ccls]
root_globs = ["compile_commands.json", ".ccls", ".git", ".hg"]
}
}
and refer https://github.com/MaskRay/ccls/wiki for installing and configuring ccls itself.
kak-lspsupports nearly all ccls lsp extensions, including semantic highlighting, navigations, and special cross references. See the ccls-{navigate,vars,inheritance,member,call} kak functions for a reference. They are also described in the ccls wiki.
JavaScript
Refer to the TypeScript section.
JavaScript + Flow
npm install -g flow-bin
Typescript
with https://github.com/typescript-language-server/typescript-language-server
npm install -g typescript
npm install -g typescript-language-server
Deno
Deno has official support for the LSP (from version 1.6.0). Just make sure deno command is available in PATH.
To enable it, look for deno in https://github.com/kakoune-lsp/kakoune-lsp/blob/master/rc/servers.kak#L216-L224.
HTML, CSS, JSON
npm install -g vscode-{html,css,json}-languageserver-bin
The code is extracted from vscode itself and modules have the following dependencies hierarchy: bin → server → service
HTML
CSS
JSON
OCaml, ReasonML
opam install ocaml-lsp-server
Haskell
language server: https://github.com/haskell/haskell-language-server#kakoune
ide engine: (deprecated) https://github.com/haskell/haskell-ide-engine#installation
Ruby
- Language: [Ruby]
- Server: [Solargraph] or [Ruby LSP]
- Commit: [#272]
By default kak-lsp uses solargraph language server.
Installation
gem install solargraph
Python
- Language: Python
- Server: python-lsp-server
Installation
pip install 'python-lsp-server[all]'
Recommended way to install is using virtualenv, available by default in python3.
python -m venv /path/to/virtualenv # use a real path in file system
# activate virtualenv for bash or zsh (for fish use activate.fish)
source /path/to/virtualenv/bin/activate # use a real path in file system
pip install 'python-lsp-server[all]'
Usually, virtualenv directories are stored under ~/.local/share/virtualenvs.
Configuration
If installation is done within virtualenv, add it to your SHELL env variable - $PATH.
Go
By default kak-lsp uses gopls language server.
See https://github.com/golang/tools/tree/master/gopls#installation for installation instructions.
If you want to use gopls for formatting on save, including adding/removing imports, use this (vscode-go does the same):
hook global BufWritePre .*[.]go %{
try %{ lsp-code-action-sync '^Organize Imports$' }
lsp-formatting-sync
}
PHP (Intelephense)
Install the server component globally using npm:
npm i -g intelephense
Then in kak-lsp.toml add the following, where <path-to-intelephense> is the output of which intelephense:
Bash
npm i -g bash-language-server
Dart
See https://github.com/natebosch/dart_language_server#installing
pub global activate dart_language_server
D
Install the D Language Server by running dub fetch dls, then dub run dls:bootstrap. The second command will print the location where dub installed the server. You will need to place this executable on your path, e.g. by making the path absolute (dub will likely print a relative path) and creating a symlink sudo ln -s <absolute path to dls> /usr/local/bin/dls.
Nim
nimble install nimlsp
Elm
You may be able to install the elm-language-server with npm:
`npm install -g elm-language-server'
If this doesn't work, or to install the latest version of the elm-language-server, clone the repo and compile it:
git clone [email protected]:elm-tooling/elm-language-server.git
cd elm-language-server
npm install
npm run compile
npm link
Then, you should be able to run the language server with the following command:
elm-language-server --stdio
Installation of elm-test and elm-format is normally done with npm:
npm install -g elm-test
npm install -g elm-format
LaTeX
Install texlab from your distribution’s repo. If not available, follow texlab’s installation instructions.
YAML
- Language: YAML
- Server: yaml-language-server
npm install -g yaml-language-server
Svelte
- Language: Svelte
- Server: svelte-language-server
npm install -g svelte-language-server
Zig
Server: zls, see also https://github.com/zigtools/zls/wiki/Installing-for-Kakoune
GDScript (Godot)
Requires netcat.
Use the following hook:
hook global BufSetOption filetype=gdscript %{
set-option buffer lsp_servers %{
[gdscript]
filetypes = ["gdscript"]
root_globs = [".import"]
command = "nc"
args = ["localhost", "6005"]
}
}
Dhall
Server: dhall-lsp-server
[language.dhall]
filetypes = ["dhall"]
roots = []
command = "dhall-lsp-server"