Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Editor

This chapter explains editor settings in depth. For the complete, canonical list of every setting and default, see the config.toml reference.

[editor] Section

KeyDescriptionDefault
scroll.paddingNumber of lines of padding around the edge of the screen when scrolling5
mouse.enableEnable mouse modetrue
mouse.yank-registerWhich register to use for mouse yanks. *
mouse.middle-click-pasteMiddle click paste supporttrue
clipboard.default-yank-registerDefault register used for yank/paste'"'
scroll.wheel-linesNumber of lines to scroll per scroll wheel step3
shellShell to use when running external commandsUnix: ["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"
cursor.highlight-lineHighlight all lines with a cursorfalse
cursor.highlight-columnHighlight all columns with a cursorfalse
continue-commentsif mitos should automatically add a line comment token if you create a new line inside a comment.true
guttersGutters to display: Available are diagnostics and diff and line-numbers and spacer and code-action-hint, note that diagnostics also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
completion.auto-triggerEnable automatic pop up of auto-completiontrue
completion.path.enableEnable filepath completion. Show files and directories if an existing path at the cursor was recognized, either absolute or relative to the current opened document or current working directory (if the buffer is not yet saved). Defaults to true.true
format.on-saveEnable automatic formatting on save1true
idle-timeoutTime in milliseconds since last keypress before idle timers trigger.250
completion.trigger-delayTime in milliseconds after typing a word character before completions are shown, set to 5 for instant.250
completion.preview-insertWhether to apply completion item instantly when selectedtrue
completion.trigger-lengthThe min-length of word under cursor to trigger autocompletion2
completion.replaceWhether to make completions always replace the entire word and not just the part before the cursorfalse
auto-infoWhether to display info boxestrue
iconsWhether to show icons in the UI. Requires a Nerd Fontfalse
rulersList of column positions at which to display the rulers. Can be overridden by language specific rulers in languages.toml file[]
bufferline.showRenders 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"
statusline.mode.colorWhether to color the mode indicator with different colors depending on the mode itselffalse
text-widthMaximum line length. Used for the :reflow command and soft-wrapping if soft-wrap.wrap-at-text-width is set80
lsp.workspace-rootsDirectories relative to the workspace root that are treated as LSP roots. Should only be set in .mitos/config.toml[]
files.default-line-endingThe 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)."native"
files.save.insert-final-newlineWhether to automatically insert a trailing line-ending on write if missingtrue
files.save.atomicWhether to use atomic operations to write documents to disk. This prevents data loss if the editor is interrupted while writing the file, but may confuse some file watching/hot reloading programs.true
files.save.trim-final-newlinesWhether to automatically remove line-endings after the final one on writefalse
files.save.trim-trailing-whitespaceWhether to automatically remove whitespace preceding line endings on writefalse
indent.heuristicHow the indentation for a newly inserted line is computed: simple just copies the indentation level from the previous line, tree-sitter computes the indentation based on the syntax tree and hybrid combines 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)."hybrid"
jump-label-alphabetThe characters that are used to generate two character jump labels. Characters at the start of the alphabet are used first."abcdefghijklmnopqrstuvwxyz"
diagnostics.end-of-line.severityMinimum severity of diagnostics to render at the end of the line. Set to disable to disable entirely. Refer to the setting about diagnostics.inline for more details"hint"
clipboard.providerWhich API to use for clipboard interaction. One of pasteboard (MacOS), wayland, x-clip, x-sel, win32-yank, termux, tmux, windows, termcode, none, or a custom command set.Platform and environment specific.
files.editor-configWhether to read settings from EditorConfig filestrue
welcome-screenWhether to show the welcome screen when Mitos starts without a filetrue
rainbow-brackets.enableWhether to render rainbow colors for matching brackets. Requires tree-sitter rainbows.scm queries for the language.false

[editor.breadcrumb] Section

Allows configuration of the breadcrumb navigation bar.

SettingDescriptionDefault
enableWhether to enable the breadcrumb navigation barfalse
pathHow much path information to show"full"
[editor.breadcrumb]
enable = true
# full: crates > term > src > commands > typed.rs > TypableCommand > name
# file: typed.rs > TypableCommand > name
# none: TypableCommand > name
path = "full" # one of: full, file, none

The bar is displayed at the top of the view.

[editor.clipboard] Section

Mitos can be configured either to use a builtin clipboard configuration or to use a provided command.

For instance, setting it to use OSC 52 termcodes, the configuration would be:

