ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.6k stars 396 forks source link

pkg: vim highlights dune lockfiles as if they were virata config files #10404

Open gridbugs opened 5 months ago

gridbugs commented 5 months ago

Vim treats the .pkg file extension as "Virata AConfig Configuration Script Syntax" (https://www.vim.org/scripts/script.php?script_id=930). This leads to confusing highlighting E.g. the % character is treated as the start of a comment, and $VARIABLES are highlighted as if only the first character is the variable, similar to in Makefiles.

I propose that we change the extension to .dune_pkg to avoid this confusion.

rgrinberg commented 5 months ago

How about we just updated vim-ocaml to override this for dune.lock/foo.pkg? files. It doesn't seem like a good trade-off to add cruft to our stuff to satisfy the tiny fraction of users that use "Virata".

gridbugs commented 5 months ago

It's not about virata users. Vim comes with virata syntax highlighting out of the box so all vim users see the virata syntax highlighting when editing .pkg files.

emillon commented 5 months ago

I agree with Rudi, it's fairly easy to change vim-ocaml to support this.

gridbugs commented 5 months ago

It looks like vim comes with syntax highlighting for ocaml and dune files out of the box (checked by installing vim and neovim in an empty docker image). I just realized that I never installed syntax highlighting vim packages for ocaml on my machine. I wonder how many other ocaml developers never installed ocaml-vim.