From 22e70f9725bec5c2afa7d3d7ad2b373d9b7f47f8 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Fri, 11 Oct 2024 10:50:29 +0200 Subject: [PATCH] feat: add typst support --- lua/autocommands.lua | 12 ++++++++++++ lua/lazy-configure.lua | 5 +++++ lua/lsp.lua | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 4106a53..830b4bc 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -60,3 +60,15 @@ vim.api.nvim_create_autocmd("FileType", { require('spelling').spell_keymap() end, }) + +-- Typst bindings +local typstgroup = vim.api.nvim_create_augroup("typst", { clear = true }) +vim.api.nvim_create_autocmd("FileType", { + pattern = { "typst" }, + group = typstgroup, + callback = function() + vim.keymap.set('', 'mp', ':TypstWatch', { noremap = true, silent = true, desc = "[M]ake [P]review" }) + require('spelling').spell_keymap() + end, +}) + diff --git a/lua/lazy-configure.lua b/lua/lazy-configure.lua index 8f9d721..5e696b2 100644 --- a/lua/lazy-configure.lua +++ b/lua/lazy-configure.lua @@ -301,5 +301,10 @@ require('lazy').setup({ cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, ft = { "markdown", "pandoc" }, build = function() vim.fn["mkdp#util#install"]() end, + }, + { + 'kaarmu/typst.vim', + ft = 'typst', + lazy = false, } }, {}) diff --git a/lua/lsp.lua b/lua/lsp.lua index 1a41f86..9e4b393 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -96,6 +96,7 @@ local servers = { 'norg', 'gitcommit', 'rst', + 'typst' }, ltex = { language = "auto", @@ -118,6 +119,9 @@ local servers = { } } }, + tinymist = { + exportPdf = "onType", + }, lua_ls = { Lua = { workspace = { checkThirdParty = false },