[editor]
clipboard.provider = "termcode"

Alternatively, Mitos can be configured to use arbitrary commands for clipboard integration:

[editor.clipboard.provider.custom]
yank = { command = "cat",  args = ["test.txt"] }
paste = { command = "tee",  args = ["test.txt"] }
yank-primary = { command = "cat",  args = ["test-primary.txt"] } # optional
paste-primary = { command = "tee",  args = ["test-primary.txt"] } # optional

For custom commands the contents of the yank/paste is communicated over stdin/stdout.

[editor.statusline] Section

Allows configuring the statusline at the bottom of each view. Set global = true to show a single statusline at the bottom of the editor for the focused view. Use :toggle statusline.global to switch between the two layouts at runtime.

The configuration distinguishes between two areas of the status line:

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

Statusline elements can be defined as follows:

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

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

KeyDescriptionDefault
globalShow one statusline for the focused view instead of one per viewfalse
leftA list of elements aligned to the left of the statusline["mode", "spinner", "branch", "file-name", "read-only-indicator", "file-modification-indicator"]
rightA list of elements aligned to the right of the statusline["diagnostics", "selections", "register", "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"
diagnosticsA list of severities which are displayed for the current buffer["warning", "error"]
workspace-diagnosticsA list of severities which are displayed for the workspace["warning", "error"]

The following statusline elements can be configured:

KeyDescription
modeThe current editor mode (mode.normal/mode.insert/mode.select)
spinnerA progress spinner indicating LSP activity
branchThe current branch name or detached commit hash of the opened workspace
file-nameThe path/name of the opened file
file-absolute-pathThe absolute path/name of the opened file
file-base-nameThe basename of the opened file
current-working-directoryThe current working directory
file-modification-indicatorThe indicator to show whether the file is modified (a [+] appears when there are unsaved changes)
file-encodingThe encoding of the opened file if it differs from UTF-8
file-line-endingThe file line endings (CRLF or LF)
file-indent-styleThe file indentation style
read-only-indicatorAn indicator that shows [readonly] when a file cannot be written
total-line-numbersThe total line numbers of the opened file
file-typeThe type of the opened file
diagnosticsThe number of warnings and/or errors
workspace-diagnosticsThe number of warnings and/or errors on workspace
selectionsThe main selection index out of the number of active selections
primary-selection-lengthThe number of characters currently in the main selection
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)
registerThe current selected register
code-action-hintIndicator for when code actions are available

[editor.lsp] Section

KeyDescriptionDefault
enableEnables LSP integration. Setting to false will completely disable language servers regardless of language settings.true
messages.enableDisplay LSP window/showMessage messages below statusline2true
progress.enableDisplay LSP progress messages below statusline2false
signature-help.auto-triggerEnable automatic popup of signature help (parameter hints)true
document-highlight.auto-triggerAutomatically highlight symbol references at the cursortrue
inlay-hints.enableDisplay inlay hints3false
inlay-hints.length-limitMaximum displayed length (non-zero number) of inlay hintsUnset by default
color-swatches.enableShow color swatches next to colorstrue
signature-help.show-documentationDisplay docs under signature help popuptrue
completion.snippetsEnables snippet completions. Requires a server restart (:lsp-restart) to take effect after :config-reload/:set.true
references.include-declarationInclude declaration in the goto references popup.true

Terminal capability overrides are configured separately under [terminal]: true-color, undercurl, and keyboard.kitty-protocol. See the terminal configuration reference.

[terminal.launcher] Section

Configures the external terminal command used by features such as DAP runInTerminal requests.

KeyDescriptionDefault
commandExternal terminal or multiplexer executableEnvironment-dependent
argsArguments placed before the command Mitos asks the terminal to run[]

Mitos automatically uses a tmux split inside tmux, a WezTerm split when its Unix socket is available, Windows Terminal when found on Windows, or Conhost as the Windows fallback. On other terminals this setting is unset unless configured.

[editor.inline-blame] Section

Inline Git blame shows who last changed a line and the associated commit information at the end of the line. It is available for files tracked by Git and is hidden by default.

To show blame for the current line, add this to your config.toml:

[editor.inline-blame]
show = "cursor-line"
KeyDescriptionDefault
showWhich lines display inline blame"never"
formatText shown in the blame message"{author}, {time-ago} • {title} • {commit}"

show can be one of the following:

  • "all-lines": Display blame on all visible nonempty lines.
  • "cursor-line": Display blame on the primary cursor’s line.
  • "never": Hide inline blame.

