Configuration

To override global configuration parameters, create a config.toml file located in your config directory:

  • Linux and Mac: ~/.config/helix/config.toml
  • Windows: %AppData%\helix\config.toml

Hint: You can easily open the config file by typing :config-open within Helix normal mode.

Example config:

theme = "onedark"

[editor]
line-number = "relative"
mouse = false

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.file-picker]
hidden = false

You may also specify a file to use for configuration with the -c or --config CLI argument: hx -c path/to/custom-config.toml.

It is also possible to trigger configuration file reloading by sending the USR1 signal to the helix process, e.g. via pkill -USR1 hx. This is only supported on unix operating systems.

Editor

[editor] Section

KeyDescriptionDefault
scrolloffNumber of lines of padding around the edge of the screen when scrolling.5
mouseEnable mouse mode.true
middle-click-pasteMiddle click paste support.true
scroll-linesNumber of lines to scroll per scroll wheel step.3
shellShell to use when running external commands.Unix: ["sh", "-c"]
Windows: ["cmd", "/C"]
line-numberLine number display: absolute simply shows each line's number, while relative shows the distance from the current line. When unfocused or in insert mode, relative will still show absolute line numbers.absolute
cursorlineHighlight all lines with a cursor.false
guttersGutters to display: Available are diagnostics and line-numbers and spacer, note that diagnostics also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty["diagnostics", "line-numbers"]
auto-completionEnable automatic pop up of auto-completion.true
auto-formatEnable automatic formatting on save.true
idle-timeoutTime in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant.400
completion-trigger-lenThe min-length of word under cursor to trigger autocompletion2
auto-infoWhether to display infoboxestrue
true-colorSet to true to override automatic detection of terminal truecolor support in the event of a false negative.false
rulersList of column positions at which to display the rulers. Can be overridden by language specific rulers in languages.toml file.[]
bufferlineRenders a line at the top of the editor displaying open buffers. Can be always, never or multiple (only shown if more than one buffer is in use)never
color-modesWhether to color the mode indicator with different colors depending on the mode itselffalse

[editor.statusline] Section

Allows configuring the statusline at the bottom of the editor.

The configuration distinguishes between three areas of the status line:

[ ... ... LEFT ... ... | ... ... ... ... CENTER ... ... ... ... | ... ... RIGHT ... ... ]

Statusline elements can be defined as follows:

[editor.statusline]
left = ["mode", "spinner"]
center = ["file-name"]
right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"]
separator = "│"
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"

The [editor.statusline] key takes the following sub-keys:

KeyDescriptionDefault
leftA list of elements aligned to the left of the statusline["mode", "spinner", "file-name"]
centerA list of elements aligned to the middle of the statusline[]
rightA list of elements aligned to the right of the statusline["diagnostics", "selections", "position", "file-encoding"]
separatorThe character used to separate elements in the statusline"│"
mode.normalThe text shown in the mode element for normal mode"NOR"
mode.insertThe text shown in the mode element for insert mode"INS"
mode.selectThe text shown in the mode element for select mode"SEL"

The following statusline elements can be configured:

KeyDescription
modeThe current editor mode (mode.normal/mode.insert/mode.select)
spinnerA progress spinner indicating LSP activity
file-nameThe path/name of the opened file
file-encodingThe encoding of the opened file if it differs from UTF-8
file-line-endingThe file line endings (CRLF or LF)
total-line-numbersThe total line numbers of the opened file
file-typeThe type of the opened file
diagnosticsThe number of warnings and/or errors
selectionsThe number of active selections
positionThe cursor position
position-percentageThe cursor position as a percentage of the total number of lines
separatorThe string defined in editor.statusline.separator (defaults to "│")
spacerInserts a space between elements (multiple/contiguous spacers may be specified)

[editor.lsp] Section

KeyDescriptionDefault
display-messagesDisplay LSP progress messages below statusline1false
auto-signature-helpEnable automatic popup of signature help (parameter hints)true
display-signature-help-docsDisplay docs under signature help popuptrue
1

By default, a progress spinner is shown in the statusline beside the file path.

[editor.cursor-shape] Section

Defines the shape of cursor in each mode. Note that due to limitations of the terminal environment, only the primary cursor can change shape. Valid values for these options are block, bar, underline, or hidden.

KeyDescriptionDefault
normalCursor shape in normal modeblock
insertCursor shape in insert modeblock
selectCursor shape in select modeblock

[editor.file-picker] Section

Sets options for file picker and global search. All but the last key listed in the default file-picker configuration below are IgnoreOptions: whether hidden files and files listed within ignore files are ignored by (not visible in) the helix file picker and global search. There is also one other key, max-depth available, which is not defined by default.

All git related options are only enabled in a git repository.

KeyDescriptionDefault
hiddenEnables ignoring hidden files.true
parentsEnables reading ignore files from parent directories.true
ignoreEnables reading .ignore files.true
git-ignoreEnables reading .gitignore files.true
git-globalEnables reading global .gitignore, whose path is specified in git's config: core.excludefile option.true
git-excludeEnables reading .git/info/exclude files.true
max-depthSet with an integer value for maximum depth to recurse.Defaults to None.

[editor.auto-pairs] Section

Enables automatic insertion of pairs to parentheses, brackets, etc. Can be a simple boolean value, or a specific mapping of pairs of single characters.

To disable auto-pairs altogether, set auto-pairs to false:

[editor]
auto-pairs = false # defaults to `true`

The default pairs are (){}[]''""``, but these can be customized by setting auto-pairs to a TOML table:

[editor.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
'`' = '`'
'<' = '>'

Additionally, this setting can be used in a language config. Unless the editor setting is false, this will override the editor config in documents with this language.

Example languages.toml that adds <> and removes ''

[[language]]
name = "rust"

[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
'`' = '`'
'<' = '>'

[editor.search] Section

Search specific options.

KeyDescriptionDefault
smart-caseEnable smart case regex searching (case insensitive unless pattern contains upper case characters)true
wrap-aroundWhether the search should wrap after depleting the matchestrue

[editor.whitespace] Section

Options for rendering whitespace with visible characters. Use :set whitespace.render all to temporarily enable visible whitespace.

KeyDescriptionDefault
renderWhether to render whitespace. May either be "all" or "none", or a table with sub-keys space, tab, and newline."none"
charactersLiteral characters to use when rendering whitespace. Sub-keys may be any of tab, space, nbsp, newline or tabpadSee example below

Example

[editor.whitespace]
render = "all"
# or control each character
[editor.whitespace.render]
space = "all"
tab = "all"
newline = "none"

[editor.whitespace.characters]
space = "·"
nbsp = "⍽"
tab = "→"
newline = "⏎"
tabpad = "·" # Tabs will look like "→···" (depending on tab width)

[editor.indent-guides] Section

Options for rendering vertical indent guides.

KeyDescriptionDefault
renderWhether to render indent guides.false
characterLiteral character to use for rendering the indent guide
skip-levelsNumber of indent levels to skip0

Example:

[editor.indent-guides]
render = true
character = "╎"
skip-levels = 1