Add typst
This commit is contained in:
parent
d68a536a91
commit
20e00625b8
|
@ -33,6 +33,34 @@ if not configs.elixirls then
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- typst-lsp
|
||||||
|
|
||||||
|
if not configs.typst_lsp then
|
||||||
|
configs.typst_lsp = {
|
||||||
|
default_config = {
|
||||||
|
cmd = { 'typst-lsp' },
|
||||||
|
filetypes = { 'typst' },
|
||||||
|
single_file_support = true,
|
||||||
|
root_dir = function(fname)
|
||||||
|
return nvim_lsp.util.find_git_ancestor(fname)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
docs = {
|
||||||
|
description = [[
|
||||||
|
https://github.com/nvarner/typst-lsp
|
||||||
|
|
||||||
|
Language server for Typst.
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
require 'lspconfig'.typst_lsp.setup {
|
||||||
|
settings = {
|
||||||
|
exportPdf = "onSave",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-- keybindings
|
-- keybindings
|
||||||
|
|
||||||
local on_attach = function(client, bufrn)
|
local on_attach = function(client, bufrn)
|
||||||
|
@ -90,6 +118,7 @@ local servers = {
|
||||||
-- 'denols',
|
-- 'denols',
|
||||||
'clangd',
|
'clangd',
|
||||||
'zls',
|
'zls',
|
||||||
|
'typst-lsp',
|
||||||
}
|
}
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
nvim_lsp[lsp].setup {
|
nvim_lsp[lsp].setup {
|
||||||
|
|
|
@ -40,3 +40,18 @@ parser_config.hare = {
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.treesitter.language.register('hare', 'hare')
|
vim.treesitter.language.register('hare', 'hare')
|
||||||
|
|
||||||
|
-- typst syntax
|
||||||
|
-- parser_config.typst = {
|
||||||
|
-- install_info = {
|
||||||
|
-- url = "~/code/typst/tree-sitter-typst", -- local path or git repo
|
||||||
|
-- files = {"src/parser.c", "src/scanner.cc"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
|
||||||
|
-- -- optional entries:
|
||||||
|
-- -- branch = "main", -- default branch in case of git repo if different from master
|
||||||
|
-- generate_requires_npm = true, -- if stand-alone parser without npm dependencies
|
||||||
|
-- requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
|
||||||
|
-- },
|
||||||
|
-- filetype = "typ", -- if filetype does not match the parser name
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- vim.treesitter.language.register('typst', 'typ')
|
||||||
|
|
|
@ -148,6 +148,10 @@ local function init()
|
||||||
|
|
||||||
-- RFC browser
|
-- RFC browser
|
||||||
use 'mhinz/vim-rfc'
|
use 'mhinz/vim-rfc'
|
||||||
|
|
||||||
|
-- typst
|
||||||
|
use 'kaarmu/typst.vim'
|
||||||
|
use 'nvarner/typst-lsp'
|
||||||
end
|
end
|
||||||
|
|
||||||
local plugins = setmetatable({}, {
|
local plugins = setmetatable({}, {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user