Language tools

Language tools

Use completion, diagnostics, navigation, formatting, and language packs for the files in your workspace.

Use a language server

Red starts a configured server after you open a matching file. The built-in defaults cover Rust, Fish, Markdown, JavaScript and TypeScript, JSON, TOML, YAML, and Lua; those server executables must be installed separately and available on PATH. Red includes its own server for .hk and .husk files.

KShow hover documentation
gdGo to definition
Ctrl-SpaceRequest completion
Ctrl-kShow signature help
Ctrl-tFind document symbols
Space wFind workspace symbols
Space kFind references
Space .Show code actions
Space rRename a symbol
Space fFormat the current document

Completion and formatting

Completion combines words from open buffers with candidates from the active language server. Use the arrow keys or Ctrl-n/Ctrl-p to choose an item, Tab or Enter to accept it, and Ctrl-e to close the menu.

Red formats supported documents when saving and reindents pasted code by default. Disable either behavior without disabling explicit formatting:

TOML
[formatting]
on_save = false
on_paste = false

When format-on-save is pending, :wq waits for the save before exiting. Red stays open if the save fails or the buffer changes during formatting.

Add or override a server

TOML
[lsp.servers.go]
command = "gopls"
language_id = "go"
file_extensions = ["go"]
root_markers = ["go.mod", ".git"]

Restart Red after changing a server definition, or run :languages reload after changing a unified language definition.

Starting with v0.9.0, multiple configured servers with overlapping file extensions or filenames attach to the same buffer automatically, combining diagnostics and code actions while routing completion, hover, and navigation by server capability. Configure TypeScript and ESLint together

Install a language pack

Open Language packs from the command palette, or use the CLI:

Shell
red plugin catalog
red plugin install --catalog go-language
red plugin install --catalog python-language --trust-native-grammars

Native Tree-sitter grammars execute inside the editor. Installing a pack doesn't approve them automatically; trust only the exact verified grammar bytes you intend to load.

Shell
red language trust LANGUAGE_ID
red language untrust LANGUAGE_ID