feat(lsp): Add support for typst

Add support for handling Typst files.
This commit is contained in:
Robert Morrison 2025-12-21 20:43:30 +00:00
parent 8d30935771
commit 304ea02edd
2 changed files with 19 additions and 0 deletions

12
ftplugin/typst.lua Normal file
View File

@ -0,0 +1,12 @@
vim.wo.spell = true
vim.bo.textwidth = 75
vim.wo.colorcolumn = "75,80"
vim.api.nvim_buf_create_user_command(0, "OpenPdf", function()
local filepath = vim.api.nvim_buf_get_name(0)
if filepath:match("%.typ$") then
local pdf_path = filepath:gsub("%.typ$", ".pdf")
vim.system({ "xdg-open", pdf_path })
end
end, {})

View File

@ -1,5 +1,12 @@
-- Manual lspconfig/changes where needed -- Manual lspconfig/changes where needed
vim.lsp.config("tinymist", {
settings = {
formatterMode = "typstyle",
exportPdf = "onSave",
},
})
vim.lsp.config("termux_language_server", { vim.lsp.config("termux_language_server", {
filetypes = { filetypes = {
-- Android Termux -- Android Termux