This configuration specifies the way to resolved projects.
- Type:
string
- Enum:
singleFile
: Manage typst documents like what we did in Markdown. Each single file is an individual document and no project resolution is needed.lockDatabase
: Manage typst documents like what we did in Rust. For each workspace, tinymist tracks your preview and compilation history, and stores the information in a lock file. Tinymist will automatically selects the main file to use according to the lock file. This also allows other tools push preview and export tasks to language server by updating the lock file.
- Default:
"singleFile"
The path pattern to store Typst artifacts, you can use $root
or $dir
or $name
to do magic configuration, e.g. $dir/$name
(default) and $root/target/$dir/$name
.
- Type:
string
The target to export the document to. Defaults to paged
. Note: you can still export pdf when it is set to html
. This configuration only affects how the language server completes your code.
- Type:
string
- Enum:
paged
: The current export target is for PDF, PNG, and SVG export.html
: The current export target is for HTML export.
- Default:
"paged"
The extension can export PDFs of your Typst files. This setting controls whether this feature is enabled and how often it runs.
- Type:
string
- Enum:
never
: Never export PDFs, you will manually run typst.onSave
: Export PDFs when you save a file.onType
: Export PDFs as you type in a file.onDocumentHasTitle
: Export PDFs when a document has a title (and save a file), which is useful to filter out template files.
- Default:
"never"
Configure the root for absolute paths in typst. Hint: you can set the rootPath to -
, so that tinymist will always use parent directory of the file as the root path. Note: for neovim users, if it complains root not found, you must set require("lspconfig")["tinymist"].setup { root_dir }
as well, see tinymist#528.
- Type:
string
ornull
Whether to configure default word separators on startup
- Type:
string
- Enum:
enable
: Override the default word separators on startupdisable
: Do not override the default word separators on startup
- Default:
"enable"
Enable or disable semantic tokens (LSP syntax highlighting)
- Type:
string
- Enum:
enable
: Use semantic tokens for syntax highlightingdisable
: Do not use semantic tokens for syntax highlighting
- Default:
"enable"
Whether to prefix newlines after comments with the corresponding comment prefix.
- Type:
boolean
- Default:
true
Enable or disable experimental/onEnter (LSP onEnter feature) to allow automatic insertion of characters on enter, such as ///
for comments. Note: restarting the editor is required to change this setting.
- Type:
boolean
- Default:
true
A flag that determines whether to load system fonts for Typst compiler, which is useful for ensuring reproducible compilation. If set to null or not set, the extension will use the default behavior of the Typst compiler. Note: You need to restart LSP to change this options.
- Type:
boolean
- Default:
true
A list of file or directory path to fonts. Note: The configuration source in higher priority will override the configuration source in lower priority. The order of precedence is: Configuration tinymist.fontPaths
> Configuration tinymist.typstExtraArgs.fontPaths
> LSP's CLI Argument --font-path
> The environment variable TYPST_FONT_PATHS
(a path list separated by ;
(on Windows) or :
(Otherwise)). Note: If the path to fonts is a relative path, it will be resolved based on the root directory. Note: In VSCode, you can use VSCode variables in the path, e.g. ${workspaceFolder}/fonts
.
- Type:
array
ornull
In VSCode, enable compile status meaning that the extension will show the compilation status in the status bar. Since Neovim and Helix don't have a such feature, it is disabled by default at the language server label.
- Type:
string
- Enum:
enable
disable
- Default:
"enable"
Set format string of the server status. For example, {compileStatusIcon}{wordCount} [{fileName}]
will format the status as $(check) 123 words [main]
. Valid placeholders are:
{compileStatusIcon}
: Icon indicating the compile status{wordCount}
: Number of words in the document{fileName}
: Name of the file being compiled
Note: The status bar will be hidden if the format string is empty.
- Type:
string
- Default:
"{compileStatusIcon} {wordCount} [{fileName}]"
You can pass any arguments as you like, and we will try to follow behaviors of the same version of typst-cli. Note: the arguments may be overridden by other settings. For example, --font-path
will be overridden by tinymist.fontPaths
.
- Type:
array
- Default:
[]
The extension can use a local tinymist executable instead of the one bundled with the extension. This setting controls the path to the executable. The string "tinymist" means look up Tinymist in PATH.
- Type:
string
ornull
Traces the communication between VS Code and the language server.
- Type:
string
- Enum:
off
messages
verbose
- Default:
"off"
The extension can format Typst files using typstfmt or typstyle.
- Type:
string
- Enum:
disable
: Formatter is not activated.typstyle
: Use typstyle formatter.typstfmt
: Use typstfmt formatter.
- Default:
"disable"
Sets the print width for the formatter, which is a soft limit of characters per line. See the definition of Print Width. Note: this has lower priority than the formatter's specific configurations.
- Type:
number
- Default:
120
Sets the indent size (using space) for the formatter.
- Type:
number
- Default:
2
Configures way of opening exported files, e.g. inside of editor tabs or using system application.
Whether to handle drag-and-drop of resources into the editing typst document. Note: restarting the editor is required to change this setting.
- Type:
string
- Enum:
enable
disable
- Default:
"enable"
Whether to handle paste of resources into the editing typst document. Note: restarting the editor is required to change this setting.
- Type:
string
- Enum:
enable
disable
- Default:
"enable"
(Experimental) Whether to render typst elements in (hover) docs. In VS Code, when this feature is enabled, tinymist will store rendered results in the filesystem's temporary storage to show them in the hover content. Note: Please disable this feature if the editor doesn't support/handle image previewing in docs.
- Type:
string
- Enum:
enable
disable
- Default:
"enable"
Whether to trigger completions on arguments (placeholders) of snippets. For example, box
will be completed to box(|)
, and server will request the editor (lsp client) to request completion after moving cursor to the placeholder in the snippet. Note: this has no effect if the editor doesn't support editor.action.triggerSuggest
or tinymist.triggerSuggestAndParameterHints
command. Hint: Restarting the editor is required to change this setting.
- Type:
boolean
Whether to enable postfix code completion. For example, [A].box|
will be completed to box[A]|
. Hint: Restarting the editor is required to change this setting.
- Type:
boolean
- Default:
true
Whether to enable UFCS-style completion. For example, [A].box|
will be completed to box[A]|
. Hint: Restarting the editor is required to change this setting.
- Type:
boolean
- Default:
true
Whether to enable left-variant UFCS-style completion. For example, [A].table|
will be completed to table(|)[A]
. Hint: Restarting the editor is required to change this setting.
- Type:
boolean
- Default:
true
Whether to enable right-variant UFCS-style completion. For example, [A].table|
will be completed to table([A], |)
. Hint: Restarting the editor is required to change this setting.
- Type:
boolean
- Default:
true
Enable or disable preview features of Typst. Note: restarting the editor is required to change this setting.
- Type:
string
- Enum:
enable
disable
- Default:
"enable"
Refresh preview when the document is saved or when the document is changed
- Type:
string
- Enum:
onSave
: Refresh preview on saveonType
: Refresh preview on type
- Default:
"onType"
Configure scroll sync mode.
- Type:
string
- Enum:
never
: Disable automatic scroll synconSelectionChangeByMouse
: Scroll preview to current cursor position when selection changes by mouseonSelectionChange
: Scroll preview to current cursor position when selection changes by mouse or keyboard (any source)
- Default:
"onSelectionChangeByMouse"
Only render visible part of the document. This can improve performance but still being experimental.
- Type:
boolean
- Default:
true
Invert colors of the preview (useful for dark themes without cost). Please note you could see the origin colors when you hover elements in the preview. It is also possible to specify strategy to each element kind by an object map in JSON format.
(Experimental) Show typst cursor indicator in preview.
- Type:
boolean