Installation

We provide pre-built binaries on the GitHub Releases page.

OSX

A Homebrew tap is available:

brew tap helix-editor/helix
brew install helix

Linux

NixOS

A flake containing the package is available in the project root. The flake can also be used to spin up a reproducible development shell for working on Helix.

Arch Linux

Binary packages are available on AUR:

Build from source

git clone --recurse-submodules --shallow-submodules -j8 https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term

This will install the hx binary to $HOME/.cargo/bin.

Now copy the runtime/ directory somewhere. Helix will by default look for the runtime inside the same folder as the executable, but that can be overriden via the HELIX_RUNTIME environment variable.

If you want to embed the runtime/ directory into the Helix binary you can build it with:

cargo install --path helix-term --features "embed_runtime"

Usage

Configuration

LSP

To disable language server progress report from being displayed in the status bar add this option to your config.toml:

lsp-progress = false

Theme

Use a custom theme by placing a theme.toml in your config directory (i.e ~/.config/helix/theme.toml). The default theme.toml can be found here, and user submitted themes here.

Styles in theme.toml are specified of in the form:

key = { fg = "#ffffff", bg = "#000000", modifiers = ["bold", "italic"] }

where name represents what you want to style, fg specifies the foreground color, bg the background color, and modifiers is a list of style modifiers. bg and modifiers can be omitted to defer to the defaults.

To specify only the foreground color:

key = "#ffffff"

if the key contains a dot '.', it must be quoted to prevent it being parsed as a dotted key.

"key.key" = "#ffffff"

Possible modifiers:

Modifier
bold
dim
italic
underlined
slow_blink
rapid_blink
reversed
hidden
crossed_out

Possible keys:

