nvim --version: 0.4.4vim -u DEFAULTS (version: 8.2) behaves differently? No$TERM: xterm-256colorI see more and more tools using jsonc and json5 formats for their configuration files. I believe this trend will only increase as NeoVIM should consider supporting this formats
Basically a JSON with C-style line (//) and block (/**/) comments.
Exiting vim plugin: https://github.com/kevinoid/vim-jsonc
Described as a json for humans.
Here is the specifications: https://spec.json5.org
Existing vim plugin for it already: https://github.com/gutenye/json5.vim
nvim -u NORC$ nvim -u NORC sample.jsonc
<opened as a plain text>
$ nvim -u NORC sample.json5
<opened as a plain text>
opens up as a plain text
Opened as a jsonc/json5 file:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Please add labels: syntax, runtime
I already created a JSONC indent and syntax files. I'll for and push changes to my fork then link it here.
If you're talking about Neovim, you should report there.
I tested it on both
PR for VIM: #8500
there is no need for an issue when there is a pull request.
Closed #8499.
At the moment only changes to support jsonc have will be committed in PR #8500
I am looking into adding native support for json5 as well.
Is there any particular reason why we don't simply copy the linked plugin to support json5? Is there something missing in it, or any reason to not include json5 upstream?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
what plugin you are talking about? As far as I can see, the linked PR was included. So is there anything missing?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I'm talking about the json5 plugin (https://github.com/gutenye/json5.vim). The PR which was included adds support for jsonc. While similar, jsonc lacks support for trailing commas, newlines in strings, hexadecimal numbers... which json5 supports.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Have you checked with the maintainers, if they are okay including the plugin with Vim? @IzhakJakov have you considered adding json5 support as mentioned above
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
json5 seems to be a better version of jsonc I would suggest using the plugin for both. I currently use treesitter for syntax highlighting so maybe should be removed from the vim runtime version.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
jsonc and json5 are distinct enough that I'd like to see support for both. jsonc is widely used throughout VSCode and orbiting technologies like TypeScript (example: tsconfig.json). I don't think json5 is as widely deployed as jsonc at this time. But, json5 is a better spec -- not least of which because it actually has a spec. All jsonc has is a defacto reference implementation.
I would like to see a bundled jsonc.vim have a configuration option to allow trailing commas, like node-jsonc-parser has. That parser has support for it turned off by default, but you can flip a boolean to support it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@mike-clark-8192 jsonc has been available for a while. json5 was merged recently, it should be available if you use a HEAD version of vim or neovim.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()