Editor
Helix makes it a priority to have a solid out-of-the-box experience, with minimal configuration required to start using the editor.
However, there are many things one may wish to customize such as:
- Creating custom keybindings and macros
- Using custom theme
- Configure stuff like auto pairs, statusline, etc.
Introduction
Setting config options
In the editor, you can change various options without editing any config file. For example by using :set cursorline false. This will be reset when you leave the editor.
To permanently store config options, create a config.toml file located in your config directory:
- Linux and Mac:
~/.config/helix/config.toml - Windows:
%AppData%\helix\config.toml
Sample config
theme = "catppuccin-mocha"
[editor]line-number = "relative"mouse = false
[editor.cursor-shape]insert = "bar"normal = "block"select = "underline"For available themes, Helix comes with a lot of bundled themes, so they are on a separate page. See the full list of themes.
[editor] Section
scrolloff
Number of lines of padding around the edge of the screen when scrolling
[editor]scrolloff = 5mouse
Enable mouse mode
[editor]mouse = truemiddle-click-paste
Middle click paste support
[editor]middle-click-paste = truescroll-lines
Number of lines to scroll per scroll wheel step
[editor]scroll-lines = 3shell
Shell to use when running external commands
Unix:
[editor]shell = ["sh", "-c"]Windows:
[editor]shell = ["cmd", "/C"]line-number
Line 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
[editor]line-number = absolutecursorline
Highlight all lines with a cursor
[editor]cursorline = falsecursorcolumn
Highlight all columns with a cursor
[editor]cursorcolumn = falsegutters
Gutters to display: Available are:
diagnosticsdiffline-numbersspacer
Note that diagnostics also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty
[editor]gutters = [ "diagnostics", "spacer", "line-numbers", "spacer", "diff",]auto-completion
Enable automatic pop up of auto-completion
[editor]auto-completion = trueauto-format
Enable automatic formatting on save
[editor]auto-format = trueidle-timeout
Time in milliseconds since last keypress before idle timers trigger.
[editor]idle-timeout = 250completion-timeout
Time in milliseconds after typing a word character before completions are shown, set to 5 for instant.
[editor]completion-timeout = 250preview-completion-insert
Whether to apply completion item instantly when selected
[editor]preview-completion-insert = truecompletion-trigger-len
The min-length of word under cursor to trigger autocompletion
[editor]completion-trigger-len = 2completion-replace
Set to true to make completions always replace the entire word and not just the part before the cursor
[editor]completion-replace = falseauto-info
Whether to display info boxes
[editor]auto-info = truetrue-color
Set to true to override automatic detection of terminal truecolor support in the event of a false negative
[editor]true-color = falseundercurl
Set to true to override automatic detection of terminal undercurl support in the event of a false negative
[editor]undercurl = falserulers
List of column positions at which to display the rulers. Can be overridden by language specific rulers in languages.toml file
[editor]rulers = []bufferline
Renders 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)
[editor]bufferline = "never"color-modes
Whether to color the mode indicator with different colors depending on the mode itself
[editor]color-modes = falsetext-width
Maximum line length. Used for the :reflow command and soft-wrapping if soft-wrap.wrap-at-text-width is set
[editor]text-width = 80workspace-lsp-roots
Directories relative to the workspace root that are treated as LSP roots. Should only be set in .helix/config.toml
[editor]workspace-lsp-roots = []default-line-ending
The line ending to use for new documents. Can be native, lf, crlf, ff, cr or nel. native uses the platform’s native line ending (crlf on Windows, otherwise lf).
[editor]default-line-ending = "native"insert-final-newline
Whether to automatically insert a trailing line-ending on write if missing
[editor]insert-final-newline = truepopup-border
Draw border around popup, menu, all, or none
[editor]popup-border = "none"indent-heuristic
How the indentation for a newly inserted line is computed:
simplejust copies the indentation level from the previous line,tree-sittercomputes the indentation based on the syntax treehybridcombines both approaches.
If the chosen heuristic is not available, a different one will be used as a fallback (the fallback order being hybrid -> tree-sitter -> simple).
[editor]indent-heuristic = "hybrid"jump-label-alphabet
The characters that are used to generate two character jump labels. Characters at the start of the alphabet are used first.
[editor]jump-label-alphabet = "abcdefghijklmnopqrstuvwxyz"end-of-line-diagnostics
Minimum severity of diagnostics to render at the end of the line. Set to disable to disable entirely.
Refer to the setting about inline-diagnostics for more details
[editor]end-of-line-diagnostics = "disable"[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:
left
A list of elements aligned to the left of the statusline
[editor.statusline]left = [ "mode", "spinner", "file-name", "read-only-indicator", "file-modification-indicator"]center
A list of elements aligned to the middle of the statusline
[editor.statusline]center = []right
A list of elements aligned to the right of the statusline
[editor.statusline]right = [ "diagnostics", "selections", "register", "position", "file-encoding"]separator
The character used to separate elements in the statusline
[editor.statusline]separator = "│"The text shown in the mode element for normal mode
[editor.statusline]mode.normal = "NOR"The text shown in the mode element for insert mode
[editor.statusline]mode.insert = "INS"The text shown in the mode element for select mode
[editor.statusline]mode.select = "SEL"The following statusline elements can be configured:
mode: The current editor mode (mode.normal/mode.insert/mode.select)spinner: A progress spinner indicating LSP activityfile-name: The path/name of the opened filefile-absolute-path: The absolute path/name of the opened filefile-base-name: The basename of the opened filefile-modification-indicator: | The indicator to show whether the file is modified (a[+]appears when there are unsaved changes) |file-encoding: The encoding of the opened file if it differs from UTF-8file-line-ending: The file line endings (CRLF or LF)read-only-indicator: An indicator that shows[readonly]when a file cannot be writtentotal-line-numbers: The total line numbers of the opened filefile-type: The type of the opened filediagnostics: The number of warnings and/or errorsworkspace-diagnostics: The number of warnings and/or errors on workspaceselections: The number of active selectionsprimary-selection-length: The number of characters currently in primary selectionposition: The cursor positionposition-percentage: The cursor position as a percentage of the total number of linesseparator: The string defined ineditor.statusline.separator(defaults to"│")spacer: Inserts a space between elements (multiple/contiguous spacers may be specified)version-control: The current branch name or detached commit hash of the opened workspaceregister: The current selected register
[editor.lsp] Section
enable
Enables LSP integration. Setting to false will completely disable language servers regardless of language settings.
[editor.lsp]enable = truedisplay-messages
Display LSP progress messages below statusline
By default, a progress spinner is shown in the statusline beside the file path.
[editor.lsp]display-messages = falseauto-signature-help
Enable automatic popup of signature help (parameter hints)
[editor.lsp]auto-signature-help = truedisplay-inlay-hints
Display inlay hints
[editor.lsp]display-inlay-hints = falsedisplay-signature-help-docs
Display docs under signature help popup
[editor.lsp]display-signature-help-docs = truesnippets
Enables snippet completions.
Requires a server restart (:lsp-restart) to take effect after :config-reload/:set.
[editor.lsp]snippets = truegoto-reference-include-declaration
Include declaration in the goto references popup.
[editor.lsp]goto-reference-include-declaration = true[editor.cursor-shape] Section
Defines the shape of cursor in each mode.
Valid values for these options are block, bar, underline, or hidden.
normal
Cursor shape in normal mode
[editor.cursor-shape]normal = "block"insert
Cursor shape in insert mode
[editor.cursor-shape]insert = "block"select
Cursor shape in select mode
[editor.cursor-shape]select = "block"[editor.file-picker] Section
Set options for file picker and global search. Ignoring a file means it is not visible in the Helix file picker and global search.
All git related options are only enabled in a git repository.
Ignore files can be placed locally as .ignore or put in your home directory as ~/.ignore. They support the usual ignore and negative ignore (unignore) rules used in .gitignore files.
Additionally, you can use Helix-specific ignore files by creating a local .helix/ignore file in the current workspace or a global ignore file located in your Helix config directory:
- Linux and Mac:
~/.config/helix/ignore - Windows:
%AppData%\helix\ignore
Example:
# unignore in file picker and global search!.github/!.gitignore!.gitattributeshidden
Enables ignoring hidden files
[editor.file-picker]hidden = truefollow-symlinks
Follow symlinks instead of ignoring them
[editor.file-picker]follow-symlinks = truededuplicate-links
Ignore symlinks that point at files already shown in the picker
[editor.file-picker]deduplicate-links = trueparents
Enables reading ignore files from parent directories
[editor.file-picker]parents = trueignore
Enables reading .ignore files
[editor.file-picker]ignore = truegit-ignore
Enables reading .gitignore files
[editor.file-picker]git-ignore = truegit-global
Enables reading global .gitignore, whose path is specified in git’s config: core.excludesfile option
[editor.file-picker]git-global = truegit-exclude
Enables reading .git/info/exclude files
[editor.file-picker]git-exclude = truemax-depth
Set with an integer value for maximum depth to recurse
Unset by default
[editor.auto-pairs] Section
auto-pairs
Enables automatic insertion of pairs to parentheses, brackets, etc.
Can be a simple boolean value, or a specific mapping of pairs of single characters.
[editor]auto-pairs = trueThe 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.auto-save] Section
Control auto save behavior.
focus-lost
Enable automatic saving on the focus moving away from Helix. Requires focus event support ↗ from your terminal
[editor.auto-save]focus-lost = falseEnable automatic saving after auto-save.after-delay.timeout milliseconds have passed since last edit.
[editor.auto-save]after-delay.enable = falseTime in milliseconds since last edit before auto save timer triggers.
[editor.auto-save]after-delay.timeout = 3000[editor.search] Section
Search specific options.
smart-case
Enable smart case regex searching (case-insensitive unless pattern contains upper case characters)
[editor.search]smart-case = truewrap-around
Whether the search should wrap after depleting the matches
[editor.wrap-around]wrap-around = true[editor.whitespace] Section
Options for rendering whitespace with visible characters.
Use :set whitespace.render all to temporarily enable visible whitespace.
render
Whether to render whitespace.
May either be all or none, or a table with sub-keys space, nbsp, nnbsp, tab, and newline
[editor.whitespace]render = "none"characters
Literal characters to use when rendering whitespace. Sub-keys may be any of tab, space, nbsp, nnbsp, newline or tabpad
Example
[editor.whitespace]render = "all"# or control each character[editor.whitespace.render]space = "all"tab = "all"nbsp = "none"nnbsp = "none"newline = "none"
[editor.whitespace.characters]space = "·"nbsp = "⍽"nnbsp = "␣"tab = "→"newline = "⏎"tabpad = "·" # Tabs will look like "→···" (depending on tab width)See example
[editor.indent-guides] Section
Options for rendering vertical indent guides.
render
Whether to render indent guides
[editor.indent-guides]render = falsecharacter
Literal character to use for rendering the indent guide
[editor.indent-guides]character = "│"skip-levels
Number of indent levels to skip
[editor.indent-guides]skip-levels = 0Example:
[editor.indent-guides]render = truecharacter = "╎" # Some characters that work well: "▏", "┆", "┊", "⸽"skip-levels = 1[editor.gutters] Section
For simplicity, editor.gutters accepts an array of gutter types, which will
use default settings for all gutter components.
[editor]gutters = ["diff", "diagnostics", "line-numbers", "spacer"]To customize the behavior of gutters, the [editor.gutters] section must
be used. This section contains top level settings, as well as settings for
specific gutter components as subsections.
layout
A vector of gutters to display
[editor.gutters]layout = ["diagnostics", "spacer", "line-numbers", "spacer", "diff"]Example:
[editor.gutters]layout = ["diff", "diagnostics", "line-numbers", "spacer"][editor.gutters.line-numbers] Section
Options for the line number gutter
min-width
The minimum number of characters to use
[editor.gutters.line-numbers]min-width = 3Example:
[editor.gutters.line-numbers]min-width = 1[editor.gutters.diagnostics] Section
Currently unused
[editor.gutters.diff] Section
The diff gutter option displays colored bars indicating whether a git diff represents that a line was added, removed or changed.
These colors are controlled by the theme attributes diff.plus, diff.minus and diff.delta.
Other diff providers will eventually be supported by a future plugin system.
There are currently no options for this section.
[editor.gutters.spacer] Section
Currently unused
[editor.soft-wrap] Section
Options for soft wrapping lines that exceed the view width:
enable
Whether soft wrapping is enabled.
[editor.soft-wrap]enable = falsemax-wrap
Maximum free space left at the end of the line.
[editor.soft-wrap]max-wrap = 20max-indent-retain
Maximum indentation to carry over when soft wrapping a line.
[editor.soft-wrap]max-indent-retain = 40wrap-indicator
Text inserted before soft wrapped lines, highlighted with ui.virtual.wrap
[editor.soft-wrap]wrap-indicator = "↪"wrap-at-text-width
Soft wrap at text-width instead of using the full viewport size.
[editor.soft-wrap]wrap-at-text-width = falseExample:
[editor.soft-wrap]enable = truemax-wrap = 25 # increase value to reduce forced mid-word wrappingmax-indent-retain = 0wrap-indicator = "" # set wrap-indicator to "" to hide it[editor.smart-tab] Section
Options for navigating and editing using tab key.
enable
If set to true, then when the cursor is in a position with non-whitespace to its left, instead of inserting a tab, it will run move_parent_node_end. If there is only whitespace to the left, then it inserts a tab as normal. With the default bindings, to explicitly insert a tab character, press Shift-tab.
[editor.smart-tab]enable = truesupersede-menu
Normally, when a menu is on screen, such as when auto complete is triggered, the tab key is bound to cycling through the items. This means when menus are on screen, one cannot use the tab key to trigger the smart-tab command. If this option is set to true, the smart-tab command always takes precedence, which means one cannot use the tab key to cycle through menu items. One of the other bindings must be used instead, such as arrow keys or C-n/C-p.
[editor.smart-tab]supersede-menu = falseDue to lack of support for S-tab in some terminals, the default keybindings don’t fully embrace smart-tab editing experience. If you enjoy smart-tab navigation and a terminal that supports the Enhanced Keyboard protocol ↗, consider setting extra keybindings:
[keys.normal]tab = "move_parent_node_end"S-tab = "move_parent_node_start"
[keys.insert]S-tab = "move_parent_node_start"
[keys.select]tab = "extend_parent_node_end"S-tab = "extend_parent_node_start"Overriding the Config File
You can override the default config file by:
- Specifying it with the
-cor--configcommand line argument, for examplehx -c path/to/custom-config.toml - Having a
config.tomllocal to a project by putting it under a.helixdirectory in your repository. Its settings will be merged with the configuration directoryconfig.tomland the built-in configuration.