dune icon indicating copy to clipboard operation
dune copied to clipboard

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

Open gridbugs opened this issue 1 year ago • 4 comments
trafficstars

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.

gridbugs avatar Apr 08 '24 07:04 gridbugs

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

rgrinberg avatar Apr 09 '24 16:04 rgrinberg

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.

gridbugs avatar Apr 09 '24 23:04 gridbugs

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

emillon avatar Apr 17 '24 08:04 emillon

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.

gridbugs avatar Apr 18 '24 03:04 gridbugs