MarkText logoMarkTextDocs
User documentation

Preferences#

Preferences can be changed in the settings window or via preferences.json in the application data directory. Close MarkText before editing the file manually. Validation rules live in packages/desktop/src/shared/preferences/schema.json; src/main/preferences/preferenceFile.ts combines schema defaults, packages/desktop/static/preference.json and recovery defaults from src/shared/types/preferences.ts. Language and theme are initialized from the system. The tables below show application initial values; existing saved preferences can override them.

Invalid individual values fall back to defaults. An unreadable, malformed or non-object preference file is preserved and treated as read-only for that run. Unknown keys in a valid file are retained on disk but are not applied as preferences.

General

KeyTypeDefaultDescription
defaultOpenModeStringeditMode for newly opened existing documents: edit or read. Available in Preferences → General since 0.23.0.
openFilesInPreviewModeBooleantrueReuse a preview tab for sidebar files; editing or double-clicking keeps it open. Available in Preferences → General since 0.23.0.
autoSaveBooleanfalseAutomatically save the content being edited.
autoSaveDelayNumber5000The delay in milliseconds after a change before a file is saved automatically. Minimum 1000.
titleBarStyleStringcustomThe title bar style on Linux and Windows: custom or native.
openFilesInNewWindowBooleanfalseOpen files in a new window.
openFolderInNewWindowBooleanfalseOpen folder via menu in a new window.
zoomNumber1.0The zoom level. Between 0.5 and 2.0 inclusive.
hideScrollbarBooleanfalseWhether to hide scrollbars.
wordWrapInTocBooleanfalseWhether to enable word wrap in the table of contents.
tocPositionStringleftDock the table of contents to the left or right of the editor.
fileSortByStringcreatedSort files in the opened folder. Optional values: created, modified, title.
fileSortOrderStringascSort order for files in opened folders: asc (ascending) or desc (descending).
startUpActionStringrestoreAllStartup action: restoreAll, restoreLastWindow, openLastFolder, folder or blank.
defaultDirectoryToOpenString""The path that should be opened when startUpAction=folder.
languageStringSystem localeDetected from the system locale on first launch, falling back to en when no supported locale matches.
restoreLayoutStateBooleantrueRestore window bounds, pane layout and project-tree folding.
restoreEditorsBooleantrueRestore saved document tabs. Unsaved recovery content is protected independently.
restoreViewStateBooleantrueRestore document cursors, selections, scroll positions and heading folding.
openedFilesInSidebarBooleantrueWhether to show the Opened Files subsection inside the sidebar file tree.
autoRevealInSidebarBooleantrueReveal the active file in the sidebar file tree: expand its folders and scroll the file into view.
showPandocConvertBooleanfalseShow the Pandoc conversion menu.

Editor

KeyTypeDefaultDescription
editorFontFamilyStringOpen SansEditor font family.
fontSizeNumber16Font size in pixels. Range 12–32.
lineHeightNumber1.6Line height. Range 1.2–2.0.
wrapCodeBlocksBooleanfalseWrap text inside code blocks.
editorLineWidthString""Maximum editor area width. Empty or a value with a ch, px or % suffix.
codeFontSizeNumber14Font size inside code blocks. Range 12–28.
codeFontFamilyStringDejaVu Sans MonoFont family for inline code and code blocks.
codeBlockLineNumbersBooleanfalseShow line numbers inside code blocks.
sourceCodeLineNumbersBooleantrueShow line numbers in source code mode.
trimUnnecessaryCodeBlockEmptyLinesBooleantrueTrim the beginning and ending empty lines in code blocks.
autoPairBracketBooleantrueAuto-close brackets when editing.
autoPairMarkdownSyntaxBooleantrueAutocomplete markdown syntax.
autoPairQuoteBooleantrueAuto-close quotes.
endOfLineStringdefaultNewline character at the end of each line: default (OS default), lf, or crlf.
defaultEncodingStringutf8The default file encoding. See packages/desktop/src/shared/preferences/schema.json for the accepted encoding names.
autoGuessEncodingBooleantrueTry to automatically guess the file encoding when opening files.
trimTrailingNewlineNumber2Trailing-newline handling: 0 trim all, 1 ensure single newline, 2 auto-detect, 3 disabled.
textDirectionStringltrWriting direction: ltr or rtl.
hideQuickInsertHintBooleanfalseHide the hint for the quick-insert overlay.
hideLinkPopupBooleanfalseHide the link popup when the cursor hovers over a link.
autoCheckBooleanfalseWhether to automatically check related task items when one is toggled.
autoNormalizeLineEndingsBooleanfalseNormalize loaded documents to LF instead of scheduling conversion back to detected non-LF line endings on save. The editor always uses LF internally.

Markdown

