From 609bccbc55cfc81dcdd84b9faa9d33365a5a03a6 Mon Sep 17 00:00:00 2001 From: SimbaFs Date: Wed, 13 Dec 2023 22:13:01 +0800 Subject: [PATCH 1/2] add typst support --- lua/astrocommunity/pack/typst/README.md | 17 +++++++++++++++++ lua/astrocommunity/pack/typst/init.lua | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 lua/astrocommunity/pack/typst/README.md create mode 100644 lua/astrocommunity/pack/typst/init.lua diff --git a/lua/astrocommunity/pack/typst/README.md b/lua/astrocommunity/pack/typst/README.md new file mode 100644 index 000000000..f677920ff --- /dev/null +++ b/lua/astrocommunity/pack/typst/README.md @@ -0,0 +1,17 @@ +# Typst Language Pack + +This plugin pack does the following: + +- Add `typst,vim` for syntax +- Add `typst_lsp` language server + +if you want to use typst outside a git repository, typst_lsp cannot find `root_dir`, add the following setting to `lsp.config` in your nvim config + +```lua +typst_lsp = function(opts) + return { + exportPdf = "onType", -- Choose onType, onSave or never. + root_dir = require("lspconfig.util").root_pattern("README.md", ".git", "main.typ"), + } +end, +``` diff --git a/lua/astrocommunity/pack/typst/init.lua b/lua/astrocommunity/pack/typst/init.lua new file mode 100644 index 000000000..530a516fb --- /dev/null +++ b/lua/astrocommunity/pack/typst/init.lua @@ -0,0 +1,9 @@ +local utils = require "astronvim.utils" + +return { + { "kaarmu/typst.vim", ft = { "typst" } }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "typst_lsp") end, + }, +} From 67c436667b78e90d436a2d48e9888c08c1b90731 Mon Sep 17 00:00:00 2001 From: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:48:24 +0100 Subject: [PATCH 2/2] Update lua/astrocommunity/pack/typst/README.md --- lua/astrocommunity/pack/typst/README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lua/astrocommunity/pack/typst/README.md b/lua/astrocommunity/pack/typst/README.md index f677920ff..420fa0a39 100644 --- a/lua/astrocommunity/pack/typst/README.md +++ b/lua/astrocommunity/pack/typst/README.md @@ -5,13 +5,3 @@ This plugin pack does the following: - Add `typst,vim` for syntax - Add `typst_lsp` language server -if you want to use typst outside a git repository, typst_lsp cannot find `root_dir`, add the following setting to `lsp.config` in your nvim config - -```lua -typst_lsp = function(opts) - return { - exportPdf = "onType", -- Choose onType, onSave or never. - root_dir = require("lspconfig.util").root_pattern("README.md", ".git", "main.typ"), - } -end, -```