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
- Options
- Full Spec
opts = {
ensure_installed = { "typst" },
}
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "typst" },
},
}
nvim-lspconfig
- Options
- Full Spec
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",
},
},
},
}
{
"neovim/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
- Options
- Full Spec
opts = {
dependencies_bin = {
tinymist = "tinymist",
},
}
{
"chomosuke/typst-preview.nvim",
cmd = { "TypstPreview", "TypstPreviewToggle", "TypstPreviewUpdate" },
keys = {
{
"<leader>cp",
ft = "typst",
"<cmd>TypstPreviewToggle<cr>",
desc = "Toggle Typst Preview",
},
},
opts = {
dependencies_bin = {
tinymist = "tinymist",
},
},
}
ts-comments.nvim
- Options
- Full Spec
opts = {
lang = {
typst = { "// %s", "/* %s */" },
},
}
{
"folke/ts-comments.nvim",
opts = {
lang = {
typst = { "// %s", "/* %s */" },
},
},
}
conform.nvim (optional)
- Options
- Full Spec
opts = {
formatters_by_ft = {
typst = { "typstyle", lsp_format = "prefer" },
},
}
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
typst = { "typstyle", lsp_format = "prefer" },
},
},
}