KeyTypeDefaultDescription
githubAlertsBooleanfalseEnable GitHub Alerts, creation/conversion menus, and HTML/PDF rendering. Available in Preferences → Markdown since 0.22.0.
plantumlServerStringhttps://www.plantuml.com/plantumlPlantUML rendering server. Set an HTTP(S) server URL in Preferences → Markdown. Diagram rendering sends the encoded source to that server.
preferLooseListItemBooleantruePrefer loose list items when creating lists.
bulletListMarkerString-Marker for bullet lists. Optional values: -, *, +.
orderListDelimiterString.Delimiter for ordered lists. Optional values: ., ).
preferHeadingStyleStringatxHeading style. Optional values: atx, setext (details).
tabSizeMixed4Tab-key indentation: a number of spaces, or tab to insert a tab character.
listIndentationMixed1List indentation. Optional values: dfm, tab, or a number 1–4.
frontmatterTypeString-Frontmatter delimiter: - (YAML), + (TOML), ; (JSON), or { (JSON).
superSubScriptBooleanfalseEnable pandoc's superscript/subscript markdown extension.
footnoteBooleanfalseEnable pandoc's footnote markdown extension.
texMathDollarsBooleantrueEnable pandoc's tex_math_dollars extension — $…$ and $$…$$ math.
texMathGfmBooleanfalseEnable pandoc's tex_math_gfm extension — GitHub's $`…`$ and ```math math. The former isGitlabCompatibilityEnabled key is no longer applied; enable this option explicitly.
texMathSingleBackslashBooleanfalseEnable pandoc's tex_math_single_backslash extension — \(…\) inline and \[…\] display math. Off by default, as in pandoc: it precludes escaping ( and [, so - \[TODO\] reads as a formula.
texMathDoubleBackslashBooleanfalseEnable pandoc's tex_math_double_backslash extension — \\(…\\) inline and \\[…\\] display math.
fancyListsBooleanfalseEnable pandoc's fancy_lists extension — a., IV., (1) and #. list markers. Pandoc exports then use pandoc's markdown reader.
highlightSyntaxBooleanfalseEnable the non-standard ==highlight== syntax used by Obsidian, Typora and Logseq. Renders as <mark> in the editor and in the HTML/PDF exports; == stays literal text while off.
inlineDiffBooleanfalseEnable GitLab's non-standard {+ … +} / [- … -] inline diff syntax. Additions render as <ins> and deletions as <del> in the editor and in the HTML/PDF exports; the tags stay literal text while off.
multilineBlockquoteBooleanfalseEnable GitLab's non-standard >>> … >>> multiline blockquote syntax. The fence is preserved on save and renders as a <blockquote> in the HTML/PDF exports; while off the fence stays literal text.
isHtmlEnabledBooleantrueEnable inline HTML rendering.
softNewlineAsSpaceBooleanfalseTreat a soft line break (a single bare newline within a paragraph) as a space instead of a line break.
sequenceThemeStringhandTheme for js-sequence-diagrams: hand or simple.
mermaidLightThemeStringdefaultMermaid theme used with a light application theme. Configurable in Preferences → Markdown.
mermaidDarkThemeStringdarkMermaid theme used with a dark application theme. Per-diagram configuration can override it; see Markdown syntax.

Theme

KeyTypeDefaultDescription
themeStringSystem light/darkInitial theme follows the system: light or dark. See Themes for theme IDs.
followSystemThemeBooleantrueFollow the system light/dark mode and switch automatically.
lightModeThemeStringlightTheme id used when the system is in light mode (only when followSystemTheme is true).
darkModeThemeStringdarkTheme id used when the system is in dark mode (only when followSystemTheme is true).

Spelling

KeyTypeDefaultDescription
spellcheckerEnabledBooleanfalseWhether spell checking is enabled.
spellcheckerNoUnderlineBooleanfalseDon't underline spelling mistakes.
spellcheckerLanguageStringen-USSpell-checker language on Linux/Windows; choose from the available dictionaries. macOS uses system language detection.

Image

KeyTypeDefaultDescription
imageInsertActionStringpathDefault action after inserting a local image: upload, folder, or path.
imagePreferRelativeDirectoryBooleanfalsePrefer the relative image directory when copying images.
imageRelativeDirectoryBaseStringfileWhere relative images are anchored: file (next to the document) or folder (project root).
imageRelativeDirectoryNameStringassetsFolder name (or relative path) used for local image copies. Supports the ${filename} variable.

Editable via file

These settings are primarily edited in preferences.json; exceptions with Preferences controls are noted below.

View

The source-code preference below supplies the default for a new layout. Sidebar, tab-bar and outline visibility and dimensions are window layout state, stored separately in state/application-state.json. The old tocVisibility, sideBarVisibility, tabBarVisibility and lastOpenedFolder preference keys are no longer applied.

KeyTypeDefaultDescription
sourceCodeModeEnabledBooleanfalseInitial source-code mode state. Overridden by the menu / shortcut.
Custom CSS

Although marked internal in the schema, customCss is editable in Preferences → Theme.

KeyTypeDefaultDescription
customCssString""Extra CSS appended after the active theme stylesheet.
File system / Searcher

treePathExcludePatterns is validated by the shared preference schema and used by the filesystem watcher.

KeyTypeDefaultDescription
treePathExcludePatternsArray of Strings[]Exclude matching paths from the sidebar filesystem watcher.
searchExclusionsArray of Strings[]Filename glob exclusions for the in-folder search.
searchMaxFileSizeString""Maximum file size to search in (e.g. 50K, 10M, 2G). Empty means unlimited.
searchIncludeHiddenBooleanfalseSearch hidden files and directories.
searchNoIgnoreBooleanfalseDon't respect ignore files such as .gitignore.
searchFollowSymlinksBooleantrueWhether to follow symbolic links.
Watcher
KeyTypeDefaultDescription
watcherUsePollingBooleanfalseUse polling for file changes. This can help on network shares but may increase CPU use on large workspaces.