1. Introduction
  2. Editor Integration
  3. Common Configurations
  4. 1. Editor Frontends
    1. 1.1. VS Cod(e,ium)
    2. 1.2. Neovim
    3. 1.3. Emacs
    4. 1.4. Sublime Text
    5. 1.5. Helix
    6. 1.6. Zed
  5. Features
  6. 2. Command line interface
  7. 3. Code Documentation
  8. 4. Code Completion
  9. 5. Exporting Documents
  10. 6. Document Preview
  11. 7. Testing
  12. 8. Linting
  13. 9. Other Features
  14. Service Overview
  15. Overview of Service
  16. 10. Principles
  17. 11. Commands System
  18. 12. LSP Inputs
  19. 13. Type System
  20. Service Development
  21. 14. Crate Docs
  22. 15. LSP and CLI
  23. 16. Language Queries
  24. 17. Document Preview

Tinymist Docs

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 command typst-ts-lsp-download-binary to download the latest stable binary of tinymist at typst-ts-lsp-download-path.

  • Build from source by cargo. You can also compile and install latest tinymist by Cargo.

    1
    cargo install --git https://github.com/Myriad-Dreamin/tinymist --locked tinymist
    1
    cargo install --git https://github.com/Myriad-Dreamin/tinymist --locked tinymist

#

Setup Server

Update .config/helix/languages.toml to use tinymist.

1
[language-server.tinymist]
2
command = "tinymist"
3

4
[[language]]
5
name = "typst"
6
language-servers = ["tinymist"]
1
[language-server.tinymist]
2
command = "tinymist"
3

4
[[language]]
5
name = "typst"
6
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:

1
├── .helix
2
│   └── languages.toml
3
└── main.typ
1
├── .helix
2
│   └── languages.toml
3
└── main.typ

You could create .helix/languages.toml in the project folder with the following contents:

1
[language-server.tinymist.config]
2
typstExtraArgs = ["main.typ"]
1
[language-server.tinymist.config]
2
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 language server, you can edit the language-server.tinymist section. For example, if you want to export PDF on typing and output files in $root_dir/target directory:

1
[language-server.tinymist]
2
command = "tinymist"
3
config = { exportPdf = "onType", outputPath = "$root/target/$dir/$name" }
1
[language-server.tinymist]
2
command = "tinymist"
3
config = { exportPdf = "onType", outputPath = "$root/target/$dir/$name" }

See Tinymist Server Configuration for references.