#Editor and LSP support

1 messages · Page 1 of 1 (latest)

alpine marten
#

Hi, is there any good LSP / editor support. I would like to use Typst in neovim but I can't seem to find any good resources on it

errant jungle
alpine marten
#

yeah i just found that

#

tihs very second

vast bough
#

@alpine marten Were you able to get syntax highlighting in neovim?

alpine marten
#

Not yet. Will do so before my exams tho

vast bough
#

Ty

subtle sierra
vast bough
#

@subtle sierra I installed the vim plugin, but still no highlighting

subtle sierra
#

which package manager r u using? could u send ur config?

vast bough
#

Packer

#

and sure

#

and then in my packer setup

vast bough
#

@subtle sierra

subtle sierra
# vast bough

Maybe try removing the vim.filetype.add line and see if it works

vast bough
#

and the lsp doesn't connect

subtle sierra
#

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

vast bough
#

What are your capabilities?

vast bough
#

The typst.vim just doesn't get loaded

dusty tree
#

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?

vast bough
#

@dusty tree yeah I checked it

#

it isn't there

vast bough
#

alrighty

#

reinstalled packer and it works now

summer wagon
#

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.

#
GitHub

Problem: Typst filetype is not recognized.
Solution: Distinguish between sql and typst. (Gaetan Lepage, closes #12363)

GitHub

vim-patch:9.0.1539: typst filetype is not recognized
Problem: Typst filetype is not recognized.
Solution: Distinguish between sql and typst. (Gaetan Lepage, closes vim/vim#12363)
vim/vim@4ce1bda

vast bough
#

Anyclue when the next release is?

crude wren
#

Is there a Typst treesitter plugin for Neovim?

summer wagon
summer wagon
# crude wren Is there a Typst treesitter plugin for Neovim?

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...

GitHub

A TreeSitter parser for the Typst File Format . Contribute to SeniorMars/tree-sitter-typst development by creating an account on GitHub.

GitHub

WIP. Goals: Treesitter highlighting, snippets, and a smooth intergration with neovim. - GitHub - SeniorMars/typst.nvim: WIP. Goals: Treesitter highlighting, snippets, and a smooth intergration with...