Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/letstri/druk/llms.txt

Use this file to discover all available pages before exploring further.

Druk integrates with the Language Server Protocol to bring diagnostics, inline problem messages, and autocompletion to any language that has a server. Druk ships no language servers itself — it spawns whatever commands are on your PATH. A server that isn’t installed is reported once in the status bar and then ignored; it never crashes or delays the editor.

Enabling LSP

LSP is enabled by default. Set lsp: false in your config to disable it globally across all languages.
~/.config/druk/config.json
{
  "lsp": false
}

Features

Diagnostics

Errors and warnings from the language server are shown in the editor gutter, letting you see problems at a glance without leaving the file.

Inline problems

When lspInline: true (default), the worst problem on each affected line is drawn as a message after the end of that line. Disable it with lspInline: false.

Autocompletion

When lspCompletion: true (default), a completion menu appears while you type. Press Ctrl+Space to trigger it manually. Requires lsp: true.

Problem navigation

Jump between diagnostics with problems.next and problems.prev (both unbound by default — assign them in keybindings). problems.list opens a full list.

Default servers

Druk will spawn the following language servers automatically when a matching file is opened, provided the command is found on your PATH.
Server idCommandFile types
typescripttypescript-language-server --stdioTypeScript, TSX, JavaScript, JSX
gogoplsGo
rustrust-analyzerRust
pythonpyright-langserver --stdioPython
clangdclangdC, C++
zigzlsZig
lualua-language-serverLua
bashbash-language-server startBash
rubysolargraph stdioRuby
phpintelephense --stdioPHP
swiftsourcekit-lspSwift
cssvscode-css-language-server --stdioCSS
htmlvscode-html-language-server --stdioHTML
jsonvscode-json-language-server --stdioJSON
A server command that is not found on your PATH is reported once in the status bar and ignored. Druk never crashes or hangs due to a missing language server.

Overriding a server command

Use the lspServers setting to replace the default command for any server, keyed by its server id. This is useful when you want to use an alternative server (such as Deno’s LSP for TypeScript) or when your binary lives in a non-standard location.
~/.config/druk/config.json
{
  "lspServers": {
    "typescript": ["deno", "lsp"],
    "python": ["pylsp"]
  }
}
Each value is a command array — the first element is the binary and the rest are arguments. Druk appends no path to this command; the server is expected to communicate over stdio.

Disabling a server

Set the command array to empty ([]) to disable a server entirely without turning off LSP globally:
~/.config/druk/config.json
{
  "lspServers": {
    "rust": []
  }
}

Per-project server config

lspServers can also go in your project’s .druk/settings.json. Because lspServers is an object-valued setting, it replaces the entire user-level map for that project — not individual entries. If you want to keep user-level overrides and add a project-specific one, repeat them all in the project file.
<project>/.druk/settings.json
{
  "lspServers": {
    "typescript": ["deno", "lsp"]
  }
}

Settings page

The settings page (F1 → Settings) has toggle controls for each server. Toggling a server off sets its entry in lspServers to []; toggling it back on removes the override and restores the default command. This is the same lspServers key under the hood — you can mix UI and JSON edits freely.

Document sync

Druk uses full-text document sync: the entire file content is sent to the server on every change. This approach is simpler and impossible to desynchronize — there is no incremental patch state to go stale. The didChange notification is debounced, and the debounce captures the document path and text at the moment it starts, so switching to another tab during the wait can never re-aim an edit at the wrong document.

Build docs developers (and LLMs) love