Press Space + B to toggle inline blame off and on. The toggle preserves your choice of "all-lines" or "cursor-line". If you have not chosen a display mode, turning it on uses "cursor-line".

Blank lines and lines with uncommitted changes do not show inline blame.

To show the current line’s blame in the status area, run blame_line from the command palette (Space + ?).

format

Use format to choose which commit details appear in the blame message. For example:

[editor.inline-blame]
show = "cursor-line"
format = "{author}: {title}"

The following placeholders are available:

  • {author}: Commit author name.
  • {date}: Commit author date.
  • {time-ago}: Relative time since the commit.
  • {title}: Commit title.
  • {body}: Commit body.
  • {commit}: Abbreviated commit hash.
  • {email}: Commit author email.

[editor.cursor.shape] Section

Defines the shape of cursor in each mode. Valid values for these options are block, bar, underline, or hidden.

💡 Due to limitations of the terminal environment, only the primary cursor can change shape.

KeyDescriptionDefault
normalCursor shape in normal mode"block"
insertCursor shape in insert mode"block"
selectCursor shape in select mode"block"

[editor.file-picker] Section

Set options for file picker and global search. Ignoring a file means it is not visible in the Mitos file picker and global search.

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

KeyDescriptionDefault
hiddenEnables ignoring hidden filestrue
follow-symlinksFollow symlinks instead of ignoring themtrue
deduplicate-linksIgnore symlinks that point at files already shown in the pickertrue
parentsEnables reading ignore files from parent directoriestrue
ignoreEnables reading .ignore filestrue
git-ignoreEnables reading .gitignore filestrue
git-globalEnables reading global .gitignore, whose path is specified in git’s config: core.excludesfile optiontrue
git-excludeEnables reading .git/info/exclude filestrue
max-depthSet with an integer value for maximum depth to recurseUnset by default

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 Mitos-specific ignore files by creating a local .mitos/ignore file in the current workspace or a global ignore file located in your Mitos config directory:

  • Linux and Mac: ~/.config/mitos/ignore
  • Windows: %AppData%\mitos\ignore

Example:

# unignore in file picker and global search
!.github/
!.gitignore
!.gitattributes

[editor.file-explorer] Section

In addition to the options for the file picker and global search, a similar set of options is presented to configure the file explorer separately. However, unlike the file picker, the defaults are set to avoid ignoring most files.

Note that the ignore files consulted by the file explorer when ignore is set to true are the same ones used by the file picker, including the aforementioned Mitos-specific ignore files.

KeyDescriptionDefault
hiddenEnables ignoring hidden filesfalse
follow-symlinksFollow symlinks instead of ignoring themfalse
parentsEnables reading ignore files from parent directoriesfalse
ignoreEnables reading .ignore filesfalse
git-ignoreEnables reading .gitignore filesfalse
git-globalEnables reading global .gitignore, whose path is specified in git’s config: core.excludesfile optionfalse
git-excludeEnables reading .git/info/exclude filesfalse

[editor.buffer-picker] Section

Set options for buffer picker.

KeyDescriptionDefault
start-positionControls behavior for which buffer is initially selectedcurrent

Example

[editor.buffer-picker]
start-position = "previous"

[editor.auto-pairs] Section

Automatic delimiter pairing uses an enable flag and an optional pairs map. Omit the map to use the built-in pairs, or provide opening and closing characters:

[editor.auto-pairs]
enable = true
pairs = { '(' = ')', '[' = ']', '{' = '}', '"' = '"' }

Set enable = false to disable pairing. The same table is supported per language. See the configuration reference for defaults and compatibility shorthands.

[editor.files.auto-save] Section

Control auto save behavior.

KeyDescriptionDefault
focus-lostEnable automatic saving on the focus moving away from Mitos. Requires focus event support from your terminalfalse
after-delay.enableEnable automatic saving after files.auto-save.after-delay.timeout milliseconds have passed since last edit.false
after-delay.timeoutTime in milliseconds since last edit before auto save timer triggers.3000

[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, nbsp, nnbsp, tab, and newline"none"
charactersLiteral characters to use when rendering whitespace. Sub-keys may be any of tab, space, nbsp, nnbsp, newline or tabpadSee example below

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)

[editor.indent-guides] Section

Options for rendering vertical indent guides.

KeyDescriptionDefault
renderWhether to render indent guidesfalse
characterLiteral character to use for rendering the indent guide"│"
skip-levelsNumber of indent levels to skip0

