#Editor and LSP support
1 messages · Page 1 of 1 (latest)
@alpine marten Were you able to get syntax highlighting in neovim?
Not yet. Will do so before my exams tho
Ty
im using this plugin which includes vim syntax highlighting as a temp replacement for treesitter:
https://github.com/kaarmu/typst.vim
as for lsp, typst_lsp in lspconfig does work, but u need a .git folder to detect root_dir
@subtle sierra I installed the vim plugin, but still no highlighting
which package manager r u using? could u send ur config?
@subtle sierra
Maybe try removing the vim.filetype.add line and see if it works
But then nvim thinks the .typ file is sql.
and the lsp doesn't connect
this is my current config for typst (im using lazy.nvim, and mason for lsp)
for lsp, i realized it only works if there's a .git at the same level as the main .typ file
i think the .typ ftplugin is handled by typst.vim already, so there shouldn't be a need to set it
What are your capabilities?
The typst.vim just doesn't get loaded
typ files should be detected by typst.vim however, the built-in sql plugin does some strange things and also get loaded (only neovim). It is strange that you don't get highlighting though. Are you sure it isn't loaded, e.g. is it listed in :scriptnames?
FYI, the native detection of the typst filetype should be effective in the next releases of both vim and neovim.
The editor will detect if a .typ file is either sql or typst by looking at its content.
The user can also set vim.g.filetype_typ = "typst" in his config.
Relevant PRs:
Problem: Typst filetype is not recognized.
Solution: Distinguish between sql and typst. (Gaetan Lepage, closes #12363)
Anyclue when the next release is?
Is there a Typst treesitter plugin for Neovim?
Of typst or nvim ?
If you are talking about nvim, you can add
vim.filetype.add({extension = { typ = "typst" }})
to your config.
There was an effort to create a parser: https://github.com/SeniorMars/tree-sitter-typst
and a nvim lua plugin: https://github.com/SeniorMars/typst.nvim
but the author seems to have abandonned those repos since early April...
A TreeSitter parser for the Typst File Format . Contribute to SeniorMars/tree-sitter-typst development by creating an account on GitHub.