2021-04-05 08:18:43 +02:00
# Configuration
2021-06-06 14:45:59 +02:00
2021-08-16 14:19:05 +02:00
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`
2021-06-19 13:19:31 +02:00
2022-03-25 10:05:20 +01:00
> Hint: You can easily open the config file by typing `:config-open` within Helix normal mode.
2022-03-09 19:34:12 +01:00
2021-11-24 07:47:41 +01:00
Example config:
```toml
theme = "onedark"
[editor]
line-number = "relative"
mouse = false
[editor.cursor-shape]
2021-11-29 06:39:04 +01:00
insert = "bar"
normal = "block"
select = "underline"
2021-11-24 07:47:41 +01:00
[editor.file-picker]
hidden = false
```
2021-09-07 06:00:52 +02:00
## Editor
2021-11-24 07:47:41 +01:00
### `[editor]` Section
2021-09-07 06:00:52 +02:00
| Key | Description | Default |
|--|--|---------|
| `scrolloff` | Number of lines of padding around the edge of the screen when scrolling. | `3` |
| `mouse` | Enable mouse mode. | `true` |
| `middle-click-paste` | Middle click paste support. | `true` |
| `scroll-lines` | Number of lines to scroll per scroll wheel step. | `3` |
| `shell` | Shell to use when running external commands. | Unix: `["sh", "-c"]` < br /> Windows: `["cmd", "/C"]` |
2022-01-25 16:18:01 +01:00
| `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. | `absolute` |
2022-04-16 03:41:25 +02:00
| `gutters` | Gutters to display: Available are `diagnostics` and `line-numbers` , note that `diagnostics` also includes other features like breakpoints | `["diagnostics", "line-numbers"]` |
2021-10-16 15:57:41 +02:00
| `auto-completion` | Enable automatic pop up of auto-completion. | `true` |
2022-05-02 16:31:07 +02:00
| `auto-format` | Enable automatic formatting on save. | `true` |
2021-10-10 05:32:06 +02:00
| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` |
2021-10-18 08:14:50 +02:00
| `completion-trigger-len` | The min-length of word under cursor to trigger autocompletion | `2` |
2021-11-05 03:25:08 +01:00
| `auto-info` | Whether to display infoboxes | `true` |
2021-11-14 13:26:48 +01:00
| `true-color` | Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative. | `false` |
2022-04-27 21:21:20 +02:00
| `rulers` | List of column positions at which to display the rulers. Can be overridden by language specific `rulers` in `languages.toml` file. | `[]` |
2021-09-07 06:00:52 +02:00
2022-03-28 03:11:52 +02:00
### `[editor.lsp]` Section
| Key | Description | Default |
| --- | ----------- | ------- |
| `display-messages` | Display LSP progress messages below statusline[^1] | `false` |
[^1]: A progress spinner is always shown in the statusline beside the file path.
2021-11-24 07:47:41 +01:00
### `[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.
2022-04-13 06:00:17 +02:00
Valid values for these options are `block` , `bar` , `underline` , or `none` .
2021-11-24 07:47:41 +01:00
2021-11-29 06:39:04 +01:00
| Key | Description | Default |
| --- | ----------- | ------- |
| `normal` | Cursor shape in [normal mode][normal mode] | `block` |
| `insert` | Cursor shape in [insert mode][insert mode] | `block` |
| `select` | Cursor shape in [select mode][select mode] | `block` |
2021-11-24 07:47:41 +01:00
[normal mode]: ./keymap.md#normal-mode
[insert mode]: ./keymap.md#insert-mode
[select mode]: ./keymap.md#select--extend-mode
2022-01-09 06:08:58 +01:00
### `[editor.file-picker]` Section
2021-11-24 07:47:41 +01:00
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.
2021-11-20 15:23:36 +01:00
| Key | Description | Default |
|--|--|---------|
|`hidden` | Enables ignoring hidden files. | true
|`parents` | Enables reading ignore files from parent directories. | true
|`ignore` | Enables reading `.ignore` files. | true
|`git-ignore` | Enables reading `.gitignore` files. | true
|`git-global` | Enables reading global .gitignore, whose path is specified in git's config: `core.excludefile` option. | true
|`git-exclude` | Enables reading `.git/info/exclude` files. | true
|`max-depth` | Set with an integer value for maximum depth to recurse. | Defaults to `None` .
2022-02-25 09:36:54 +01:00
### `[editor.auto-pairs]` Section
Enable automatic insertion of pairs to parentheses, brackets, etc. Can be
a simple boolean value, or a specific mapping of pairs of single characters.
| Key | Description |
| --- | ----------- |
| `false` | Completely disable auto pairing, regardless of language-specific settings
| `true` | Use the default pairs: < code > (){}[]''""``</ code >
| Mapping of pairs | e.g. `{ "(" = ")", "{" = "}", ... }`
Example
```toml
[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 ''
```toml
[[language]]
name = "rust"
[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
'`' = '`'
'< ' = '>'
```
2022-03-01 02:06:14 +01:00
### `[editor.search]` Section
Search specific options.
| Key | Description | Default |
|--|--|---------|
| `smart-case` | Enable smart case regex searching (case insensitive unless pattern contains upper case characters) | `true` |
| `wrap-around` | Whether the search should wrap after depleting the matches | `true` |
2021-12-01 23:59:23 +01:00
### `[editor.whitespace]` Section
Options for rendering whitespace with visible characters. Use `:set whitespace.render all` to temporarily enable visible whitespace.
| Key | Description | Default |
|-----|-------------|---------|
| `render` | Whether to render whitespace. May either be `"all"` or `"none"` , or a table with sub-keys `space` , `tab` , and `newline` . | `"none"` |
2022-04-30 02:48:52 +02:00
| `characters` | Literal characters to use when rendering whitespace. Sub-keys may be any of `tab` , `space` , `nbsp` or `newline` | See example below |
2021-12-01 23:59:23 +01:00
Example
```toml
[editor.whitespace]
render = "all"
# or control each character
[editor.whitespace.render]
space = "all"
tab = "all"
newline = "none"
[editor.whitespace.characters]
space = "·"
2022-04-30 02:48:52 +02:00
nbsp = "⍽"
2021-12-01 23:59:23 +01:00
tab = "→"
newline = "⏎"
```