|
Some checks are pending
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* feat: finally directly generate markdown files * fix: trim * fix: await |
||
|---|---|---|
| .. | ||
| README.md | ||
Tinymist Helix Support for Typst
Run and configure tinymist in helix for Typst.
Features
See Tinymist Features for a list of features.
Finding Executable
To enable LSP, you must install tinymist. You can find tinymist by:
-
Night versions available at GitHub Actions.
-
Stable versions available at GitHub Releases.
If you are using the latest version of typst-ts-mode, then you can use commandtypst-ts-lsp-download-binaryto download the latest stable binary oftinymistattypst-ts-lsp-download-path. -
Build from source by cargo. You can also compile and install latest
tinymistby Cargo.cargo install --git https://github.com/Myriad-Dreamin/tinymist --locked tinymist
Setup Server
Update .config/helix/languages.toml to use tinymist.
[language-server.tinymist]
command = "tinymist"
[[language]]
name = "typst"
language-servers = ["tinymist"]
Tips
Getting Preview Feature
Default Preview Feature and Background Preview Feature are suitable in helix.
Working with Multiple-File Projects
There is a way in Neovim, but you cannot invoke related commands with arguments by :lsp-workspace-command in helix. As a candidate solution, assuming your having following directory layout:
├── .helix
│ └── languages.toml
└── main.typ
You could create .helix/languages.toml in the project folder with the following contents:
[language-server.tinymist.config]
typstExtraArgs = ["main.typ"]
Then all diagnostics and autocompletion will be computed according to the main.typ.
Note: With that configuration, if you’re seeing a file that is not reachable by main.typ, you will not get diagnostics and autocompletion correctly in that file.
Extra Settings
To configure the language server, edit the language-server.tinymist section. For example, if you want to export PDF on typing and output files in $root_dir/target directory:
[language-server.tinymist]
command = "tinymist"
config = { exportPdf = "onType", outputPath = "$root/target/$dir/$name" }
To enable a live preview you can use the preview.background:
[language-server.tinymist]
command = "tinymist"
config = { preview.background.enabled = true", preview.background.args = ["--data-plane-host=127.0.0.1:23635", "--invert-colors=never", "--open"] }
See Tinymist Server Configuration for references.