Skip to main content

Typst

info

You can enable the extra with the :LazyExtras command. Plugins marked as optional will only be configured if they are installed.

Below you can find a list of included plugins and their default settings.

caution

You don't need to copy the default settings to your config. They are only shown here for reference.

nvim-treesitter

opts = {
ensure_installed = { "typst" },
}

nvim-lspconfig

opts = {
servers = {
tinymist = {
keys = {
{
"<leader>cP",
function()
local buf_name = vim.api.nvim_buf_get_name(0)
local file_name = vim.fn.fnamemodify(buf_name, ":t")
LazyVim.lsp.execute({
command = "tinymist.pinMain",
arguments = { buf_name },
})
LazyVim.info("Tinymist: Pinned " .. file_name)
end,
desc = "Pin main file",
},
},
single_file_support = true, -- Fixes LSP attachment in non-Git directories
settings = {
formatterMode = "typstyle",
},
},
},
}

typst-preview.nvim

opts = {
dependencies_bin = {
tinymist = "tinymist",
},
}

ts-comments.nvim

opts = {
lang = {
typst = { "// %s", "/* %s */" },
},
}

conform.nvim (optional)

opts = {
formatters_by_ft = {
typst = { "typstyle", lsp_format = "prefer" },
},
}