Back to Marktext

PREFERENCES

packages/website/content/docs/end-user/PREFERENCES.md

0.19.117.7 KB
Original Source

MarkText Preferences

Preferences can be controlled and modified in the settings window or via the preferences.json file in the application data directory. The authoritative list of keys, defaults, and accepted values lives in src/main/preferences/schema.json — the tables below mirror that schema.

General

KeyTypeDefaultDescription
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.
fileSortByStringmodifiedSort files in the opened folder. Optional values: created, modified, title.
fileSortOrderStringascSort order for files in opened folders: asc (ascending) or desc (descending).
startUpActionStringrestoreAllThe action when MarkText launches. Optional values: folder, openLastFolder, blank, restoreAll.
defaultDirectoryToOpenString""The path that should be opened when startUpAction=folder.
languageStringenThe display language MarkText uses.
restoreLayoutStateBooleantrueRestore the previous editor state (open tabs, layout) on startup.
openedFilesInSidebarBooleantrueWhether to show the Opened Files subsection inside the sidebar file tree.

Editor

KeyTypeDefaultDescription
editorFontFamilyStringOpen SansEditor font family.
fontSizeNumber16Font size in pixels. Range 1232.
lineHeightNumber1.6Line height. Range 1.22.0.
wrapCodeBlocksBooleantrueWrap 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 1228.
codeFontFamilyStringDejaVu Sans MonoCode-block font family.
codeBlockLineNumbersBooleantrueShow line numbers inside code blocks.
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 src/main/preferences/schema.json for the full enum (35 encodings).
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.
autoNormalizeLineEndingsBooleanfalseAutomatically normalize line endings when opening files. When disabled, files are opened as-is.

Markdown

KeyTypeDefaultDescription
preferLooseListItemBooleantrueThe preferred list type.
bulletListMarkerString-Marker for bullet lists. Optional values: -, *, +.
orderListDelimiterString.Delimiter for ordered lists. Optional values: ., ).
preferHeadingStyleStringatxHeading style. Optional values: atx, setext (details).
tabSizeNumber4Number of spaces a tab equals.
listIndentationMixed1List indentation. Optional values: dfm, tab, or a number 14.
frontmatterTypeString-Frontmatter delimiter: - (YAML), + (TOML), ; (JSON), or { (JSON).
superSubScriptBooleanfalseEnable pandoc's superscript/subscript markdown extension.
footnoteBooleanfalseEnable pandoc's footnote markdown extension.
isHtmlEnabledBooleantrueEnable inline HTML rendering.
isGitlabCompatibilityEnabledBooleanfalseEnable GitLab compatibility mode.
sequenceThemeStringhandTheme for js-sequence-diagrams: hand or simple.

Theme

KeyTypeDefaultDescription
themeStringlightThe current theme id. See Themes for the full list.
followSystemThemeBooleanfalseFollow 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-USThe spell-checker language (BCP-47, e.g. en-US, de-DE, zh-CN).

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 entries are marked --internal in the schema. They have no UI control and must be edited directly in preferences.json.

View
KeyTypeDefaultDescription
sideBarVisibilityBooleanfalseInitial visibility of the sidebar. Overridden by the menu / shortcut.
tabBarVisibilityBooleanfalseInitial visibility of the tab bar. Overridden by the menu / shortcut.
sourceCodeModeEnabledBooleanfalseInitial source-code mode state. Overridden by the menu / shortcut.
General (internal)
KeyTypeDefaultDescription
lastOpenedFolderString""The last folder opened in MarkText (used for session restore).
Custom CSS
KeyTypeDefaultDescription
customCssString""Extra CSS appended after the active theme stylesheet.
File system / Searcher
KeyTypeDefaultDescription
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 to receive file changes. Necessary for network shares; may cause high CPU utilization on large workspaces.