Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pack): Add typst pack #684

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lua/astrocommunity/pack/typst/README.md
Original file line number Diff line number Diff line change
@@ -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,
```
Uzaaft marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions lua/astrocommunity/pack/typst/init.lua
Original file line number Diff line number Diff line change
@@ -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,
},
}