KeyNotes
attribute
keyword
keyword.directivePreprocessor directives (#if in C)
namespace
punctuation
punctuation.delimiter
operator
special
property
variable
variable.parameter
type
type.builtin
constructor
function
function.macro
function.builtin
comment
variable.builtin
constant
constant.builtin
string
number
escapeEscaped characters
labelFor lifetimes
module
ui.background
ui.linenr
ui.linenr.selectedFor lines with cursors
ui.statusline
ui.popup
ui.window
ui.help
ui.text
ui.text.focus
ui.menu.selected
ui.selectionFor selections in the editing area
warningLSP warning
errorLSP error
infoLSP info
hintLSP hint

These keys match tree-sitter scopes. We half-follow the common scopes from macromates language grammars with some differences.

For a given highlight produced, styling will be determined based on the longest matching theme key. So it's enough to provide function to highlight function.macro and function.builtin as well, but you can use more specific scopes to highlight specific cases differently.

Keymap

Normal mode

Movement

NOTE: f, F, t and T are not confined to the current line.

KeyDescription
h, LeftMove left
j, DownMove down
k, UpMove up
l, RightMove right
wMove next word start
bMove previous word start
eMove next word end
tFind 'till next char
fFind next char
TFind 'till previous char
FFind previous char
HomeMove to the start of the line
EndMove to the end of the line
mJump to matching bracket
PageUpMove page up
PageDownMove page down
Ctrl-uMove half page up
Ctrl-dMove half page down
Ctrl-iJump forward on the jumplist TODO: conflicts tab
Ctrl-oJump backward on the jumplist
vEnter select (extend) mode
gEnter goto mode
:Enter command mode
zEnter view mode
Ctrl-wEnter window mode (maybe will be remove for spc w w later)
SpaceEnter space mode
KShow documentation for the item under the cursor

Changes

KeyDescription
rReplace with a character
RReplace with yanked text
iInsert before selection
aInsert after selection (append)
IInsert at the start of the line
AInsert at the end of the line
oOpen new line below selection
oOpen new line above selection
uUndo change
URedo change
yYank selection
pPaste after selection
PPaste before selection
>Indent selection
<Unindent selection
=Format selection
dDelete selection
cChange selection (delete and enter insert mode)

Selection manipulation

KeyDescription
sSelect all regex matches inside selections
SSplit selection into subselections on regex matches
Alt-sSplit selection on newlines
;Collapse selection onto a single cursor
Alt-;Flip selection cursor and anchor
%Select entire file
xSelect current line
XExtend to next line
[Expand selection to parent syntax node TODO: pick a key
Jjoin lines inside selection
Kkeep selections matching the regex TODO: overlapped by hover help
Spacekeep only the primary selection TODO: overlapped by space mode
Ctrl-cComment/uncomment the selections

TODO: The search implementation isn't ideal yet -- we don't support searching in reverse, or searching via smartcase.

KeyDescription
/Search for regex pattern
nSelect next search match
NAdd next search match to selection
*Use current selection as the search pattern

Diagnostics

NOTE: [ and ] will likely contain more pair mappings in the style of vim-unimpaired

KeyDescription
[dGo to previous diagnostic
]dGo to next diagnostic
[DGo to first diagnostic in document
]DGo to last diagnostic in document

Select / extend mode

I'm still pondering whether to keep this mode or not. It changes movement commands to extend the existing selection instead of replacing it.

NOTE: It's a bit confusing at the moment because extend hasn't been implemented for all movement commands yet.

View mode

View mode is intended for scrolling and manipulating the view without changing the selection.

KeyDescription
z , cVertically center the line
tAlign the line to the top of the screen
bAlign the line to the bottom of the screen
mAlign the line to the middle of the screen (horizontally)
jScroll the view downwards
kScroll the view upwards

Goto mode

Jumps to various locations.

NOTE: Some of these features are only available with the LSP present.

KeyDescription
gGo to the start of the file
eGo to the end of the file
hGo to the start of the line
lGo to the end of the line
sGo to first non-whitespace character of the line
tGo to the top of the screen
mGo to the middle of the screen
bGo to the bottom of the screen
dGo to definition
yGo to type definition
rGo to references
iGo to implementation
aGo to the last accessed/alternate file

Object mode

TODO: Mappings for selecting syntax nodes (a superset of [).

Window mode

This layer is similar to vim keybindings as kakoune does not support window.

KeyDescription
w, ctrl-wSwitch to next window
v, ctrl-vVertical right split
h, ctrl-hHorizontal bottom split
q, ctrl-qClose current window

Space mode

This layer is a kludge of mappings I had under leader key in neovim.

KeyDescription
fOpen file picker
bOpen buffer picker
sOpen symbol picker (current document)
wEnter window mode
spaceKeep primary selection TODO: it's here because space mode replaced it

Picker

Keys to use within picker.

KeyDescription
Up, Ctrl-pPrevious entry
Down, Ctrl-nNext entry
Ctrl-spaceFilter options
EnterOpen selected
Ctrl-hOpen horizontally
Ctrl-vOpen vertically
Escape, ctrl-cClose picker

Key Remapping

One-way key remapping is temporarily supported via a simple TOML configuration file. (More powerful solutions such as rebinding via commands will be available in the feature).

To remap keys, write a config.toml file in your helix configuration directory (default ~/.config/helix in Linux systems) with a structure like this:

# At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
[keys.normal]
a = "move_char_left" # Maps the 'a' key to the move_char_left command
w = "move_line_up" # Maps the 'w' key move_line_up
C-S-esc = "select_line" # Maps Control-Shift-Escape to select_line

[keys.insert]
A-x = "normal_mode" # Maps Alt-X to enter normal mode

Control, Shift and Alt modifiers are encoded respectively with the prefixes C-, S- and A-. Special keys are encoded as follows:

  • Backspace => "backspace"
  • Space => "space"
  • Return/Enter => "ret"
  • < => "lt"
  • > => "gt"
  • + => "plus"
  • - => "minus"
  • ; => "semicolon"
  • % => "percent"
  • Left => "left"
  • Right => "right"
  • Up => "up"
  • Home => "home"
  • End => "end"
  • Page Up => "pageup"
  • Page Down => "pagedown"
  • Tab => "tab"
  • Back Tab => "backtab"
  • Delete => "del"
  • Insert => "ins"
  • Null => "null"
  • Escape => "esc"

Commands can be found in the source code at ../../helix-term/src/commands.rs

Hooks