Skip to content

angjelkom/helix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8,072 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helix

Build status GitHub Release Documentation GitHub contributors Matrix Space

Screenshot

A Kakoune / Neovim inspired editor, written in Rust.

The editing model is very heavily based on Kakoune; during development I found myself agreeing with most of Kakoune's design decisions.

For more information, see the website or documentation.

All shortcuts/keymaps can be found in the documentation on the website.

Troubleshooting

Features

  • Vim-like modal editing
  • Multiple selections
  • Built-in language server support
  • Smart, incremental syntax highlighting and code editing via tree-sitter

Although it's primarily a terminal-based editor, I am interested in exploring a custom renderer (similar to Emacs) using wgpu.

Note: Only certain languages have indentation definitions at the moment. Check runtime/queries/<lang>/ for indents.scm.

Installation

Installation documentation.

Packaging status

This fork

This is a personal fork that adds two things on top of upstream Helix:

Building

Build the editor and the MCP bridge binary, both with target-cpu=native:

cargo install \
  --profile opt \
  --config 'build.rustflags="-C target-cpu=native"' \
  --path helix-term \
  --locked

cargo install \
  --profile opt \
  --config 'build.rustflags="-C target-cpu=native"' \
  --path helix-claude-mcp \
  --locked

That places hx and helix-claude-mcp in ~/.cargo/bin. Restart any running Helix sessions and Claude Code sessions after a rebuild — both cache the spawned process per session.

Helix configuration

In ~/.config/helix/config.toml:

[editor.context-logger]
enabled = true                              # writes <workspace>/.helix/context.json on focus loss
include-selection-text = true               # default — current selection appears in the snapshot
include-buffer-text = false                 # default — flip on for full buffer dumps (large)
max-selection-bytes = 8192                  # default — truncates long selections

[editor.control-socket]
enabled = true                              # binds <workspace>/.helix/control-<pid>.sock for the MCP bridge

Both default to enabled = false, so opting in is explicit. With both enabled:

  • A JSON snapshot of editor state is written to .helix/context.json whenever the terminal loses focus (or when you run :write-context manually).
  • A per-process Unix socket appears at .helix/control-<pid>.sock, mode 0600, listening for control RPC from the bridge.

Claude Code MCP server

Tell Claude Code about the bridge. Either project-scoped (committed to the repo) in <workspace>/.mcp.json:

{
  "mcpServers": {
    "helix": {
      "command": "helix-claude-mcp",
      "args": ["serve"]
    }
  }
}

…or globally in ~/.claude.json under the same "mcpServers" key. Claude Code spawns the binary per session and sets CLAUDE_PROJECT_DIR automatically.

Claude Code hooks (passive context injection)

The bridge also ships a hook subcommand that injects a <helix-editor-context> block into each prompt. In ~/.claude/settings.json:

{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          { "type": "command", "command": "helix-claude-mcp hook", "timeout": 5 }
        ]
      }
    ],
    "PostCompact": [
      {
        "hooks": [
          { "type": "command", "command": "helix-claude-mcp hook --reset-marker" }
        ]
      }
    ],
    "SessionStart": [
      {
        "matcher": "compact",
        "hooks": [
          { "type": "command", "command": "helix-claude-mcp hook --reset-marker" }
        ]
      }
    ]
  }
}

The UserPromptSubmit hook injects the current snapshot into every prompt (dedup'd per session and per snapshot mtime). The PostCompact and SessionStart matcher=compact hooks clear the dedup marker so the snapshot re-injects after Claude Code compacts the conversation.

What Claude can do once it's wired up

Resources (read-only, cheap):

  • helix://state/current — active buffer, cursor, selection, mode
  • helix://state/buffers — list of open buffers
  • helix://state/snapshot — the full snapshot

Tools (live RPC to the editor):

Tool What it does
helix_open_file Open a file in Helix and focus it.
helix_goto_line Move cursor to a 1-indexed line/column.
helix_select Select a range from (start_line, start_column) to (end_line, end_column); view recenters.
helix_get_diagnostics LSP diagnostics for a buffer.
helix_get_hover LSP hover at a position.
helix_get_definition LSP goto-definition.
helix_get_references LSP find-references.
helix_get_workspace_symbols LSP workspace symbol search.
helix_format_document Format a buffer via its LSP formatter.
helix_run_command Execute any Helix typable command. Powerful — can :write, :reload, :run-shell-command, etc. See spec §10b.

Tools refuse cleanly with a structured error when Helix isn't running; resources still serve the last-written snapshot via the file path so passive context survives a closed editor.

Contributing

Contributing guidelines can be found here.

Getting help

Your question might already be answered on the FAQ.

Discuss the project on the community Matrix Space (make sure to join #helix-editor:matrix.org if you're on a client that doesn't support Matrix Spaces yet).

Credits

Thanks to @jakenvac for designing the logo!

About

A post-modern modal text editor.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 79.1%
  • Tree-sitter Query 20.2%
  • Handlebars 0.3%
  • Nix 0.2%
  • CSS 0.1%
  • Shell 0.1%