Example:

[editor.indent-guides]
render = true
character = "╎" # 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.

KeyDescriptionDefault
layoutA vector of gutters to display["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

KeyDescriptionDefault
min-widthThe minimum number of characters to use3

Example:

[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.gutters.code-action-hint] Section

The code-action-hint gutter option displays an indicator for whether a code action is available at current selection.

There are currently no options for this section.

[editor.soft-wrap] Section

Options for soft wrapping lines that exceed the view width:

KeyDescriptionDefault
enableWhether soft wrapping is enabled.false
max-wrapMaximum free space left at the end of the line.20
max-indent-retainMaximum indentation to carry over when soft wrapping a line.40
wrap-indicatorText inserted before soft wrapped lines, highlighted with ui.virtual.wrap"↪ "
wrap-at-text-widthSoft wrap at text-width instead of using the full viewport size.false

Example:

[editor.soft-wrap]
enable = true
max-wrap = 25 # increase value to reduce forced mid-word wrapping
max-indent-retain = 0
wrap-indicator = ""  # set wrap-indicator to "" to hide it

[editor.indent.smart-tab] Section

Options for navigating and editing using tab key.

KeyDescriptionDefault
enableIf 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.true
supersede-menuNormally, 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 indent.smart-tab command. If this option is set to true, the indent.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.false

Due 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"

[editor.diagnostics.inline] Section

Options for rendering diagnostics inside the text like shown below

fn main() {
  let foo = bar;
            └─ no such value in this scope
}
KeyDescriptionDefault
cursor-lineThe minimum severity that a diagnostic must have to be shown inline on the line that contains the primary cursor. Set to disable to not show any diagnostics inline. This option does not have any effect when in insert-mode and will only take effect 350ms after moving the cursor to a different line."warning"
other-linesThe minimum severity that a diagnostic must have to be shown inline on a line that does not contain the cursor-line. Set to disable to not show any diagnostics inline."disable"
min-diagnostic-widthMinimum width reserved for diagnostic text. Inline diagnostics are hidden when the view cannot provide this width plus the prefix.40
prefix-lenHow many horizontal bars ─ are rendered before the diagnostic text.1
max-wrapEquivalent of the editor.soft-wrap.max-wrap option for diagnostics.20
max-diagnosticsMaximum number of diagnostics to render inline for a given line10

The allowed values for cursor-line and other-lines are: error, warning, info, hint.

The (first) diagnostic with the highest severity that is not shown inline is rendered at the end of the line (as long as its severity is higher than the diagnostics.end-of-line.severity config option):

fn main() {
  let baz = 1;
  let foo = bar; a local variable with a similar name exists: baz
            └─ no such value in this scope
}

[editor.spelling] Section

Spell checking is opt-in. See the editor.spelling configuration reference for settings and Spell checking for dictionaries, corrections, and personal word lists.

[editor.completion.word] Section

Options for controlling completion of words from open buffers.

KeyDescriptionDefault
enableWhether word completion is enabledtrue
trigger-lengthNumber of word characters to type before triggering completion7

Example:

[editor.completion.word]
enable = true
# Set the trigger length lower so that words are completed more often
trigger-length = 4

[editor.workspace-trust] Section

Controls implicit workspace trust. See the workspace trust chapter for the full feature.

KeyDescriptionDefault
levelThe default level of trust for every workspace."servers"
promptWhether to show a modal when opening a file in an untrusted workspace.true
trustedGlob patterns whose matching workspaces are trusted without a grant.[]

Example:

[editor.workspace-trust]
# Even if `false`, the statusline `[⚠]` indicator is still shown.
prompt = false

# "none":     prompt for every workspace.
# "servers":  trust LSP and DAP launches but still gate local config and git;
#             .mitos/config.toml, .mitos/languages.toml, etc. need :workspace-trust.
# "insecure": trust everything (discouraged).
level = "servers"

# Discouraged: skips .mitos/ change detection and trusts anything that lands
# under a matching path. `~` and environment variables are expanded.
trusted = ["~/src/github.com/me/*"]

  1. In most cases, you also need to enable the auto-format setting under languages.toml. You can find the reasoning here. ↩

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

  3. You may also have to activate them in the language server config for them to appear, not just in Mitos. Inlay hints in Mitos are still being improved on and may be a little bit laggy/janky under some circumstances. Please report any bugs you see so we can fix them! ↩