Skip to content

RFC: Adopting full syntax support into vimtex #1781

@lervag

Description

@lervag

As many may know, vimtex does not provide its own syntax plugin. Instead, it builds on top of the one provided by Dr. Chip which is shipped with both Vim and neovim.

I've started to think about changing this. As a first step, I would adopt the latest version by Dr. Chip and rewrite it in terms of vimtex code style. Through some iterations of improvements, I think this could lead to a reduced workload with respect to maintenance and further development. Pros and cons of the top of my head.

Pros:

  1. Having full control means we can merge and optimize the implementation.
  2. Having full control means we can fix issues raised here that are not really vimtex issues.
  3. Can add more tests for syntax related features to assist in controlled development.
  4. I may learn more about syntax scripts.
  5. May be possible to fix some sync related bugs and similar. With time.
  6. It would mean that vimtex becomes a full filetype plugin in every sense, i.e. no clash with internal plugins.

Cons:

  1. More work for me.
  2. More area where there can be failures.
  3. Would need to consider some cases like whether g:tex_flavor should be respected/overwritten and similar.
  4. Unsure about the license of tex.vim and whether it is OK to "fork" it.

My thoughts for how to do it is something like this:

  • Copy latest version.
  • Clean up code (non breaking), adapt option names into vimtex schemes (e.g. g:tex_conceal into something like g:vimtex_syntax_config = {'conceal': ...} and so on).
  • Remove some legacy stuff (e.g., I think perhaps things like g:tex_fast is unnecessary, similar with g:tex_nospell and perhaps also g:tex_conceal).

In any case, I would be happy to hear other peoples thoughts and opinions on this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions