name: hx description: "Use Helix (hx) modal editor — selection-first editing with tree-sitter textobjects. Use when configuring keybindings, setting up language servers, or customizing themes." token_cost: 140 related: [vscode] keywords: ["helix", "hx", "modal", "keybinding", "theme"]
Helix
Modal text editor with selection-first editing and tree-sitter integration. The model is simple: select text first, then act on it (delete, yank, change). Supports multiple simultaneous selections.
Modes & Navigation
- Normal: navigation and editing —
iinserts before selection,venters select mode - Insert: typing mode —
jkorEscapereturns to Normal - Select/extend: making multi-cursor selections
Key commands in Normal mode:
/search forward,n/Nnext/previous matchgdgo to definition,]d/[dnext/previous diagnosticSpaceopens Space mode (pickers, LSP actions)ma/miselect around/inside textobjects (tree-sitter aware)
Space Mode (LSP & Pickers)
Accessed via Space in Normal mode:
ffile picker,bbuffer picker,sdocument symbolsddiagnostics,acode action,rrename,khover docs/global search
Configuration
Config lives in ~/.config/helix/config.toml (global) or .helix/config.toml (project-local).
theme = "onedark"
[editor]
line-number = "relative"
mouse = false
auto-format = true
[keys.normal]
C-s = ":w" # Save with Ctrl+S
g = { a = "code_action" } # ga triggers code action
[keys.insert.j]
k = "normal_mode" # jk escapes insert mode
Language Servers
Configure in languages.toml:
[[language]]
name = "rust"
language-servers = [{ name = "rust-analyzer", except-features = ["format"] }, "taplo"]
Shell Integration
Pipe selection through external commands or insert command output:
|pipe selection through a command!insert command output before selection:pipetypable command for piping
Key Constraints
- Selection-first editing — you must select text before acting on it
- Tree-sitter provides syntax-aware textobjects and navigation
- Project-local config merges with global config