Skip to content

Commit

Permalink
Use // comments for .json (zyedidia#3388)
Browse files Browse the repository at this point in the history
Add comments to `.json` files using `//` instead of the default `#`.

Even though JSON does not support comments, JSON5 and JSONC exist, so `//` is a much more sane default. It also improves the experience of editing micro's own config files.
  • Loading branch information
injust authored Jul 30, 2024
1 parent e042bb3 commit b8772b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/plugins/comment/comment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ft["ini"] = "; %s"
ft["java"] = "// %s"
ft["javascript"] = "// %s"
ft["jinja2"] = "{# %s #}"
ft["json"] = "// %s"
ft["julia"] = "# %s"
ft["kotlin"] = "// %s"
ft["lua"] = "-- %s"
Expand Down
1 change: 1 addition & 0 deletions runtime/plugins/comment/help/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ but it is only available for certain filetypes:
* java: `// %s`
* javascript: `// %s`
* jinja2: `{# %s #}`
* json: `// %s`
* julia: `# %s`
* kotlin: `// %s`
* lua: `-- %s`
Expand Down

0 comments on commit b8772b6

Please sign in to comment.