LazyVim.LazyVim/lua/lazyvim/plugins/extras/lang/typst.lua

65 lines
1.2 KiB
Lua
Raw Normal View History

2024-07-15 10:43:37 +07:00
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "typst" },
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "typst" },
},
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
2024-10-29 08:31:02 +07:00
tinymist = {
single_file_support = true,
root_dir = function()
LazyVim.root.get()
end,
2024-10-29 08:31:02 +07:00
settings = {
formatterMode = "typstyle",
},
},
2024-07-15 10:43:37 +07:00
},
},
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
typst = { "typstyle", lsp_format = "prefer" },
},
},
},
2024-07-15 10:43:37 +07:00
{
"chomosuke/typst-preview.nvim",
2024-10-29 08:31:02 +07:00
cmd = { "TypstPreview", "TypstPreviewToggle", "TypstPreviewUpdate" },
build = function(plugin)
local typst_preview = require("typst-preview")
typst_preview.setup(plugin.opts)
typst_preview.update()
2024-07-15 10:43:37 +07:00
end,
keys = {
{
"<leader>cp",
ft = "typst",
"<cmd>TypstPreviewToggle<cr>",
desc = "Typst Preview",
},
},
2024-07-15 10:43:37 +07:00
opts = {
dependencies_bin = {
2024-10-29 08:31:02 +07:00
tinymist = "tinymist",
2024-07-15 10:43:37 +07:00
},
},
},
}