From 304ea02eddabbb3418864e6e2dd38ce975523d08 Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Sun, 21 Dec 2025 20:43:30 +0000 Subject: [PATCH] feat(lsp): Add support for typst Add support for handling Typst files. --- ftplugin/typst.lua | 12 ++++++++++++ lua/core/lspconfig.lua | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 ftplugin/typst.lua diff --git a/ftplugin/typst.lua b/ftplugin/typst.lua new file mode 100644 index 0000000..1ee7e1a --- /dev/null +++ b/ftplugin/typst.lua @@ -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, {}) diff --git a/lua/core/lspconfig.lua b/lua/core/lspconfig.lua index 70c504f..4a66ae3 100644 --- a/lua/core/lspconfig.lua +++ b/lua/core/lspconfig.lua @@ -1,5 +1,12 @@ -- Manual lspconfig/changes where needed +vim.lsp.config("tinymist", { + settings = { + formatterMode = "typstyle", + exportPdf = "onSave", + }, +}) + vim.lsp.config("termux_language_server", { filetypes = { -- Android Termux